ImGuiOverlays: Display vsync queue size in OSD

This commit is contained in:
Stenzek 2024-05-23 23:41:12 +10:00 committed by Connor McLaughlin
parent 256babd337
commit 82fbf34f5b
3 changed files with 10 additions and 2 deletions

View File

@ -190,8 +190,10 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
if (GSConfig.OsdShowCPU) if (GSConfig.OsdShowCPU)
{ {
text.clear(); text.clear();
text.append_format("{:.2f}ms | {:.2f}ms | {:.2f}ms", PerformanceMetrics::GetMinimumFrameTime(), text.append_format("{} QF | {:.2f}ms | {:.2f}ms | {:.2f}ms",
PerformanceMetrics::GetAverageFrameTime(), PerformanceMetrics::GetMaximumFrameTime()); MTGS::GetCurrentVsyncQueueSize() - 1, // we subtract one for the current frame
PerformanceMetrics::GetMinimumFrameTime(), PerformanceMetrics::GetAverageFrameTime(),
PerformanceMetrics::GetMaximumFrameTime());
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255)); DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));
text.clear(); text.clear();

View File

@ -213,6 +213,11 @@ void MTGS::ResetGS(bool hardware_reset)
SetEvent(); SetEvent();
} }
int MTGS::GetCurrentVsyncQueueSize()
{
return s_QueuedFrameCount.load(std::memory_order_acquire);
}
struct RingCmdPacket_Vsync struct RingCmdPacket_Vsync
{ {
u8 regset1[0x0f0]; u8 regset1[0x0f0];

View File

@ -62,6 +62,7 @@ namespace MTGS
void WaitForClose(); void WaitForClose();
void Freeze(FreezeAction mode, FreezeData& data); void Freeze(FreezeAction mode, FreezeData& data);
int GetCurrentVsyncQueueSize();
void PostVsyncStart(bool registers_written); void PostVsyncStart(bool registers_written);
void InitAndReadFIFO(u8* mem, u32 qwc); void InitAndReadFIFO(u8* mem, u32 qwc);