From 420f4177c93a8dc884db4afe4a1df4b3071e1afe Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Sun, 5 Apr 2026 10:36:04 +0200 Subject: [PATCH] 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. --- pcsx2/GS/Renderers/DX11/GSDevice11.cpp | 4 ++-- pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index 07cbc3f241..2fe398afc2 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -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); diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index 57a98d28bf..70291cddbb 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -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);