GPU: handle DXGI Present failures and occlusion #1461
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!1461
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1461/head"
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?
@Luizbc2 on GitHub · 2026-11-24 18:12 UTC · original
Luizbc2:fix/dxgi-present-status→main· +42 −3 · 1 files · 1 commits · closed without mergingWhat changed
Host::presentnow checks DXGI’s HRESULT before recording a frame. An occluded window skips that frame, transient failures are logged once per consecutive status, and a failed Present on a removed device goes through the existing device-removal diagnostic path.Reproduction
On the base revision, inspect
Host::present: the return fromIDXGISwapChain::Presentis discarded and the frame counter is incremented unconditionally. The regression exercises the three return paths withS_OK,DXGI_STATUS_OCCLUDED, andDXGI_ERROR_DEVICE_REMOVED.Verification
cargo test --workspace --lib --locked --offline present_result_distinguishes_occlusion_from_success_and_failurepassed on Windows.git diff --checkpassed.DXGI Present return values
@acetonahard-code on GitHub · 2026-11-24 20:58 UTC · original
Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current
main(ffe310e):cargo test -p victory-gpumainmain+ this PRmain,--all-featuresmain+ this PR,--all-featurescargo clippy --all-targets -- -D warnings, with and without--all-features: clean.cargo fmt --checkwould rewrap 2 blocks this PR adds (host.rs).mainisn't rustfmt-clean either, so take it or leave it.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
@Marvisak on GitHub · 2026-11-25 01:28 UTC · original · edited 2026-11-25 15:52 UTC
Automated triage for the maintainers.
Merge candidate. This now merges cleanly onto current
main.Host::presentincrates/victory-gpu/src/host.rsstopped discarding thePresentHRESULT: an occluded window (DXGI_STATUS_OCCLUDED, a success code) skips the frame meter and returnsNone, a removed device goes through the existingfailpath withremoval_data/last_notes, and other failures are logged once per consecutive status. I checked the mergedpresentand its caller inqueue.rs(aNoneonly affects the diagnostics blink check), and the behaviour matches the linked DXGI documentation. CI: no check runs on this head. A contributor reported in this thread that the build, tests and clippy pass on Windows with this PR merged intomain. This is a recommendation to look, not an approval.Generated by Claude Code
@Marvisak on GitHub · 2026-11-25 22:01 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because, on current
main, skipping the frame meter on an occluded present would break bookkeeping. This was written whenMeter::framewas only the fps counter. It now also advances the frame count that title-memory withholding compares against and runs the frame-end drop of withheld writes, so returning before it while the window is minimised would keep every title-memory list's writes withheld until the window is restored. What remains without the occlusion branch is a warning line and an earlier failure on device removal, whichHost::executealready reports at the next submission.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed