ClearDepthStencilView doesn't clear the stencil buffer

Started by
0 comments, last by Adam Miles 10 years, 9 months ago

The call in my application to ID3D11DeviceContext::ClearDepthStencilView (with D3D11_CLEAR_STENCIL as the flag) doesn't clear the stencil buffer. Stencil operations work fine, but the stencil buffer is cleared to 0xff after every buffer swap regardless of the passed value. What could be causing this?

EDIT: The 0xff is from another call to the same function earlier in the code, but then why does that call work and the other doesn't?

Advertisement

What are you using to verify the stencil buffer isn't being cleared?

Have you tried running with the D3D11 Debug Layer turned on to see if it's giving you any warnings or errors?

If you're passing through a valid DepthStencilView with a stencil 'channel' I can't think of any reason it wouldn't be clearing besides the very unlikely event of a driver bug / hardware failure (but we're a long way from proving that to be the case).

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

This topic is closed to new replies.

Advertisement