Ok, reviewing this part of my code, and while I did attempt to compare masking values, I think I made a couple mistakes. 1. I'm comparing the ui stencil depth as a float instead of an int... 2. The "_Stencil" or "stencil ID" value I think would be a better comparison to make in this situation.
I think that change *should* fix this, but I'm also currently cleaning up the code in that area a little bit, right now. There could be something else I'm forgetting, too.
If you want to give a build with this change a shot, send me an email though my website!