GPU: count accepted presents while keeping title frames advancing #2935
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!2935
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@UwUCammie on GitHub · 2026-11-26 00:48 UTC · original
UwUCammie:fix/title-frames-and-presented-fps→main· +40 −7 · 2 files · 1 commits · openAn 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.
@kotekompotek on GitHub · 2026-11-26 00:53 UTC · original
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.@fuzeofficlal on GitHub · 2026-11-26 01:02 UTC · original
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.
@oni-swr on GitHub · 2026-11-26 01:07 UTC · original
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).
@Marvisak on GitHub · 2026-11-26 04:26 UTC · original
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
@Dukestar69 on GitHub · 2026-11-26 02:17 UTC · original · approved these changes
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).
@fuzeofficlal on GitHub · 2026-11-26 11:56 UTC · original · approved these changes
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.
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.