Jump to content
  • Advertisement
Sign in to follow this  

STENCIL_OP_DECR_SAT and Stencil(Read/Write)Mask

This topic is 2808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


if I set StencilFailOp = D3D11_STENCIL_OP_DECR_SAT; and the Stencil(Read/Write)Mask to something != 0xff, will that mask be honored when decreasing the stencil value?

For example I have both masks set to ~64. I look for stencil values equal to 1. If I encounter a pixel with stencil == 2, I want it to become 1. If I encounter a pixel with stencil == 64 I want it to remain exactly the way it is.
I thought because of the read mask, such a pixel would be read as 0, decrementing it would yield 0 again. Writing 0 except the masked bit would change nothing. But the stencil value seems to change never the less.

Any idea where my thinking is wrong?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!