PerfMon: Fix statistics for games with idle frames

This commit is contained in:
refractionpcsx2 2023-12-23 15:35:27 +00:00
parent 18fea6440e
commit 3edd508fc8
3 changed files with 8 additions and 4 deletions

View File

@ -30,10 +30,12 @@ void GSPerfMon::Reset()
std::memset(m_stats, 0, sizeof(m_stats));
}
void GSPerfMon::EndFrame()
void GSPerfMon::EndFrame(bool frame_only)
{
m_frame++;
m_count++;
if(!frame_only)
m_count++;
}
void GSPerfMon::Update()

View File

@ -52,7 +52,7 @@ public:
void SetFrame(u64 frame) { m_frame = frame; }
u64 GetFrame() { return m_frame; }
void EndFrame();
void EndFrame(bool frame_only);
void Put(counter_t c, double val) { m_counters[c] += val; }
double GetCounter(counter_t c) { return m_counters[c]; }

View File

@ -602,7 +602,9 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame)
if (!idle_frame)
g_gs_device->AgePool();
g_perfmon.EndFrame();
g_perfmon.EndFrame(idle_frame);
if ((g_perfmon.GetFrame() & 0x1f) == 0)
g_perfmon.Update();