GPU: wait for queued presentation before resizing the swap chain #3084
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!3084
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3084"
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?
@passerbyyhx on GitHub · 2026-11-26 07:02 UTC · original
passerbyyhx:fix/warp-debug-compositor-fallback→main· +9 −1 · 1 files · 1 commits · openThe existing compositor fallback test can exit with code 2173 when the D3D12 debug layer is enabled. After the primary-only fallback presents a 32×32 frame, the two-plane retry needs a 64×64 swap chain. The copy-list fence has already completed at that point, but
Presentqueued work after it. The debug layer reports #921 when DXGI releases an old back buffer inResizeBuffers.This signals the presentation queue and waits for the fence immediately before resizing. It uses the existing submission lock to assign the fence value. A failed signal or wait goes through the existing resize retry. Frames of unchanged size and format take the existing path.
On WARP with the debug layer, the original test exited 2173 on
63bcca43and passed on the patch in each of three alternating runs. The same test passed on the RTX 4090 Laptop with the debug layer. Both devices produced the expected primary fallback (32×32, RGBA 255/0/0/255) and subsequent composite (64×64, RGBA 127/0/128/255). The full WARP diagnostics library suite passed with the debug layer enabled (246 passed, 1 ignored). Strict workspace Clippy passed with default and all features, and the asset check passed. Debug message #1419 appeared on both revisions. The patched run completed without #921.Coordination claim · Earlier report on clean main
@Marvisak on GitHub · 2026-11-26 08:21 UTC · original
Automated triage for the maintainers.
Merge candidate. In
Host::present_with_compositor(victory-gpu/src/host.rs), the resize path now signals the queue and waits on the host fence beforeResizeBuffers. Inorigin/mainthe copy list is waited for inexecute, butPresentqueues work after that, so the old back buffers could still be in use when DXGI releases them. D3D12 requires the queue to be idle beforeResizeBuffers, so the wait is correct. It takessubmittedthe same wayHost::executedoes, with the same lock order (presenter, then submitted), andSetEventOnCompletionwith a null event blocks until the value is reached. Frames that keep their size are unchanged.CI: passing (check).
Generated by Claude Code
@Dukestar69 on GitHub · 2026-11-26 07:08 UTC · original · approved these changes
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):cargo test -p victory-gpu host::tests -- --test-threads=1 --skip dynamic_slots_are_held_until_released: 30 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 08:39 UTC · original · approved these changes
Reproduced the Debug Layer failure on
origin/main(63bcca43) and verified the fix on76ee198don Windows 11 (RTX 5090 + WARP):origin/mainwithVICTORY_D3D12_DEBUG=1:host::present_plane_tests::compositor_failure_presents_primary_in_the_same_frameexited2173on 3/3 WARP runs and 1/1 RTX 5090 run.#3084(76ee198d) withVICTORY_D3D12_DEBUG=1: passed 3/3 on WARP and 3/3 on RTX 5090.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean;host::tests+present_plane_testspassed on RTX 5090 (30/30, skipping the pre-existing NVIDIAdynamic_slots_are_held_until_releasedcap failure) and WARP (32/32);cargo xtask policy: 191 files ok.Lock ordering and error handling look sound:
present_with_compositoralready acquiresself.presenterthenself.submitted(viaself.execute), and no code path acquiresself.presenterunderself.submitted, so there is no lock-order inversion.HANDLE::default()underself.submittedavoids touchingself.eventand releases the lock beforeResizeBuffers, while anySignal/SetEventOnCompletionerror routes through the existingretry.attemptpath.LGTM.
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.