From a3c2a4db5f5a4bd9149ebdb8448473115d87f068 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:17:40 +0700 Subject: [PATCH] GSTextureVK: Fix download inside render pass Backport from: https://github.com/stenzek/duckstation/commit/5f8082734e91b27d0c0ad70d8d90e7d3a3a6cc2e --- pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp index 7a01fb673c..db2df37aaf 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp @@ -924,9 +924,16 @@ void GSDownloadTextureVK::Flush() // Need to execute command buffer. if (GSDeviceVK::GetInstance()->GetCurrentFenceCounter() == m_copy_fence_counter) + { + if (GSDeviceVK::GetInstance()->InRenderPass()) + GSDeviceVK::GetInstance()->EndRenderPass(); + GSDeviceVK::GetInstance()->ExecuteCommandBufferForReadback(); + } else + { GSDeviceVK::GetInstance()->WaitForFenceCounter(m_copy_fence_counter); + } } #ifdef PCSX2_DEVBUILD