The issue was previously discussed in #514.
Unity shaders need to disable writing to the depth buffer in a render pipeline with depthWriteEnabled:false, for a depth texture currently used by the render pass, while still writing to the stencil. If necessary, I could end the current render pass and start a new one with readOnly depth and writable stencil. But it would be nice if the depthWriteEnabled pipeline state would control that. In all cases, we need separate stencil and depth read-only states.