-
Notifications
You must be signed in to change notification settings - Fork 92
Description
## I can use DirectX 12 to write to a D3D11Image on a number of Windows 10 machines using a D3D11On12CreateDevice dx11 device.
{
..
IUnknown pUnk = (IUnknown)pResource;
IDXGIResource * pDXGIResource;
ID3D11Resource * pDx11Resource;
HANDLE sharedHandle;
ID3D11Resource * tempResource11;
ID3D11Texture2D * pOutputResource;
D3D11_RENDER_TARGET_VIEW_DESC rtDesc;
rtDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
rtDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
rtDesc.Texture2D.MipSlice = 0;
pUnk->QueryInterface(__uuidof(IDXGIResource), (void**)&pDXGIResource);
pUnk->QueryInterface(__uuidof(ID3D11Resource), (void**)&pDx11Resource);
pDXGIResource->GetSharedHandle(&sharedHandle)))return hr;
m_d3dDevice11on12->OpenSharedResource(sharedHandle, __uuidof(ID3D11Resource), (void**)(&tempResource11));
tempResource11->QueryInterface(__uuidof(ID3D11Texture2D), (void**)(&pOutputResource));
m_d3dDevice11on12->CreateRenderTargetView(pOutputResource, &rtDesc, &m_pRenderTargetView1);
pDXGIResource->Release();
tempResource11->Release();
...
}
## However as soon as I enable debugging
ComPtr debugController;
D3D12GetDebugInterface(IID_PPV_ARGS(debugController.GetAddressOf());
debugController->EnableDebugLayer();
I get the following error (exception thrown)
D3D12 ERROR: ID3D12CompatibilityDevice::ReflectSharedProperties: Resource provided was not shared by D3D11, or with a D3D11 desc. [ MISCELLANEOUS ERROR #916: REFLECTSHAREDPROPERTIES_INVALIDOBJECT]