# Can state setting warnings be ignored?

If I am running DirectX 11 in debug mode (D3D11_CREATE_DEVICE_DEBUG), I am constantly getting these warnings:

D3D11 WARNING: ID3D11DeviceContext::OMSetRenderTargets: Resource being set to OM DepthStencil is still bound on input! [ STATE_SETTING WARNING #9: DEVICE_OMSETRENDERTARGETS_HAZARD]
D3D11 WARNING: ID3D11DeviceContext::OMSetRenderTargets[AndUnorderedAccessViews]: Forcing PS shader resource slot 6 to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD]


It is because I am setting a resource as a render target while it is currently bound to the PS. However, my rendering flow is set up such as it relies on the api to force the resource slot to null, and it works.

Is there any reason I should be bothered with these warnings or I can rely on the api to enforce this every time? I only tested on 2 GPU-s: Intel HD 3000 and Nvidia GT525m.

• DirectX display most of warnings in output when you pass D3D11_CREATE_DEVICE_DEBUG flag to D3D11CreateDeviceAndSwapChain(...) - you can use 0 to discard them. But it's usually a good idea to keep the warnings. You are aware of them now and you know that they don't cause error. But maybe in future, after changing something in code, you will get an error because of that approach. In that case they will focus you on the problem. After all, purpose of warnings is to focus attention on places that are likely to cause problems now or in future (which does not mean they will). – PolGraphic Dec 8 '14 at 19:07