From cbb9b96537969ff140a3e0508b9f040092934bed Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 24 Mar 2020 00:20:56 +1000 Subject: [PATCH] System: Include buffer swap time in frame time measurement --- src/core/system.cpp | 2 -- src/duckstation-qt/qthostinterface.cpp | 2 ++ src/duckstation-sdl/sdl_host_interface.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index f2318e123..dd2b08862 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -445,8 +445,6 @@ void System::RunFrame() // Generate any pending samples from the SPU before sleeping, this way we reduce the chances of underruns. m_spu->GeneratePendingSamples(); - - UpdatePerformanceCounters(); } void System::SetThrottleFrequency(float frequency) diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index 0fcb791d1..f6b0c3757 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -735,6 +735,8 @@ void QtHostInterface::threadEntryPoint() renderDisplay(); + m_system->UpdatePerformanceCounters(); + if (m_speed_limiter_enabled) m_system->Throttle(); diff --git a/src/duckstation-sdl/sdl_host_interface.cpp b/src/duckstation-sdl/sdl_host_interface.cpp index 8c9745610..03a56359c 100644 --- a/src/duckstation-sdl/sdl_host_interface.cpp +++ b/src/duckstation-sdl/sdl_host_interface.cpp @@ -1438,6 +1438,7 @@ void SDLHostInterface::Run() if (m_system) { m_system->GetGPU()->RestoreGraphicsAPIState(); + m_system->UpdatePerformanceCounters(); if (m_speed_limiter_enabled) m_system->Throttle();