CreateTexture2D call unsuccessful

Started by
1 comment, last by ybatra 11 years, 1 month ago

D3D10_TEXTURE2D_DESC desc;

ZeroMemory( &desc, sizeof( desc ) );
desc.Width=width;
desc.Height=height;
desc.Format=DXGI_FORMAT_R8G8B8A8_UNORM;
desc.Usage=D3D10_USAGE_DEFAULT;
desc.MipLevels=1;
desc.ArraySize = 1;
desc.SampleDesc.Count=1;
desc.SampleDesc.Quality=0;
desc.BindFlags=D3D10_BIND_RENDER_TARGET;
desc.MiscFlags = D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX;
hr=g_pd3dDevice->CreateTexture2D( &desc, NULL, &g_pRenderTargetShared);
if(FAILED(hr))
return FALSE;

I'm trying to use above texture as shared resource but create texture call is unsuccessful to create shared texture.
Advertisement

Create your device with the D3D10_CREATE_DEVICE_DEBUG flag, and check your debugger output window for a message explaining why the call failed.

No I found the solution, it is failing because D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX flag support feature level 10.1 and I have to create it using device1.

This topic is closed to new replies.

Advertisement