Skip to content

Commit 07672b5

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 2c608b4 commit 07672b5

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.cached_rt_view != config.tex && m_state.cached_dsv != 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
@@ -2599,7 +2599,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
25992599
GLState::scissor = config.scissor;
26002600
}
26012601

2602-
if (config.tex)
2602+
if (config.tex && (m_features.texture_barrier || (config.tex != config.rt)))
26032603
CommitClear(config.tex, true);
26042604
if (config.pal)
26052605
CommitClear(config.pal, true);
@@ -2715,7 +2715,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
27152715
}
27162716
IASetPrimitiveTopology(topology);
27172717

2718-
if (config.tex)
2718+
if (config.tex && (m_features.texture_barrier || (config.tex != config.rt)))
27192719
PSSetShaderResource(0, config.tex);
27202720
if (config.pal)
27212721
PSSetShaderResource(1, config.pal);

0 commit comments

Comments
 (0)