| 972 | } |
| 973 | |
| 974 | void EmuThread::updatePerformanceMetrics(bool force) |
| 975 | { |
| 976 | if (!g_main_window) |
| 977 | return; |
| 978 | |
| 979 | const s32 slot = SaveStateSelectorUI::GetCurrentSlot(); |
| 980 | u32 volume = 0; |
| 981 | bool muted = false; |
| 982 | |
| 983 | if (VMManager::HasValidVM()) |
| 984 | { |
| 985 | volume = SPU2::GetOutputVolume(); |
| 986 | muted = SPU2::IsOutputMuted(); |
| 987 | |
| 988 | QString gs_stat; |
| 989 | if (m_verbose_status) |
| 990 | { |
| 991 | std::string gs_stat_str; |
| 992 | GSgetTitleStats(gs_stat_str); |
| 993 | |
| 994 | if (THREAD_VU1) |
| 995 | { |
| 996 | gs_stat = tr("Slot: %1 | %2 | EE: %3% | VU: %4% | GS: %5%") |
| 997 | .arg(slot) |
| 998 | .arg(gs_stat_str.c_str()) |
| 999 | .arg(PerformanceMetrics::GetCPUThreadUsage(), 0, 'f', 0) |
| 1000 | .arg(PerformanceMetrics::GetVUThreadUsage(), 0, 'f', 0) |
| 1001 | .arg(PerformanceMetrics::GetGSThreadUsage(), 0, 'f', 0); |
| 1002 | } |
| 1003 | else |
| 1004 | { |
| 1005 | gs_stat = tr("Slot: %1 | %2 | EE: %3% | GS: %4%") |
| 1006 | .arg(slot) |
| 1007 | .arg(gs_stat_str.c_str()) |
| 1008 | .arg(PerformanceMetrics::GetCPUThreadUsage(), 0, 'f', 0) |
| 1009 | .arg(PerformanceMetrics::GetGSThreadUsage(), 0, 'f', 0); |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | QMetaObject::invokeMethod(g_main_window, "setStatusVerboseText", Qt::QueuedConnection, Q_ARG(const QString&, gs_stat)); |
| 1014 | } |
| 1015 | |
| 1016 | const GSRendererType renderer = GSGetCurrentRenderer(); // Reading from GS thread, therefore racey, but it's just visual. |
| 1017 | const float upscale = EmuConfig.GS.UpscaleMultiplier; |
| 1018 | const float speed = std::round(PerformanceMetrics::GetSpeed()); |
| 1019 | const LimiterModeType limiter_mode = VMManager::GetLimiterMode(); |
| 1020 | const float gpu_usage = std::round(PerformanceMetrics::GetGPUUsage()); |
| 1021 | const float gfps = std::round(PerformanceMetrics::GetInternalFPS()); |
| 1022 | const float vfps = std::round(PerformanceMetrics::GetFPS()); |
| 1023 | int iwidth, iheight; |
| 1024 | GSgetInternalResolution(&iwidth, &iheight); |
| 1025 | |
| 1026 | if (iwidth != m_last_internal_width || iheight != m_last_internal_height || upscale != m_last_upscale || |
| 1027 | speed != m_last_speed || gpu_usage != m_last_gpu_usage || gfps != m_last_game_fps || vfps != m_last_video_fps || renderer != m_last_renderer || |
| 1028 | volume != m_last_volume || muted != m_last_muted || force) |
| 1029 | { |
| 1030 | |
| 1031 | if (volume != m_last_volume || muted != m_last_muted || force) |
no test coverage detected