GPU: add Series S second-plane composition and opt-in screen-probe ambient fallback #3414
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!3414
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3414"
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?
@legayclightning22 on GitHub · 2026-11-26 23:18 UTC · original
legayclightning22:feat/second-plane-compose-and-ambient-fallback→main· +1128 −16 · 9 files · 1 commits · openPorts B10 and B11: opt-in compute composition for the Series S second plane (VICTORY_COMPOSE, VICTORY_PLANE_PREMULTIPLIED) and an off-by-default screen-probe ambient fallback (VICTORY_AMBIENT and tint/shade/sky/file settings), with unit tests for plane dispatch setup and env parsing.
@Dukestar69 on GitHub · 2026-11-26 23:27 UTC · original · approved these changes
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib ambient:: -- --test-threads=1: 2 passed, 0 failed.cargo test -p victory-gpu --lib compose:: -- --test-threads=1: 2 passed, 0 failed.cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 193 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Jackster on GitHub · 2026-11-26 23:46 UTC · original
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX:cargo test -p victory-gpu --lib: 235 passed / 0 failed / 1 ignored (unpatched63bcca4here: 231 passed; +4).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.The added tests are
ambient_gate_is_off_unless_set,ambient_tint_sky_and_shade_settings_parse,plane_composition_setup_is_straight_or_premultipliedandplane_gates_are_off_unless_one; all pass, and the existing draw/placed-UAV tests are unchanged. The screen-probe fallback and the Series S plane composition are both opt-in, so nothing changes for a run with the gates off. Synthetic only. AI-assisted.@andrewpozdnakov7-jpg on GitHub · 2026-11-27 00:05 UTC · original
At
ed1d879,present_with_compositorinvokes the compute pass before it moves the primary texture to copy-source. The pass still declares that transition's starting state asCOPY_SOURCE. The new fixture records an input inRENDER_TARGETand replays the barriers before submitting. On the exact PR, the primary's first barrier declares0x800while its actual state is0x4.Follow-up
5d3b298passes the primary's incoming state into the compute pass and restores both inputs. When both planes refer to the same texture, it transitions that texture once in each direction. The copy and diagnostics use the selected output.On app-local WARP, the 9×7 readback passed twice in each alpha mode. All 63 texels matched the filtered 2×1 overlay within one UNORM8 unit. All 63 texels also matched exactly when both planes used the same input. Strict GPU Clippy in both configurations and asset policy passed. The full suite hit the known frame timer assertion in the unchanged
frame.rs. With that test excluded, it passed 250 with one ignored.@legayclightning22, could you take the state fix and repeat the opt-in Series S present path? If you fold it in, please retain the Git author or use
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@fuzeofficlal on GitHub · 2026-11-27 01:21 UTC · original · requested changes
Tested on RTX 5090 and WARP with
VICTORY_D3D12_DEBUG=1andVICTORY_D3D12_GBV=1. While default builds (both flags off) andVICTORY_AMBIENT=1ran cleanly in the probe, enablingVICTORY_COMPOSE=1reproduces three concrete D3D12 state-tracking / validation errors on both RTX 5090 and WARP:compose::recordassumesgameis already inCOPY_SOURCEand leaves it stuck inCOPY_SOURCEafterpresent(crates/victory-gpu/src/host.rs:3298-3318,crates/victory-gpu/src/compose.rs:265, 273):host.rs:3298-3306callscompose::record(&self.device, list, game, ui, ui_state)before transitioninggameout ofshown[0].1(typicallyD3D12_RESOURCE_STATE_RENDER_TARGET), whilecompose.rs:265unconditionally transitionsgamefromD3D12_RESOURCE_STATE_COPY_SOURCEtoNON_PIXEL_SHADER_RESOURCE. Live D3D12 debug layer output on both RTX 5090 and WARP:compose.rs:273then transitionsgametoCOPY_SOURCE, andhost.rs:3313overwritesstate = D3D12_RESOURCE_STATE_COPY_SOURCE, causing the post-present restore barrier (if state != COPY_SOURCE) to be skipped.gameis left inCOPY_SOURCEeven thoughHost::presentpromises to keep presented textures in their original state, triggering a second D3D12 error on the next render-target use ofgame:game's actualgame_stateintocompose::record, transitiongamegame_state -> NON_PIXEL_SHADER_RESOURCE -> game_state(preserving its state), leaveoutinCOPY_SOURCE, and whenlaid.is_some()skip transitioningtexture(game) altogether aroundCopyResource.Duplicate conflicting barriers when
gameanduirefer to the same resource (crates/victory-gpu/src/compose.rs:264-283):Unlike the multi-plane
Compositorpath (host.rs:3411-3414),compose::recorddoes not checkgame.as_raw() == ui.as_raw(). Passing the same texture in both planes triggers D3D12 validation errors1008(duplicate barrier on the same subresource) and527(mismatched before/after states) on both RTX 5090 and WARP.Diagnostics capture and black-frame probe read uncomposed
textureinstead oflaid(crates/victory-gpu/src/host.rs:3345, 3348):Line
3326copieslaid.as_ref().unwrap_or(texture)into&back, but lines3345(capture::read_back) and3348(capture::probe) still passtexture. That drops the composed overlay from captures/probes and also causesCopyTextureRegionstate error538oncegameis properly restored togame_stateinstead of left inCOPY_SOURCE. Passinglet source = laid.as_ref().unwrap_or(texture);toCopyResource,read_back, andprobekeeps all three consistent.(Design note):
ambient.rsmatches specific shader-name substrings (CS_ScreenProbes_TemporalResolve,CS_UpdateHistory,ps_sky_paraboloid_reflection) and hardcoded root table offsets ((1, 176),(1, 40),(0, 464)). Worth double-checking whether maintainers want title-specific shader/table hooks invictory-gpueven behind an opt-in switch.@moe-miau on GitHub · 2026-11-27 03:44 UTC · original
NVIDIA result for the ambient fallback in this PR (
VICTORY_AMBIENT=0.8), RTX 4070 SUPER (32-lane waves), driver 32.0.16.1742, Windows 11. The title was used locally; only numbers and a description of the picture are reported here.Tree:
mainf3578e3+ #2464, #2098, #2626, #2628, #2711, #2851, #2705 (VICTORY_CARD_COPIES=1), #2176/#2925 (VICTORY_WAVE32_APPROX=1), #2958, #3069, then this PR (ed1d879b, clean cherry-pick).diagbuild, Series X profile, the BVH builder held back as on the base. Same save and scripted input for every run, prison cell after the opening.VICTORY_AMBIENT=offVICTORY_AMBIENT=0.8So on NVIDIA the green patches the indirect-light probes leave without the BVH builder are covered by this fallback. I didn't see a frame-time cost I could separate from run-to-run noise. Another NVIDIA observation, not about this PR: on the Series S profile the world stays black in the same tree, because the title's own FSR4 passes don't translate (the known gap in the README), so I tested Series X.
Two notes on the PR itself: the plane composition (
VICTORY_COMPOSE) and the ambient fallback are separate features, and they might review faster as two PRs. AndVICTORY_AMBIENTis also the switch name in #2619, with a different syntax.AI-assisted (Claude Code). Runs done on my machine.
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.