GPU: count accepted presents while keeping title frames advancing #2933
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2935"
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 UwUCammie on 2026-11-26T00:48:41Z.
An occluded window can report a positive FPS even while DXGI returns
DXGI_STATUS_OCCLUDEDfor everyPresent. As discussed in #1461, the title still needs its end-of-frame work in that case. In particular,memory::log_frameadvances the frame used to withhold writes and retakes the dropped ranges.Main already runs the end-of-frame work and diagnostics hook on every returned
Present, and this keeps that behavior. The change makes the FPS numerator count onlyS_OK. Draw counts and milliseconds per title frame keep their original denominator. An unaccepted present also leaves the diagnostics caller without a displayed-frame result.Tested under Wine 11.22. The new regression feeds an occlusion, a failure and a success. It checks three completed title frames and one accepted present. The existing memory-withholding test passed, as did the compositor fallback and pixel test on an RX 7900 XT with RADV 26.3.1.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T00:53:24Z.
The split is right on both axes:
PresentreturningDXGI_STATUS_OCCLUDED/E_FAILstill has to end the title frame —memory::log_frameadvancing withheld writes andwatch::frame_doneare end-of-frame work, not display work — while the reported FPS should only count presents DXGI actually accepted. The test pins exactly that distinction (three attempts →frames=3,presented=1,report_frames=3, pluscompleted_title_framesadvancing ≥3 for every attempt). Verified.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:02:51Z.
Code review and RTX 5090 + WARP verification at head
720969ad8795merged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/host.rs:3031-3176, 3504-3509,memory.rs:356-359):end_frame(status)advancesself.frames,self.report_frames,memory::log_frame()(FRAMES+retake_dropped()), andwatch::frame_done()on everyPresentattempt (includingDXGI_STATUS_OCCLUDED), while incrementingself.presentedand returningshown = trueonly onS_OK— keepingHost::presentreturningNonewhen occluded soqueue::blinksdoes not report false black frames.Meteris guarded byHost::presenter: Mutex<Presentation>,memory::FRAMESisAtomicU64,self.frames >= 1holds wheneverreportruns, and displayed FPS (presented / elapsed) vsms/title frame(frames/report_frames) stay internally consistent.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): 0 warningsonly_accepted_presents_count_toward_fps_but_every_attempt_ends_the_title_framepassed;--features diagnosticshost::tests13/13 andqueue::tests5/5 passed--features diagnostics):host::tests13/13 andqueue::tests5/5 passed.LGTM.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T01:07:04Z.
Independent native Windows CPU verification at exact head
720969ad8795e0d1fb4b82dc5d8accaee42a1d30.diagnostics. The occluded, failed, and successful presents produced three completed title frames and one accepted present.These runs add exact-head CPU coverage alongside the posted WARP report. They used no GPU or game data.
AI-assisted by Codex (gpt-6.2-sol).
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T02:17:20Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):cargo test -p victory-gpu --lib host::tests: all 13crate::host::tests::*tests passed (including newonly_accepted_presents_count_toward_fps_but_every_attempt_ends_the_title_frame; the single failure in the filter output is the pre-existing#1744NVIDIA 1M view-heap cap failure indescriptor::host::tests::dynamic_slots_are_held_until_released).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.cargo xtask policy: 191 files ok.Separating accepted swap-chain presents (
status == S_OK) for FPS from title-frame progression (memory::frame_done()/watch::frame_done()) cleanly prevents occluded presents from stalling title-memory frame retirement while reporting accurate FPS.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T04:26:17Z.
Automated triage for the maintainers.
Merge candidate.
Meter::frameinvictory-gpu/src/host.rssplits intoend_frame(status)andreport, so the FPS figure counts only presents that returnedS_OKwhile ms per title frame,memory::log_frameandwatch::frame_donestill run on everyPresent;present_with_compositorreturnsNonefor an unaccepted present, whichqueue::blinksalready treats as "not black". Main already did the end-of-frame work on everyPresent, so the real change is the FPS numerator and theNoneresult; the description could say that more precisely. The test checks both counters and the title-frame clock.CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:56:34Z.
Review: APPROVED
Reviewed and verified at head
720969adagainstorigin/main(63bcca43) on Windows 11 (RTX 5090 + WARP, D3D12 Debug Layer):Meter::frameintoend_frame(status)(crates/victory-gpu/src/host.rs:3059-3070) andreport(hwnd)(host.rs:3072-3108) at the singleswap_chain.Presentsite (host.rs:3504-3516) cleanly separates displayed swap-chain presents from title-frame progression.status == S_OK(host.rs:3060) distinguishes accepted presents from bothDXGI_STATUS_OCCLUDEDand error HRESULTs, counting onlyS_OKtowardfpswhile always advancingself.frames,self.report_frames,memory::log_frame(), andwatch::frame_done()so occluded windows do not stall title-memory frame retirement.Nonewhen!shown(host.rs:3507-3509) integrates cleanly withqueue::blinks(shown.unwrap_or(false)), preventing false black-frame warnings during occlusion, andself.frames >= 1always holds whenreport()runs.git merge-treeagainstorigin/main(63bcca43);cargo xtask policy(191 files ok);cargo clippy -p victory-gpu --all-targets -- -D warningsclean with default features and--all-features.host::tests31/31 (skipping pre-existing NVIDIA 1M heap-capdynamic_slots_are_held_until_released),frame::tests2/2,memory::tests7/7 passed.VICTORY_D3D12_DEBUG=1(--features diagnostics):host::tests31/31,queue::tests5/5 passed.VICTORY_D3D12_WARP=1) +VICTORY_D3D12_DEBUG=1(--features diagnostics):host::tests32/32 (includingdynamic_slots_are_held_until_released),queue::tests5/5,memory::tests8/8 passed.LGTM.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T10:22:04Z.
On native Windows WARP 1.0.22 with Agility 1.620.2,
720969areturnsDXGI_STATUS_OCCLUDED(0x087a0001) for the first Present in the hidden-window compositor test. The test fails atsingle-plane controlbecause it expects a displayed-frame result. I reproduced it with the D3D12 debug layer off and on.d2f6104is a test-only follow-up directly on720969a. It checks the completed back-buffer copy for the single plane, the fallback and the recovered composite. All 37 tests selected byhost::passed in both debug settings, including the accepted-present and title-frame counter test.41f008calso includes #3697 atdc36368, with both PR histories preserved. For three simulated attempts over two seconds, the readout measured 0.5 FPS with one accepted Present and 0.0 FPS with none. Both measured 666.7 ms per title frame. WARP verified the glyph and background pixels on the single-plane and composited paths, including theVICTORY_FPS=0control. The combined diagnostics GPU suite passed 248 tests with one ignored in each debug setting. Strict GPU Clippy in both feature configurations and asset policy passed.Please retain the Git author if cherry-picking or rebasing
d2f6104, or addCo-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding it into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:34:37Z.
I tested #2935 together with #3785 on
63bcca4. The two PRs touch the samePresentcall. The merge ine2263e6keeps one call toMeter::end_frameper attempt, counts onlyS_OKtoward FPS, and logs the first occurrence of each consecutive run of identical errors. It includes the hidden-window readback test fix.The synthetic test covers eight results, including repeated failures, a different failure, occlusion, and recovery. All eight end a title frame and two count toward FPS. On app-local WARP 1.0.22 with Agility 1.620.2, the combined commit passed all 248 GPU diagnostics tests with one ignored, with the D3D12 debug layer off and on. Clippy passed with default features and with diagnostics. The asset policy check passed.
Integration branch. Please retain the Git authors if rebasing or cherry-picking. If folding my changes into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by UwUCammie on 2026-11-28T19:42:41Z.
I cherry-picked the hidden-window test fix in
98c48a4cwith your authorship intact. The MSVC diagnostics build and the accepted-present and memory-withholding tests passed here under Wine 11.22. Your WARP run covers the pixel readback. I kept the #3785 integration separate so this PR still covers frame accounting and its tests.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.