GPU: diagnostic 1440p present fallback for 4K primaries (#841) #2441
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!2441
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2441"
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?
@Xvania7 on GitHub · 2026-11-25 13:34 UTC · original
Xvania7:feat/present-1440p-fallback-841→main· +236 −0 · 4 files · 1 commits · openRefs #841.
Summary
In the prologue and world rendering of GTA VI, the title renders 3D geometry into internal
2560x1440color render targets (f28/f29/f87/f91), but its final upscale/FSR pass to3840x2160fails or remains unwritten, causing the swapchain to present an all-black image while thousands of draws are actively recorded and executed.This PR adds an opt-in
VICTORY_PRESENT_1440P=1diagnostic fallback (derived from community investigation by @mpDom and @MichaelSmithAI in #841):crates/victory-gpu/src/draw.rs,host.rs): Tracks eligible2560x1440color targets during render-target (apply_targets) and UAV writes (readable).crates/victory-gpu/src/host.rs): Publishes the latest candidate target only after the submitting command list's GPU fence has completed on hardware (self.fence.GetCompletedValue() >= submitted).crates/victory-gpu/src/queue.rs): Substitutes plane 0 at present time when primary extent is3840x2160and differs from candidate (is_candidate_4k_primary). Preserves smaller primaries and retained overlays.Tested on native Windows 10 x64 + NVIDIA GeForce RTX 5060:
cargo test -p victory-gpu --features diagnosticspassed.cargo clippy -p victory-gpu --features diagnostics -- -D warningsclean (zero warnings).cargo run -p xtask -- policyclean.Co-authored-by: mpDom [email protected]
Co-authored-by: MichaelSmithAI [email protected]
@Xvania7 on GitHub · 2026-11-25 14:00 UTC · original
Thanks @DenRakEiw for testing on RTX 5090 across both default and diagnostics configurations and verifying clean queue and capture test suites! Ready for upstream merge.
@kotekompotek on GitHub · 2026-11-25 14:27 UTC · original
Reviewed — the gating is right for investigation tooling:
#[cfg(feature = "diagnostics")]plusVICTORY_PRESENT_1440Penv means normal builds and runs are untouched. The fallback is conservative on all three axes: only when the recorded work's fence completed (GetCompletedValue >= submitted), only for a true 3840x2160 primary that is not the candidate itself, and the candidate istake()n once per present. The state lookup uses the copy's own tracked state throughlegal_state, not the primary's — correct for a substitute.@Xvania7 on GitHub · 2026-11-25 14:28 UTC · original
Thanks @kotekompotek for the thorough review and validating the conservative gating, fence check, and
legal_statetransition mechanics! Exactly what we aimed for to keep production builds zero-overhead while giving diagnostics a rock-solid visual present path.@Marvisak on GitHub · 2026-11-25 16:10 UTC · original · edited 2026-11-26 08:26 UTC
Automated triage for the maintainers.
Needs work. Thanks for the rebase; it merges cleanly now and CI
checkpasses. Everything is behinddiagnosticsplusVICTORY_PRESENT_1440P, so normal builds are unchanged. Status of the earlier points at3c9cbae:Host::executeit runs afterWaitForSingleObject, so it only skips publishing when the wait itself failed.is_unwritten_4k: renamed tois_candidate_4k_primary(queue.rs), which matches what it does. Note that it swaps in the candidate for any 3840x2160 primary, written or not, so the PR title and body ("when 4K primaries stay unwritten") overstate it. Please reword them.present_fallback_uses_completed_work_once_and_only_at_4kreturns early without a GPU, so CI never runs it. Even on a GPU, its only checks are thattake_1440p_target()is empty afterpresent, and that would also hold if nothing had been published or substituted. A pure test of the gate would run everywhere: a 1440p candidate plus a 4K primary gives a swap, a smaller primary does not, and the candidate is used once. The two tests also callstd::env::set_varwhile other tests run in parallel, andpresent_1440p_oncaches its first answer in aOnceLock, so the outcome depends on which test runs first.note_1440p_target(host.rs) is mis-indented, there are double blank lines incapture.rs,host.rsandqueue.rs, andpresent_1440p_onhas an over-long line.cargo fmtfixes all of these.Generated by Claude Code
@Xvania7 on GitHub · 2026-11-25 17:49 UTC · original
Rebased cleanly onto
origin/main(13f91ca) resolving the conflict incrates/victory-gpu/src/queue.rs. Verified againstorigin/mainwith unit testpresent_fallback_uses_completed_work_once_and_only_at_4kpassing.GPU: live 1440p present fallback when 4K primaries stay unwritten (fixes #841)to GPU: live 1440p present fallback when 4K primaries stay unwritten (#841)f441978245to3c9cbae883@DenRakEiw on GitHub · 2026-11-25 13:58 UTC · original · approved these changes
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090:#841) builds cleanly under both default anddiagnosticsfeature configurations.cargo test -p victory-gpu queue::tests: 4/4 passed.cargo test -p victory-gpu --features diagnostics capture::tests: 2/2 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings(both default and--features diagnostics): 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 14:11 UTC · original · reviewed
Live 1440p present fallback when 4K primaries stay. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
GPU: live 1440p present fallback when 4K primaries stay unwritten (#841)to GPU: diagnostic 1440p present fallback for 4K primaries (#841)@Xvania7 on GitHub · 2026-11-26 08:49 UTC · original
Updated PR metadata per latest triage:
Resolves #841(nowRefs #841) to keep #841 open as this is an opt-in diagnostic workaround.is_candidate_4k_primary).origin/main(63bcca4) with all checks passing (CI / checkcompleted / success).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.