From 75674866681d7a5c9624fab3f8e75dad0519d848 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 10 Feb 2020 09:14:59 +0100 Subject: [PATCH] [d3d9] Handle invalid alpha ref correctly --- 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 8d1e188a..8864a272 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4570,7 +4570,7 @@ namespace dxvk { auto& rs = m_state.renderStates; if constexpr (Item == D3D9RenderStateItem::AlphaRef) { - float alpha = float(rs[D3DRS_ALPHAREF]) / 255.0f; + float alpha = float(rs[D3DRS_ALPHAREF] & 0xFF) / 255.0f; UpdatePushConstant(&alpha); } else if constexpr (Item == D3D9RenderStateItem::FogColor) {