Skip to content

Commit aa9b04e

Browse files
GS/HW: Check if alpha second pass copies are feedback loops.
1 parent 266a8bd commit aa9b04e

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

pcsx2/GS/Renderers/DX11/GSDevice11.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,7 +2945,8 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
29452945
}
29462946

29472947
const bool tex_is_fb = config.tex && config.tex == draw_rt;
2948-
if (draw_rt && (((config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy)) && config.ps.IsFeedbackLoopRT()) || tex_is_fb))
2948+
if (draw_rt && (((config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy)) &&
2949+
(config.ps.IsFeedbackLoopRT() || config.alpha_second_pass.ps.IsFeedbackLoopRT())) || tex_is_fb))
29492950
{
29502951
config.require_one_barrier |= (tex_is_fb && !config.require_full_barrier);
29512952

@@ -2956,7 +2957,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
29562957
}
29572958

29582959
if (draw_ds && (config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy)) &&
2959-
m_features.depth_feedback && config.ps.IsFeedbackLoopDepth())
2960+
m_features.depth_feedback && (config.ps.IsFeedbackLoopDepth() || config.alpha_second_pass.ps.IsFeedbackLoopDepth()))
29602961
{
29612962
// Requires a copy of the DS.
29622963
draw_ds_clone = CreateTexture(rtsize.x, rtsize.y, 1, draw_ds->GetFormat(), true);

pcsx2/GS/Renderers/DX12/GSDevice12.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4371,8 +4371,8 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
43714371

43724372
GSTexture12* draw_ds_as_rt = static_cast<GSTexture12*>(m_ds_as_rt);
43734373

4374-
const bool feedback_rt = draw_rt && (((config.require_one_barrier || (config.require_full_barrier && m_features.texture_barrier)) && config.ps.IsFeedbackLoopRT()) ||
4375-
(config.tex && config.tex == config.rt));
4374+
const bool feedback_rt = draw_rt && (((config.require_one_barrier || (config.require_full_barrier && m_features.texture_barrier)) && (config.ps.IsFeedbackLoopRT() ||
4375+
config.alpha_second_pass.ps.IsFeedbackLoopRT())) || (config.tex && config.tex == config.rt));
43764376
const bool feedback_depth = draw_ds_as_rt != nullptr;
43774377

43784378
if (feedback_rt && !m_features.texture_barrier)

pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,8 +2932,8 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
29322932
}
29332933

29342934
const bool tex_is_fb = config.tex && config.tex == draw_rt;
2935-
if (draw_rt && (((config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy)) && config.ps.IsFeedbackLoopRT()) ||
2936-
tex_is_fb) && !m_features.texture_barrier)
2935+
if (draw_rt && (((config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy)) &&
2936+
(config.ps.IsFeedbackLoopRT() || config.alpha_second_pass.ps.IsFeedbackLoopRT())) || tex_is_fb) && !m_features.texture_barrier)
29372937
{
29382938
config.require_one_barrier |= (tex_is_fb && !config.require_full_barrier);
29392939

@@ -2944,7 +2944,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
29442944
}
29452945

29462946
if (draw_ds && (config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy)) &&
2947-
!m_features.texture_barrier && m_features.depth_feedback && config.ps.IsFeedbackLoopDepth())
2947+
!m_features.texture_barrier && m_features.depth_feedback && (config.ps.IsFeedbackLoopDepth() || config.alpha_second_pass.ps.IsFeedbackLoopDepth()))
29482948
{
29492949
// Requires a copy of the DS.
29502950
draw_ds_clone = CreateTexture(rtsize.x, rtsize.y, 1, draw_ds->GetFormat(), true);

pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5992,7 +5992,8 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
59925992
pipe.feedback_loop_flags |= m_current_framebuffer_feedback_loop;
59935993
}
59945994

5995-
if (draw_rt && ((config.require_one_barrier && config.ps.IsFeedbackLoopRT()) || (config.tex && config.tex == config.rt)) && !m_features.texture_barrier)
5995+
if (draw_rt && ((config.require_one_barrier && (config.ps.IsFeedbackLoopRT() || config.alpha_second_pass.ps.IsFeedbackLoopRT())) ||
5996+
(config.tex && config.tex == config.rt)) && !m_features.texture_barrier)
59965997
{
59975998
// Requires a copy of the RT.
59985999
draw_rt_clone = static_cast<GSTextureVK*>(CreateTexture(rtsize.x, rtsize.y, 1, draw_rt->GetFormat(), true));

0 commit comments

Comments
 (0)