From 5f8082734e91b27d0c0ad70d8d90e7d3a3a6cc2e Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 11 Aug 2024 20:44:16 +1000 Subject: [PATCH] VulkanDevice: Fix download inside render pass --- src/util/vulkan_texture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/vulkan_texture.cpp b/src/util/vulkan_texture.cpp index 77a6e48c5..42eaf9b56 100644 --- a/src/util/vulkan_texture.cpp +++ b/src/util/vulkan_texture.cpp @@ -1158,9 +1158,15 @@ void VulkanDownloadTexture::Flush() // Need to execute command buffer. if (dev.GetCurrentFenceCounter() == m_copy_fence_counter) + { + if (dev.InRenderPass()) + dev.EndRenderPass(); dev.SubmitCommandBuffer(true); + } else + { dev.WaitForFenceCounter(m_copy_fence_counter); + } } void VulkanDownloadTexture::SetDebugName(std::string_view name)