From 605fef10b412fc5780d14913e80c1f818188bf09 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 3 Jul 2022 01:16:56 +0200 Subject: [PATCH] [dxvk] Fix render target readback barrier Dynamic rendering does not allow barriers within a render pass instance, so we have to actually stop rendering. --- src/dxvk/dxvk_context.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 765eb679a..76f11c38d 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1417,13 +1417,14 @@ namespace dxvk { void DxvkContext::emitRenderTargetReadbackBarrier() { - if (m_flags.test(DxvkContextFlag::GpRenderPassBound)) { - emitMemoryBarrier(VK_DEPENDENCY_BY_REGION_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - VK_ACCESS_SHADER_READ_BIT); - } + if (m_flags.test(DxvkContextFlag::GpRenderPassBound)) + this->spillRenderPass(true); + + emitMemoryBarrier(0, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, + VK_ACCESS_SHADER_READ_BIT); }