From f4c2d16a3afe1202cf5727092f76ce9a4cb88808 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Mon, 21 Nov 2022 19:06:35 +0100 Subject: [PATCH] Attempt to fix flicker on resize, don't recreate if image was already acquired. (#522) --- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index 401cb168..6f2d5130 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -2540,12 +2540,12 @@ bool VulkanRenderer::AcquireNextSwapchainImage(bool mainWindow) auto& chainInfo = GetChainInfo(mainWindow); - if (!UpdateSwapchainProperties(mainWindow)) - return false; - if (chainInfo.swapchainImageIndex != -1) return true; // image already reserved + if (!UpdateSwapchainProperties(mainWindow)) + return false; + vkResetFences(m_logicalDevice, 1, &chainInfo.m_imageAvailableFence); VkResult result = vkAcquireNextImageKHR(m_logicalDevice, chainInfo.swapchain, std::numeric_limits::max(), VK_NULL_HANDLE, chainInfo.m_imageAvailableFence, &chainInfo.swapchainImageIndex); if (result != VK_SUCCESS)