np::d3d12_depth_raster refused any stencil state whose DB_STENCILREFMASK_BF
masks differ from DB_STENCILREFMASK, even with DB_DEPTH_CONTROL.BACKFACE_ENABLE
clear, where RDNA2 ignores the _BF register and the back face uses the front
one (as the function already did for the back face's ops and function). The
empty result made fill_depth_raster_state fall back to its defaults for the
whole PSO: depth ALWAYS with writes, no culling, stencil off. Found by
kevincommits in #1608 (RT-STATE-AUDIT-PIPELINE, item 1).
The masks are now compared only when BACKFACE_ENABLE is set. Two-sided stencil
with differing masks is still refused, since D3D12_DEPTH_STENCIL_DESC has one
pair.
native_pso_depth_test: a single-sided stencil state with
DB_STENCILREFMASK_BF = 0, and one with a differing back write mask, are built
with their depth, cull and front stencil state. Both checks fail on main.
AI-assisted (Claude Code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>