VideoInterface: Throttle for VBlank only when necessary.

This commit is contained in:
Jordan Woyak 2025-03-28 21:44:50 -05:00
parent c42dab6388
commit af1f07207f

View File

@ -853,10 +853,14 @@ void VideoInterfaceManager::EndField(FieldType field, u64 ticks)
if (!Config::Get(Config::GFX_HACK_EARLY_XFB_OUTPUT))
OutputField(field, ticks);
// Note: We really only need to Throttle prior to to presentation,
// but it is needed here if we want accurate "VBlank" statistics,
// when using GPU-on-Thread or Early/Immediate XFB.
m_system.GetCoreTiming().Throttle(ticks);
// Note: OutputField above doesn't present when using GPU-on-Thread or Early/Immediate XFB,
// giving "VBlank" measurements here poor pacing without a Throttle call.
// If the user actually wants the data, we'll Throttle to make the numbers nice.
const bool is_vblank_data_wanted = g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes ||
g_ActiveConfig.bLogRenderTimeToFile ||
g_ActiveConfig.bShowGraphs;
if (is_vblank_data_wanted)
m_system.GetCoreTiming().Throttle(ticks);
g_perf_metrics.CountVBlank();
VIEndFieldEvent::Trigger();