Sign in to follow this  
liggxibbler

ClearDepthStencilView doesn't clear the stencil buffer

Recommended Posts

liggxibbler    105

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?

Edited by liggxibbler

Share this post


Link to post
Share on other sites
ajmiles    3320

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).

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