Skip to content

Commit 420f417

Browse files
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.
1 parent 4f5bde2 commit 420f417

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pcsx2/GS/Renderers/DX11/GSDevice11.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,7 +2804,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
28042804

28052805
// Preemptively bind srv if possible.
28062806
// We update the local state, then if there are srv conflicts PSUnbindConflictingSRVs will update the gpu state.
2807-
if (config.tex)
2807+
if (config.tex && config.tex != config.rt)
28082808
{
28092809
CommitClear(config.tex);
28102810
if (m_state.current_rt != config.tex && m_state.current_ds != config.tex)
@@ -2820,7 +2820,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
28202820
// Should be called before changing current gpu state.
28212821
PSUnbindConflictingSRVs(colclip_rt ? colclip_rt : config.rt, read_only_dsv ? nullptr : config.ds);
28222822

2823-
if (config.tex)
2823+
if (config.tex && config.tex != config.rt)
28242824
PSSetShaderResource(0, config.tex);
28252825
if (config.pal)
28262826
PSSetShaderResource(1, config.pal);

pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
26242624
GLState::scissor = config.scissor;
26252625
}
26262626

2627-
if (config.tex)
2627+
if (config.tex && (m_features.texture_barrier || (config.tex != config.rt)))
26282628
CommitClear(config.tex, true);
26292629
if (config.pal)
26302630
CommitClear(config.pal, true);
@@ -2740,7 +2740,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
27402740
}
27412741
IASetPrimitiveTopology(topology);
27422742

2743-
if (config.tex)
2743+
if (config.tex && (m_features.texture_barrier || (config.tex != config.rt)))
27442744
PSSetShaderResource(0, config.tex);
27452745
if (config.pal)
27462746
PSSetShaderResource(1, config.pal);

0 commit comments

Comments
 (0)