Sign in to follow this  
mhagain

Weird Observation with Depth/Stencil States

Recommended Posts

So, I'm creating a DepthStencil state to disable both depth testing and depth writing.

Setup is completely standard, and setting a breakpoint on the creation code confirms that the values are going in:[code] D3D11_DEPTH_STENCIL_DESC ddesc;

ddesc.DepthEnable = FALSE;
ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;[/code]
Creation succeeds, but if I then do a GetDesc on the created state, I get the following:[code] ddesc.DepthEnable = FALSE;
ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;[/code]
Also, if at runtime, I set the state, do GetDepthStencilState, then GetDesc, I also get the above - again with the D3D11_DEPTH_WRITE_MASK_ALL. PIX also tells me that it has D3D11_DEPTH_WRITE_MASK_ALL.

Running with AMD GPU Perf Studio confirms that writes to the depth buffer are happening, but this page - [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb205120%28v=vs.85%29.aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb205120%28v=vs.85%29.aspx[/url] - indicates that this is not normal or expected behaviour - it should be answering "No" to "Is Depth Write enabled?" and earlying-out. Clearly it's not, and this is measurable as a quite significant performance decrease (did I mention that it's in a performance-sensitive part of the code - drawing fullscreen quads for post-processing filters).

What gives?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this