Weird Observation with Depth/Stencil States

Started by
-1 comments, last by 21st Century Moose 11 years, 10 months ago
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: D3D11_DEPTH_STENCIL_DESC ddesc;

ddesc.DepthEnable = FALSE;
ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;

Creation succeeds, but if I then do a GetDesc on the created state, I get the following: ddesc.DepthEnable = FALSE;
ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;

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 - http://msdn.microsoft.com/en-us/library/windows/desktop/bb205120%28v=vs.85%29.aspx - 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?

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement