mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-10-11 22:49:56 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user