Skip to content

Commit

Permalink
Let SwapBuffers drive present in VRR optimized mode
Browse files Browse the repository at this point in the history
  • Loading branch information
goeiecool9999 committed Oct 30, 2023
1 parent b93854c commit 8a44172
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Cafe/HW/Latte/Core/LatteTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ void LatteTiming_HandleTimedVsync()
g_renderer->PresentFrontBuffers();
if( currentTimer >= LatteGPUState.timer_nextVSync )
{
if(!LatteTiming_IsUsingHostDrivenVSync())
{
g_renderer->PresentFrontBuffers();
}
if(!LatteTiming_IsUsingHostDrivenVSync() || !s_hostPaceWithinRange)
{
LatteTiming_signalVsync();
Expand Down
14 changes: 12 additions & 2 deletions src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2814,10 +2814,20 @@ void VulkanRenderer::SwapBuffers(bool swapTV, bool swapDRC)
SubmitCommandBuffer();

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

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

if(swapTV)
VulkanBenchmarkPrintResults();
Expand Down

0 comments on commit 8a44172

Please sign in to comment.