From a791493d14c67c1553756563238e8531b88c83ad Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 22 Jun 2023 15:47:51 +0100 Subject: [PATCH] [d3d9] Don't rebind AlphaTest when changing RT if not necessary --- src/d3d9/d3d9_device.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index bddac493..6ca54ad6 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -1439,8 +1439,6 @@ namespace dxvk { m_flags.set(D3D9DeviceFlag::DirtyViewportScissor); m_state.scissorRect = scissorRect; } - - m_flags.set(D3D9DeviceFlag::DirtyAlphaTestState); } if (m_state.renderTargets[RenderTargetIndex] == rt) @@ -1472,6 +1470,11 @@ namespace dxvk { if (RenderTargetIndex == 0) { if (likely(texInfo != nullptr)) { + if (IsAlphaTestEnabled()) { + // Need to recalculate the precision. + m_flags.set(D3D9DeviceFlag::DirtyAlphaTestState); + } + bool validSampleMask = texInfo->Desc()->MultiSample > D3DMULTISAMPLE_NONMASKABLE; if (validSampleMask != m_flags.test(D3D9DeviceFlag::ValidSampleMask)) {