mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #671] [MERGED] OLD-9189: restore old upstream PR 9189 - FramePacer: at most latency frames in flight while armed (mailbox replace) #712
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#712
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/671
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:frame-pacer-bounded-queue📝 Commits (3)
b464a2cFramePacer: at mostlatencyframes in flight while armed (mailbox replace)d5304a8Merge upstream main into frame-pacer-bounded-queue (after #891, BL-6)6f9ee9aFramePacer: BL-6 statistics count a frame the bounded queue replaces📊 Changes
4 files changed (+188 additions, -16 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+12 -4)📝
runtime/src/frame_pacer.h(+30 -10)📝
runtime/test/frame_pacer_test.cpp(+143 -0)📝
runtime/test/xbox_present_test.cpp(+3 -2)📄 Description
Claimed in the coordination issue as: OLD-9189 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129812657
Restoration of my original pull request, old upstream PR 9189 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c; the commit applied without changes. The only edit is in the commit message, where an old issue number is now plain text. The uncap mode added tomainsince then (LEONIDA_PRESENT_UNCAP) is untouched: an uncapped present still returns before it reaches the queue.What and why
main,commit_present_tokenandnote_untokened_presentadd one queued frame for every present, each one period after the last.WaitFrameEventXbetween them grow the queue without limit, and the next wait blocks until the first of them is shown.runtime/src/frame_pacer.h): at mostlatencyframes are in flight while the event is armed.SetFrameIntervalXsets a latency below the number of frames already queued, the next present cuts the queue back to the new latency from the newest end.frame_pacer_testnow covers:xbox_present_test: it expected a blank present after a frame at latency 1 to leave 2 frames in flight. That is now 1.docs/d3d12_vulkan.md: documents the limit.Tested
Linux, with gcc for the native build and clang 23 targeting mingw x64, run under Wine 11.22. MSVC is left to CI.
frame_pacer_test(gcc, Linux)frame_pacer_test(clang mingw, Wine)xbox_present_test(clang mingw, Wine)mainmainwith only this PR's test changesxbox_present_teston this branch passed 26 cases on both GPUs. The HDR10 swapchain case was skipped because the display lists no ST.2084 format.xbox_present.his the only other file that includesframe_pacer.h.d3d12_boot_movie_testalso uses it, but it needs the retail package, so I didn't run it.git diff --checkandpython -I scripts/check_no_game_data.pyon the changed files: clean.frame_pacer.hor the present path: #402, #414, #526, #551, #553.GPUs tested: AMD Radeon RX 7900 XTX (RADV NAVI31) and AMD Ryzen 9 7950X3D integrated GPU (RADV RAPHAEL_MENDOCINO), both Mesa 26.3.1, Arch Linux, through Wine 11.22 (
xbox_present_testonly;frame_pacer_testneeds no GPU)AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.