From 93352da1d08ce91eac25613b668219dea1aeb6fe Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Tue, 13 Oct 2026 18:21:01 -0400 Subject: [PATCH] fix: pace gamescope's fixed-refresh frame limiter per window by time (#753) --- tools/gamescope/PATCHES.md | 7 +++++ .../0115-limiter-paces-per-window.patch | 27 +++++++++++++++++++ tools/gamescope/release.env | 4 +-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 tools/gamescope/patches/0115-limiter-paces-per-window.patch diff --git a/tools/gamescope/PATCHES.md b/tools/gamescope/PATCHES.md index acb345515..3a36c3ae0 100644 --- a/tools/gamescope/PATCHES.md +++ b/tools/gamescope/PATCHES.md @@ -44,6 +44,13 @@ library list, before anything is published. read the window's attributes first, it kept the window as override-redirect and left it out of `GAMESCOPE_FOCUSABLE_WINDOWS`, so the client kept its loading screen over the running game (Skyrim SE, A Plague Tale: Innocence, on the games' own Xwayland). MapNotify now refreshes the flag. +- `0115-limiter-paces-per-window.patch` - this app: on a fixed-refresh output the frame limiter + (Steam's Frame Limit) let a capped window's frames out only on every Nth refresh of a global grid, + so a frame finished just after its slot waited a whole extra slot. At 30 on 60 Hz one picture was + held for three or four refreshes - "small stops and ladders" with frame generation - where a game's + own limiter slips such a frame by one refresh. The fixed-refresh branch now paces each window by + time, as the VRR branch already did: its next frame goes out on the first refresh a capped interval + after its last one, with half a refresh of tolerance so an on-time window keeps every Nth refresh. Sixteen more of Armada's patches are DRM/lease/HDR-on-KMS work for a native display, which this app's Wayland-hosted gamescope never reaches, or need a newer gamescope than the runtime has. diff --git a/tools/gamescope/patches/0115-limiter-paces-per-window.patch b/tools/gamescope/patches/0115-limiter-paces-per-window.patch new file mode 100644 index 000000000..7ead84e35 --- /dev/null +++ b/tools/gamescope/patches/0115-limiter-paces-per-window.patch @@ -0,0 +1,27 @@ +diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp +index 5b0e300..b9b07ca 100644 +--- a/src/steamcompmgr.cpp ++++ b/src/steamcompmgr.cpp +@@ -6875,10 +6875,19 @@ static bool steamcompmgr_should_vblank_window( bool bShouldLimitFPS, uint64_t vb + { + if ( g_nSteamCompMgrTargetFPS && bShouldLimitFPS && nRefreshHz > nTargetFPS ) + { +- int nVblankDivisor = nRefreshHz / nTargetFPS; ++ if ( w && now ) ++ { ++ uint64_t schedule = w->last_commit_first_latch_time + g_SteamCompMgrLimitedAppRefreshCycle; ++ if ( now + g_SteamCompMgrAppRefreshCycle / 2 < schedule ) ++ bSendCallback = false; ++ } ++ else ++ { ++ int nVblankDivisor = nRefreshHz / nTargetFPS; + +- if ( vblank_idx % nVblankDivisor != 0 ) +- bSendCallback = false; ++ if ( vblank_idx % nVblankDivisor != 0 ) ++ bSendCallback = false; ++ } + } + } + diff --git a/tools/gamescope/release.env b/tools/gamescope/release.env index 9f895d08d..631c6b47d 100644 --- a/tools/gamescope/release.env +++ b/tools/gamescope/release.env @@ -1,3 +1,3 @@ GAMESCOPE_REPO=Droid-Deck/DroidDeck-Components -GAMESCOPE_TAG=gamescope-3.16.29-p9 -GAMESCOPE_SHA256=7123a37bdbcd0d76d4bd1d7490e5d2017221e036395fdd48c1e92458594ca769 +GAMESCOPE_TAG=gamescope-3.16.29-p10 +GAMESCOPE_SHA256=e8e2433ae618458135ec271a30af7e80b282ff41f9931286e9bbad614838eca0