Skip to content

Commit

Permalink
simplify if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
goeiecool9999 committed Aug 13, 2024
1 parent 31f1df7 commit c641234
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2751,14 +2751,11 @@ void VulkanRenderer::SwapBuffer(bool mainWindow)
// if present_wait is available, use it to limit CPU run-ahead
if (m_featureControl.deviceExtensions.present_wait && chainInfo.m_maxQueued != 0)
{
if (chainInfo.m_maxQueued != 0 && chainInfo.m_numQueued != 0)
if (chainInfo.m_numQueued >= chainInfo.m_maxQueued)
{
if (chainInfo.m_numQueued >= chainInfo.m_maxQueued)
{
uint64 waitFrameId = chainInfo.m_presentId - chainInfo.m_numQueued;
vkWaitForPresentKHR(m_logicalDevice, chainInfo.m_swapchain, waitFrameId, 40'000'000);
chainInfo.m_numQueued--;
}
uint64 waitFrameId = chainInfo.m_presentId - chainInfo.m_numQueued;
vkWaitForPresentKHR(m_logicalDevice, chainInfo.m_swapchain, waitFrameId, 40'000'000);
chainInfo.m_numQueued--;
}

presentId.sType = VK_STRUCTURE_TYPE_PRESENT_ID_KHR;
Expand Down

0 comments on commit c641234

Please sign in to comment.