Skip to content

Commit

Permalink
fix race condition where no present would happen after config change
Browse files Browse the repository at this point in the history
this meant the swapchain never updates which stops presents
  • Loading branch information
goeiecool9999 committed Nov 1, 2023
1 parent 2da91ee commit ca22fea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2816,19 +2816,20 @@ void VulkanRenderer::SwapBuffers(bool swapTV, bool swapDRC)
{
SubmitCommandBuffer();

VSync sync = static_cast<VSync>(GetConfig().vsync.GetValue());
if (swapTV && IsSwapchainInfoValid(true))
{
auto& chain = GetChainInfo(true);
chain.SwapBuffers();
if (chain.m_vsyncState != VSync::SYNC_AND_LIMIT)
if (sync != VSync::SYNC_AND_LIMIT)
PresentFrontBuffer(true);
}

if (swapDRC && IsSwapchainInfoValid(false))
{
auto& chain = GetChainInfo(false);
chain.SwapBuffers();
if (chain.m_vsyncState != VSync::SYNC_AND_LIMIT)
if (sync != VSync::SYNC_AND_LIMIT)
PresentFrontBuffer(false);
}

Expand Down

0 comments on commit ca22fea

Please sign in to comment.