From 6fa3b72f8bd75b44da7a504f703709358f0b0a4a Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 12 Mar 2025 23:50:59 +0100 Subject: [PATCH] Prevent frequent framerate changes --- server/driver/wivrn_session.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/driver/wivrn_session.cpp b/server/driver/wivrn_session.cpp index a7101054..f36eee94 100644 --- a/server/driver/wivrn_session.cpp +++ b/server/driver/wivrn_session.cpp @@ -563,13 +563,12 @@ struct refresh_rate_adjuster // Maximum refresh rate the application can reach auto app_rate = float(U_TIME_1S_IN_NS) / pacers.get_frame_time(); - app_rate *= 0.95; // add some margin // Get the highest rate reachable by the application // If none can be reached, set it to the maximum auto requested = info.available_refresh_rates.back(); for (auto rate: info.available_refresh_rates) { - if (rate < app_rate) + if (rate < app_rate * (rate == last ? 1. : 0.9)) requested = rate; } if (requested != last)