GPU: hold a present with no flip wait since the last one to its flip tick (intro movie judder) #457
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!457
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-457"
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?
@GamingRipperDoc on GitHub · 2026-11-25 01:05 UTC · original
GamingRipperDoc:flip-pacing→main· +46 −1 · 2 files · 1 commits · openThe intro movie judders through its first seconds. Root cause: the title's catch-up presents are shown at once instead of on their flip tick.
What happens
The title polls the frame origin with "token on time-out" and normally waits for the flip before each present (
frame.rs's own notes). While the movie player is behind, right after playback starts, it begins a frame early and presents it without the flip wait. The console flips such a frame on the next flip tick, so the cadence stays even. VIctory hands every present to the host at once (Present(0, …)), so that frame stayed on screen ~5 ms and the frames around it twice as long.Measured on the intro movie with per-present logging and a local check of the movie's texture buffers (the 8 MB luma + 2 × 2 MB chroma, three sets in rotation), over the same ~15 s:
Every extra present came right after an origin poll that timed out (
frame wait kind=0 timeout_ms=0 flags=2 hr=1) with nokind=2wait before it; the next present then had no new movie frame. Background shader translation was ruled out (none during those seconds), and the texture checks are exact (hash at submission).Change
frame::before_present(), called right before the hostPresent: if no flip wait has ended since the last present, it sleeps to the next flip tick and takes it (last(FLIP)), so each present still gets one tick and the next frame's flip wait lands after it. Presents after a flip wait, which is every frame in normal play, including slow world frames with this tree's early-ending waits, are not delayed. Two files, +47/−1.A test extends
waits_end_on_ticks_and_count_frames(the clock is global, so it stays in that test): a present after a flip wait takes no tick; a second present with no flip wait takes the next tick; the following flip wait lands after it. It failed before the change.Tested
Windows 10 22H2, AMD RX 9070 XT, Ryzen 9 9900X:
cargo test -p victory-gpu: 112 passed.cargo clippy --workspace --all-targets --locked [--all-features] -- -D warnings: clean.rustfmt --checkonframe.rs: clean.ffe310e+ #420's Agility runtime + Marvisak/VIctory#431, Marvisak/VIctory#568 and Marvisak/VIctory#67), whereframe.rsmatches this tree's except for the early-ending waits; the patch applied there unchanged.No game data used.
AI-assisted (Claude Code); I watched both runs and the logs were read with the model.
af08b20bafto2fd1402328View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.