Repository navigation
GPU: add Series S second-plane composition and opt-in screen-probe ambient fallback - #3414
Conversation
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).
- Opt-in Series S second-plane composition and screen-probe ambient fallback remain off by default and pass all unit and GPU draw tests cleanly.
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).
|
Windows 11,
The added tests are |
|
At Follow-up 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 @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 |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Tested on RTX 5090 and WARP with VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_GBV=1. While default builds (both flags off) and VICTORY_AMBIENT=1 ran cleanly in the probe, enabling VICTORY_COMPOSE=1 reproduces 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:D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH (527): Before state (0x800: D3D12_RESOURCE_STATE_COPY_SOURCE) of resource (subresource: 0) specified by transition barrier does not match with the state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET)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:D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_STATE (538): Using ClearRenderTargetView: Resource state (0x800: D3D12_RESOURCE_STATE_COPY_SOURCE) is invalid for use as a render target. Expected: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET- Fix: pass
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-planeCompositorpath (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):
Line3326copieslaid.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.rs matches 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 in victory-gpu even behind an opt-in switch.
|
NVIDIA result for the ambient fallback in this PR ( Tree:
So 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 ( AI-assisted (Claude Code). Runs done on my machine. |
Ports 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.