GS/Vulkan: Fix condition for skipping first barrier

Use the image layout instead of start-of-render-pass, because the image
may already be in general, or it could be restarting the RP from a
render area change.
This commit is contained in:
Connor McLaughlin 2022-10-19 18:00:35 +10:00 committed by refractionpcsx2
parent a30a41c2cc
commit 1d58f59190
1 changed files with 4 additions and 5 deletions

View File

@ -3024,6 +3024,10 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
CurrentFramebufferHasFeedbackLoop();
}
// We don't need the very first barrier if this is the first draw after switching to feedback loop,
// because the layout change in itself enforces the execution dependency.
const bool skip_first_barrier = (draw_rt && draw_rt->GetLayout() != VK_IMAGE_LAYOUT_GENERAL);
OMSetRenderTargets(draw_rt, draw_ds, config.scissor, pipe.feedback_loop);
if (pipe.feedback_loop)
{
@ -3032,7 +3036,6 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
}
// Begin render pass if new target or out of the area.
bool skip_first_barrier = false;
if (!render_area_okay || !InRenderPass())
{
const VkAttachmentLoadOp rt_op = GetLoadOpForTexture(draw_rt);
@ -3060,10 +3063,6 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
{
BeginRenderPass(rp, render_area);
}
// We don't need the very first barrier if this is the first draw in the render pass, because we have
// pipeline barriers inbetween them anyway.
skip_first_barrier = true;
}
// rt -> hdr blit if enabled