Skip to content

Commit

Permalink
[d3d11] Only store low 8 bits of stencil reference
Browse files Browse the repository at this point in the history
Seems to match behaviour of the D3D11 runtime, in that OMGetDepthStencilState
will not retain the high bits.

Found by CME. Should fix doitsujin#1784.
  • Loading branch information
doitsujin authored and Blisto91 committed Jan 18, 2023
1 parent 43991ac commit dbe4e86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/d3d11/d3d11_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,11 @@ namespace dxvk {
m_state.om.dsState = depthStencilState;
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();
Expand Down

0 comments on commit dbe4e86

Please sign in to comment.