From 8e7dcb83a8b1cd5c77e1b4f92bae9ad5e9afb889 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 12 Dec 2025 18:53:56 +0000 Subject: [PATCH] GS/VK: Don't reference old swapchain when recreating on AMD --- pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp b/pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp index 9b9295ed3a..acc9de7b81 100644 --- a/pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp +++ b/pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp @@ -366,7 +366,17 @@ bool VKSwapChain::CreateSwapChain() // Store the old/current swap chain when recreating for resize // Old swap chain is destroyed regardless of whether the create call succeeds - VkSwapchainKHR old_swap_chain = m_swap_chain; + VkSwapchainKHR old_swap_chain; + // RDNA4 experences a 2s delay in the following 2-3 vkAcquireNextImageKHR calls if we pass the old swapchain to the new one. + // Instead, pass null. This requires us to have freed the old image, which we already do with the swapchain maintenance extension. + if (GSDeviceVK::GetInstance()->IsDeviceAMD() && GSDeviceVK::GetInstance()->GetOptionalExtensions().vk_ext_swapchain_maintenance1) + { + vkDestroySwapchainKHR(GSDeviceVK::GetInstance()->GetDevice(), m_swap_chain, nullptr); + old_swap_chain = VK_NULL_HANDLE; + } + else + old_swap_chain = m_swap_chain; + m_swap_chain = VK_NULL_HANDLE; // Now we can actually create the swap chain