GS/DX11: Further improve shader resource pre binding.

Currently pre binding doesn't work correctly/to it's full capacity as I forgot to update PSUnbindConflictingSRVs.
When doing a pre bind idea is to update local state, then if there are no conflicts to use that newly updated local state instead of unbinding the slot, this will avoid unnecessary re bindings.
This commit is contained in:
lightningterror
2026-03-11 16:27:02 +01:00
parent cd9fe1630b
commit e3565eb924
+6 -1
View File
@@ -2515,7 +2515,12 @@ void GSDevice11::PSUnbindConflictingSRVs(GSTexture* tex1, GSTexture* tex2)
// We chech against what's currently bound (cached_sr_views), then update local state (ps_sr_views) which calls PSUpdateShaderState to update gpu state.
if ((tex1 && m_state.ps_cached_sr_views[i] == *static_cast<GSTexture11*>(tex1)) || (tex2 && m_state.ps_cached_sr_views[i] == *static_cast<GSTexture11*>(tex2)))
{
m_state.ps_sr_views[i] = nullptr;
// Local and gpu cached state can differ, if it does check if it conflicts and if it doesn't then we can bind that instead of unbinding.
const bool unbind_needed = (tex1 && m_state.ps_sr_views[i] == *static_cast<GSTexture11*>(tex1)) || (tex2 && m_state.ps_sr_views[i] == *static_cast<GSTexture11*>(tex2));
if (unbind_needed)
m_state.ps_sr_views[i] = nullptr;
changed = true;
}
}