GPU: the title's submissions return before the host GPU has run them #3120
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3120
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3120"
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?
@0xkn0wh3r3 on GitHub · 2026-11-26 08:51 UTC · original
0xkn0wh3r3:gpu/submission-overlap→main· +911 −141 · 8 files · 3 commits · openExecuteCommandLists no longer waits for the host GPU. The title's lists go to the host queue with a Signal of the host fence, and the call returns. The submission completes later: what shaders wrote goes back to title memory, then the lists' work after them and their bottom-of-pipe writes, then the title fences its queue signalled behind it. A completion thread completes each submission once the GPU has run it, so a title's fence moves, and its waits end, without any call from the title, as on the console. A title that keeps frames in flight now gets them: it records the next frame while the GPU runs the last.
This is phase 2 of
docs/submission-overlap.md(on thedemobranch), widened to more than one submission in flight wherever nothing needs the earlier ones done first.What still waits
A submission completes the ones it needs before it is prepared. The wait is for the host fence, with the submission lock released, so the completion thread and other submitting threads go on.
So only submissions without such writes overlap for now. Snapshots and bitmaps per submission (the plan's phase 3) would lift that. Read marks are taken by any completion that bound them; taken early, they only make views early.
Other changes
VICTORY_GPU_OVERLAP=0waits for each submission as before. Per-list timing (VICTORY_GPU_TIMING) and capture-listed frames wait too.Measured
cargo demo(the conformance title's window, 2560x1440), RTX 5070 Ti, Windows 11, on the user'sdemobranch with this merged. The comparison is the same build withVICTORY_GPU_OVERLAP=0, steady 5 s windows:With overlap off, each scale-4 submission spent 5.9 ms waiting for the GPU. Before the swap chain went to three buffers, the overlapped build ran at about 31 fps: ExecuteCommandLists took 0.9 ms a frame, and the wait had moved into "waiting for a frame in flight" (13–16 ms) and present.
Tests
cargo test -p victory-gpu --lib, in parallel and single-threaded: everything passes exceptdynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, which fail the same way onmainhere (the host's view heap is smaller thanHEAP_VIEWS).frame::tests::waits_end_on_ticks_and_count_framesis timing-flaky onmaintoo.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--features victory-gpu/diagnostics.View 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.