diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/SwapchainInfoVk.h b/src/Cafe/HW/Latte/Renderer/Vulkan/SwapchainInfoVk.h index 004c2e9bc..0c49d3ab2 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/SwapchainInfoVk.h +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/SwapchainInfoVk.h @@ -69,8 +69,8 @@ struct SwapchainInfoVk Vector2i m_desiredExtent{}; uint32 swapchainImageIndex = (uint32)-1; uint64 m_presentId = 1; - uint64 m_queueDepth = 0; //number of frames CPU is ahead of presentation - uint64 m_maxQueued = 0; + uint64 m_queueDepth = 0; // number of frames finished on the CPU, with submitted work and presentation requests + uint64 m_maxQueued = 0; // maximum number of frames that should be "in-flight" at a time // swapchain image ringbuffer (indexed by swapchainImageIndex) diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index c4498fe59..13b7ebb7c 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -2642,7 +2642,7 @@ bool VulkanRenderer::AcquireNextSwapchainImage(bool mainWindow) if(UsePresentWait(chainInfo)) { - if(chainInfo.m_queueDepth >= chainInfo.m_maxQueued) + if(chainInfo.m_queueDepth + 1 >= chainInfo.m_maxQueued) { uint64 waitFrameId = chainInfo.m_presentId - chainInfo.m_queueDepth; vkWaitForPresentKHR(m_logicalDevice, chainInfo.m_swapchain, waitFrameId, 40'000'000);