diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index 4c79689365..aa785b1b2a 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -285,6 +285,7 @@ static bool DoGSOpen(GSRendererType renderer, u8* basemem) GSConfig.OsdShowGPU = EmuConfig.GS.OsdShowGPU && display->SetGPUTimingEnabled(true); g_gs_renderer->SetRegsMem(basemem); + g_perfmon.Reset(); return true; } diff --git a/pcsx2/GS/GSPerfMon.cpp b/pcsx2/GS/GSPerfMon.cpp index 276d92904d..13c17260d9 100644 --- a/pcsx2/GS/GSPerfMon.cpp +++ b/pcsx2/GS/GSPerfMon.cpp @@ -19,13 +19,15 @@ GSPerfMon g_perfmon; -GSPerfMon::GSPerfMon() - : m_frame(0) - , m_lastframe(0) - , m_count(0) +GSPerfMon::GSPerfMon() = default; + +void GSPerfMon::Reset() { - memset(m_counters, 0, sizeof(m_counters)); - memset(m_stats, 0, sizeof(m_stats)); + m_frame = 0; + m_lastframe = 0; + m_count = 0; + std::memset(m_counters, 0, sizeof(m_counters)); + std::memset(m_stats, 0, sizeof(m_stats)); } void GSPerfMon::EndFrame() diff --git a/pcsx2/GS/GSPerfMon.h b/pcsx2/GS/GSPerfMon.h index 5091de8211..0dbfd6e838 100644 --- a/pcsx2/GS/GSPerfMon.h +++ b/pcsx2/GS/GSPerfMon.h @@ -38,16 +38,18 @@ public: }; protected: - double m_counters[CounterLast]; - double m_stats[CounterLast]; - u64 m_frame; - clock_t m_lastframe; - int m_count; - int m_disp_fb_sprite_blits; + double m_counters[CounterLast] = {}; + double m_stats[CounterLast] = {}; + u64 m_frame = 0; + clock_t m_lastframe = 0; + int m_count = 0; + int m_disp_fb_sprite_blits = 0; public: GSPerfMon(); + void Reset(); + void SetFrame(u64 frame) { m_frame = frame; } u64 GetFrame() { return m_frame; } void EndFrame();