In a stand-alone application I had control over both of those, and also, parameter mismatch was easy to diagnose with D3D debug layer (D3D11_CREATE_DEVICE_DEBUG). Now in a plugin DLL, I am lost and only can tell something is wrong because nothing is rendered after the OMSetRenderTargets() call. Any hint would be much appreciated.
Here is the essence of what I am doing:
UINT width, height;
ID3D11RenderTargetView* targetView;
ID3D11Texture2D* depthTex;
ID3D11DepthStencilView* depthView;
width = (UINT)pRenderData->GetTextureWidth();
height = (UINT)pRenderData->GetTextureHeight();
targetView = pRenderData->GetOutputColor();
D3D11_TEXTURE2D_DESC texDesc = // <--
CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_D32_FLOAT, width, height, 1, 1, D3D11_BIND_DEPTH_STENCIL);
D3D11_DEPTH_STENCIL_VIEW_DESC viewDesc =
CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DSV_DIMENSION_TEXTURE2D);
dev->CreateTexture2D(&texDesc, nullptr, &depthTex);
dev->CreateDepthStencilView(depthTex, &viewDesc, &depthView);
ctx->ClearDepthStencilView(depthView, D3D11_CLEAR_DEPTH, 1.0f, 0);
ctx->OMSetRenderTargets(1, &targetView, depthView); // <--
Thanks,
Antons