[d3d11] Only store low 8 bits of stencil reference

Seems to match behaviour of the D3D11 runtime, in that OMGetDepthStencilState
will not retain the high bits.

Found by CME. Should fix #1784.
This commit is contained in:
Philip Rebohle 2022-12-11 19:28:37 +01:00 committed by Philip Rebohle
parent 7b2024888e
commit c55c09368b
1 changed files with 4 additions and 0 deletions

View File

@ -2261,6 +2261,10 @@ namespace dxvk {
ApplyDepthStencilState();
}
// The D3D11 runtime only appears to store the low 8 bits,
// and some games rely on this behaviour. Do the same here.
StencilRef &= 0xFF;
if (m_state.om.stencilRef != StencilRef) {
m_state.om.stencilRef = StencilRef;
ApplyStencilRef();