From 1ea79cf13698b3ac829df89433d0e09398b7fc51 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Mon, 9 Aug 2021 19:52:31 +0200 Subject: [PATCH] [d3d9] Only respect relevant bits of D3DRS_STENCILREF --- src/d3d9/d3d9_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index f5d69b9e..16f02cfc 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5682,7 +5682,7 @@ namespace dxvk { void D3D9DeviceEx::BindDepthStencilRefrence() { auto& rs = m_state.renderStates; - uint32_t ref = uint32_t(rs[D3DRS_STENCILREF]); + uint32_t ref = uint32_t(rs[D3DRS_STENCILREF]) & 0xff; EmitCs([cRef = ref] (DxvkContext* ctx) { ctx->setStencilReference(cRef);