From 8d6633fcf9a36a72d4397b51fdf9ca0aeb5d8297 Mon Sep 17 00:00:00 2001 From: Chromaryu Date: Wed, 9 Oct 2024 21:25:30 +0900 Subject: [PATCH] OSD: Update OSD Text on SW mode so no overlap keyword appears (#11881) --- pcsx2/GS/GS.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index fb4d8a745f45e..37b441cc854c0 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -644,14 +644,37 @@ void GSgetStats(SmallStringBase& info) { const double fps = GetVerticalFrequency(); const double fillrate = pm.Get(GSPerfMon::Fillrate); - info.format("{} SW | {} S | {} P | {} D | {:.2f} U | {:.2f} D | {:.2f} mpps", + double pps = fps * fillrate; + char prefix = '\0'; + + if (pps >= 170000000) + { + pps /= 1073741824; // Gpps + prefix = 'G'; + } + else if (pps >= 35000000) + { + pps /= 1048576; // Mpps + prefix = 'M'; + } + else if (pps >= 1024) + { + pps /= 1024; + prefix = 'K'; + } + else + { + prefix = '\0'; + } + + info.format("{} SW | {} SP | {} P | {} D | {:.2f} S | {:.2f} U | {:.2f} {}pps", api_name, (int)pm.Get(GSPerfMon::SyncPoint), (int)pm.Get(GSPerfMon::Prim), (int)pm.Get(GSPerfMon::Draw), pm.Get(GSPerfMon::Swizzle) / 1024, pm.Get(GSPerfMon::Unswizzle) / 1024, - fps * fillrate / (1024 * 1024)); + pps,prefix); } else if (GSCurrentRenderer == GSRendererType::Null) {