GS/DX12: Copy/bind rt when tex is fb on slot 0.

This commit is contained in:
lightningterror 2025-04-18 19:43:24 +02:00
parent 80ca5ea5fd
commit 17bf27c018
2 changed files with 6 additions and 3 deletions

View File

@ -2631,7 +2631,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
} }
GSTexture* rt_copy = nullptr; GSTexture* rt_copy = nullptr;
if (config.require_one_barrier || (config.tex && config.tex == config.rt)) // Used as "bind rt" flag when texture barrier is unsupported if (config.require_one_barrier || (config.tex && config.tex == config.rt)) // Used as "bind rt" flag when texture barrier is unsupported.
{ {
// Bind the RT.This way special effect can use it. // Bind the RT.This way special effect can use it.
// Do not always bind the rt when it's not needed, // Do not always bind the rt when it's not needed,

View File

@ -3900,7 +3900,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
} }
} }
if (config.require_one_barrier) if (config.require_one_barrier || (config.tex && config.tex == config.rt)) // Used as "bind rt" flag when texture barrier is unsupported.
{ {
// requires a copy of the RT // requires a copy of the RT
draw_rt_clone = static_cast<GSTexture12*>(CreateTexture(rtsize.x, rtsize.y, 1, colclip_rt ? GSTexture::Format::ColorClip : GSTexture::Format::Color, true)); draw_rt_clone = static_cast<GSTexture12*>(CreateTexture(rtsize.x, rtsize.y, 1, colclip_rt ? GSTexture::Format::ColorClip : GSTexture::Format::Color, true));
@ -3913,7 +3913,10 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
draw_rt_clone->SetState(GSTexture::State::Invalidated); draw_rt_clone->SetState(GSTexture::State::Invalidated);
CopyRect(draw_rt, draw_rt_clone, config.drawarea, config.drawarea.left, config.drawarea.top); CopyRect(draw_rt, draw_rt_clone, config.drawarea, config.drawarea.left, config.drawarea.top);
PSSetShaderResource(2, draw_rt_clone, true); if (config.require_one_barrier)
PSSetShaderResource(2, draw_rt_clone, true);
if (config.tex && config.tex == config.rt)
PSSetShaderResource(0, draw_rt_clone, true);
} }
} }