GS/GL/DX11: Don't bind source tex on shader resource if it's tex is fb with no barrier.

Texture will be copied, the copy will be used as a shader resource. Avoids useless binds.
This commit is contained in:
lightningterror
2026-04-15 21:53:40 +02:00
parent 4f5bde2cef
commit 420f4177c9
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -2804,7 +2804,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
// Preemptively bind srv if possible.
// We update the local state, then if there are srv conflicts PSUnbindConflictingSRVs will update the gpu state.
if (config.tex)
if (config.tex && config.tex != config.rt)
{
CommitClear(config.tex);
if (m_state.current_rt != config.tex && m_state.current_ds != config.tex)
@@ -2820,7 +2820,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
// Should be called before changing current gpu state.
PSUnbindConflictingSRVs(colclip_rt ? colclip_rt : config.rt, read_only_dsv ? nullptr : config.ds);
if (config.tex)
if (config.tex && config.tex != config.rt)
PSSetShaderResource(0, config.tex);
if (config.pal)
PSSetShaderResource(1, config.pal);
+2 -2
View File
@@ -2624,7 +2624,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
GLState::scissor = config.scissor;
}
if (config.tex)
if (config.tex && (m_features.texture_barrier || (config.tex != config.rt)))
CommitClear(config.tex, true);
if (config.pal)
CommitClear(config.pal, true);
@@ -2740,7 +2740,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
}
IASetPrimitiveTopology(topology);
if (config.tex)
if (config.tex && (m_features.texture_barrier || (config.tex != config.rt)))
PSSetShaderResource(0, config.tex);
if (config.pal)
PSSetShaderResource(1, config.pal);