[d3d9] Fix unbinding RTs

Fixes a regression with 8560efa3c7 in ND1.

Also more optimized.
This commit is contained in:
Joshua Ashton 2023-06-24 03:41:31 +01:00
parent 362743c1d6
commit 6b60de2d31
1 changed files with 4 additions and 2 deletions

View File

@ -3394,7 +3394,7 @@ namespace dxvk {
if (shader != nullptr) {
m_flags.set(D3D9DeviceFlag::DirtyFFPixelShader);
BindShader<DxsoProgramTypes::PixelShader>(GetCommonShader(shader));
BindShader<DxsoProgramTypes::PixelShader>(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 ||