diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 52016039..4cc39399 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -3394,7 +3394,7 @@ namespace dxvk { if (shader != nullptr) { m_flags.set(D3D9DeviceFlag::DirtyFFPixelShader); - BindShader(GetCommonShader(shader)); + BindShader(newShader); newShaderMasks = newShader->GetShaderMask(); } else { @@ -3408,7 +3408,9 @@ namespace dxvk { // If we have any RTs we would have bound to the the FB // not in the new shader mask, mark the framebuffer as dirty // so we unbind them. - if (m_boundRTs & m_anyColorWrites & m_psShaderMasks.rtMask & (~newShaderMasks.rtMask)) + uint32_t oldUseMask = m_activeRTs & m_psShaderMasks.rtMask; + uint32_t newUseMask = m_activeRTs & newShaderMasks.rtMask; + if (oldUseMask != newUseMask) m_flags.set(D3D9DeviceFlag::DirtyFramebuffer); if (m_psShaderMasks.samplerMask != newShaderMasks.samplerMask ||