Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-12-11 21:28:37 +0300
committerPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-12-11 21:32:42 +0300
commit83d820cf1d892e615c2b3e325f30697dbf712313 (patch)
treec5ee70b623505b961fff668ab2bc08438b290e5c
parent7b2024888ea326230f2628bce6429538dcdaa31d (diff)
[d3d11] Only store low 8 bits of stencil referenced3d11-stencil-fix
Seems to match behaviour of the D3D11 runtime, in that OMGetDepthStencilState will not retain the high bits. Found by CME. Should fix #1784.
-rw-r--r--src/d3d11/d3d11_context.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp
index 3c649c05..37135a75 100644
--- a/src/d3d11/d3d11_context.cpp
+++ b/src/d3d11/d3d11_context.cpp
@@ -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();