From 7ad759007afe638594d9d4ed5cfc315bdab1725b Mon Sep 17 00:00:00 2001 From: JordanTheToaster Date: Tue, 15 Jul 2025 11:47:06 +0100 Subject: [PATCH] ImGuiOverlays: Internal FPS stat regression fix --- pcsx2-qt/QtHost.cpp | 8 +++++++- pcsx2/ImGui/ImGuiOverlays.cpp | 8 +++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index 5e0581412a..7a305334d1 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -1054,8 +1054,14 @@ void EmuThread::updatePerformanceMetrics(bool force) if (gfps != m_last_game_fps || force) { + QString text; + if (gfps == 0) + text = tr("FPS: N/A"); + else + text = tr("FPS: %1").arg(gfps, 0, 'f', 0); + QMetaObject::invokeMethod(g_main_window->getStatusFPSWidget(), "setText", Qt::QueuedConnection, - Q_ARG(const QString&, tr("FPS: %1").arg(gfps, 0, 'f', 0))); + Q_ARG(const QString&, text)); m_last_game_fps = gfps; } diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index 381647a3cb..1dad022dbf 100644 --- a/pcsx2/ImGui/ImGuiOverlays.cpp +++ b/pcsx2/ImGui/ImGuiOverlays.cpp @@ -221,18 +221,16 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f switch (PerformanceMetrics::GetInternalFPSMethod()) { case PerformanceMetrics::InternalFPSMethod::GSPrivilegedRegister: - text.append_format("FPS: {:.2f} [P]", PerformanceMetrics::GetInternalFPS(), - PerformanceMetrics::GetFPS()); + text.append_format("FPS: {:.2f} [P]", PerformanceMetrics::GetInternalFPS()); break; case PerformanceMetrics::InternalFPSMethod::DISPFBBlit: - text.append_format("FPS: {:.2f} [B]", PerformanceMetrics::GetInternalFPS(), - PerformanceMetrics::GetFPS()); + text.append_format("FPS: {:.2f} [B]", PerformanceMetrics::GetInternalFPS()); break; case PerformanceMetrics::InternalFPSMethod::None: default: - text.append_format("FPS: {:.2f}", PerformanceMetrics::GetFPS()); + text.append("FPS: N/A"); break; } first = false;