Re: Direct3D 10 PIX, DX10 and Render to Texture
supagu
no crash, actually pix stops recording on:
GetD3DDevice()->OMGetRenderTargets( 1, &mOrigRTV, &mOrigDSV );
> debug validation layer turned on
device is created with D3D10_CREATE_DEVICE_DEBUG flag
> and made sure it doesn't spew about problems with API usage
this might explain it:
D3D10: WARNING: ID3D10Device::OMSetRenderTargets: Resource being set to OM RenderTarget slot 0 is still bound on input! [ STATE_SETTING WARNING #9: DEVICE_OMSETRENDERTARGETS_HAZARD ]
D3D10: WARNING: ID3D10Device::OMSetRenderTargets: Forcing PS shader resource slot 0 to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD ]
here is the code snippet it complains about:
void DX10RenderTexture::BindTarget(int index, bool clear, int flags)
{
// Store off original render targets
mDevice->GetD3DDevice()->OMGetRenderTargets( 1, &mOrigRTV, &mOrigDSV );
ID3D10RenderTargetView* aRTViews[1] = { 0 };
if (flags & RTF_Colour)
aRTViews[0] = mRenderTargetView;
mDevice->GetD3DDevice()->OMSetRenderTargets(1, aRTViews, (flags & RTF_Depth) mDepthStencilView : 0);
if (clear)
{
mDevice->GetD3DDevice()->ClearRenderTargetView(mRenderTargetView, (float*)&mClearColour);
mDevice->GetD3DDevice()->ClearDepthStencilView(mDepthStencilView, D3D10_CLEAR_DEPTH, 1.0f, 0);
}
}
the warning pops up when BindTexture is called for the second time in the frame, not sure what the warning means but it probably is my problem i guess