Skip to content

Commit

Permalink
Actually fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
goeiecool9999 committed Aug 14, 2024
1 parent be1dedd commit 32c57f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Cafe/HW/Latte/Renderer/Vulkan/SwapchainInfoVk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 32c57f6

Please sign in to comment.