GPU: handle DXGI Present failures and occlusion #1460
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1461"
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?
Imported from Marvisak/VIctory. Originally posted by Luizbc2 on 2026-11-24T18:12:48Z.
What 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
Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T20:58:48Z.
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.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T21:21:33Z.
Review: APPROVED
Tested
f9822deon Windows 11, RTX 5070, MSVC: builds,cargo test --workspace --no-fail-fast638 passed, 0 failed (on our fork main).present_result_distinguishes_occlusion_from_success_and_failurepasses.PresentHRESULT is right.DXGI_STATUS_OCCLUDEDis a success code, sook()alone would count an occluded frame as shown, and the explicit comparison handles that.Presenton a removed device now reaches the existing removal report instead of being silently discarded.return Nonepaths skip only the frame meter. The one caller (queue.rs,PresentX) uses the return value only for the diagnostics black-frame log, so the title's present path is unchanged and can't stall on an occluded or minimized window.DXGI_PRESENT_TESTinstead of presenting. CallingPresent(0)every frame is harmless, but it's an option if occlusion costs time.Merged into our fork's main.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:28:48Z.
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
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:01:22Z.
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