From f6502b89aa36eeb9997a665289bbca0d4f7e736b Mon Sep 17 00:00:00 2001 From: Ophidon Date: Fri, 2 Feb 2024 09:28:01 -0500 Subject: [PATCH] Don't Sleep to Sync in Non-VRR Normal Running State (#16189) The check for sleeping to sync to a specific speed that is meant for fast forward/vrr could be true for a non-vrr normal core running state causing a possible sleep in a situation it was not intended for, especially at higher hz, and thus interfering with frame pacing. --- runloop.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runloop.c b/runloop.c index cb969d817e5..0a9d1778539 100644 --- a/runloop.c +++ b/runloop.c @@ -7225,7 +7225,13 @@ int runloop_iterate(void) } /* if there's a fast forward limit, inject sleeps to keep from going too fast. */ - if (runloop_st->frame_limit_minimum_time) + if ( (runloop_st->frame_limit_minimum_time) + && ( (vrr_runloop_enable) + || (runloop_st->flags & RUNLOOP_FLAG_FASTMOTION) +#ifdef HAVE_MENU + || (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE && !(settings->bools.video_vsync)) +#endif + || (runloop_st->flags & RUNLOOP_FLAG_PAUSED))) { const retro_time_t end_frame_time = cpu_features_get_time_usec(); const retro_time_t to_sleep_ms = (