diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 606756ffa..457a414d2 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5815,12 +5815,8 @@ namespace dxvk { const uint32_t textureBitMask = 0b11u << offset; const uint32_t textureBits = textureType << offset; - if ((m_samplerTypeBitfield & textureBitMask) != textureBits) { - m_flags.set(D3D9DeviceFlag::DirtyFFPixelShader); - - m_samplerTypeBitfield &= ~textureBitMask; - m_samplerTypeBitfield |= textureBits; - } + m_samplerTypeBitfield &= ~textureBitMask; + m_samplerTypeBitfield |= textureBits; } EmitCs([ @@ -5842,9 +5838,6 @@ namespace dxvk { for (uint32_t i : bit::BitMask(mask & pixelShaderMask)) typeMask |= 0b11u << (i * 2u); - if ((m_samplerTypeBitfield & typeMask) != 0) { - m_flags.set(D3D9DeviceFlag::DirtyFFPixelShader); - m_samplerTypeBitfield &= ~typeMask; } @@ -6570,8 +6563,9 @@ namespace dxvk { void D3D9DeviceEx::UpdateFixedFunctionPS() { // Shader... - if (m_flags.test(D3D9DeviceFlag::DirtyFFPixelShader)) { + if (m_flags.test(D3D9DeviceFlag::DirtyFFPixelShader) || m_lastSamplerTypeBitfieldFF != m_samplerTypeBitfield) { m_flags.clr(D3D9DeviceFlag::DirtyFFPixelShader); + m_lastSamplerTypeBitfieldFF = m_samplerTypeBitfield; // Used args for a given operation. auto ArgsMask = [](DWORD Op) { diff --git a/src/d3d9/d3d9_device.h b/src/d3d9/d3d9_device.h index 5f4de42da..1d49f4af9 100644 --- a/src/d3d9/d3d9_device.h +++ b/src/d3d9/d3d9_device.h @@ -1211,6 +1211,7 @@ namespace dxvk { uint32_t m_lastPointMode = 0; uint32_t m_lastFetch4 = 0; uint32_t m_lastHazardsDS = 0; + uint32_t m_lastSamplerTypeBitfieldFF = 0; D3D9ShaderMasks m_vsShaderMasks = D3D9ShaderMasks(); D3D9ShaderMasks m_psShaderMasks = FixedFunctionMask;