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 #1784.
  • Loading branch information
doitsujin committed Dec 11, 2022
1 parent 7b20248 commit 83d820c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/d3d11/d3d11_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 83d820c

Please sign in to comment.