[d3d9] Use m_boundRTs for COLORWRITEENABLE checks

Also allows us to check for NULL RTs with this too and avoid extra work!
This commit is contained in:
Joshua Ashton 2023-05-24 13:42:42 +01:00
parent 8560efa3c7
commit 075c0bf203
1 changed files with 3 additions and 3 deletions

View File

@ -1979,21 +1979,21 @@ namespace dxvk {
m_flags.set(D3D9DeviceFlag::DirtyBlendState);
break;
case D3DRS_COLORWRITEENABLE1:
if (likely(!old != !Value && m_state.renderTargets[1] != nullptr)) {
if (likely(!old != !Value && (m_boundRTs & (1 << 1)))) {
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
UpdateActiveRTs(1);
}
m_flags.set(D3D9DeviceFlag::DirtyBlendState);
break;
case D3DRS_COLORWRITEENABLE2:
if (likely(!old != !Value && m_state.renderTargets[2] != nullptr)) {
if (likely(!old != !Value && (m_boundRTs & (1 << 2)))) {
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
UpdateActiveRTs(2);
}
m_flags.set(D3D9DeviceFlag::DirtyBlendState);
break;
case D3DRS_COLORWRITEENABLE3:
if (likely(!old != !Value && m_state.renderTargets[3] != nullptr)) {
if (likely(!old != !Value && (m_boundRTs & (1 << 3)))) {
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
UpdateActiveRTs(3);
}