GPU: route UAV barriers on depth textures to their twin planes #1802
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1803"
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 mgunes1311-lab on 2026-11-24T22:48:40Z.
Summary
Routes
D3D12_RESOURCE_BARRIER_TYPE_UAV(kind == 2) barriers naming a console depth texture to its writable colour twin planes (twin.planes), and skips UAV barriers on host resources that lackD3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.(Note: this PR originally also ordered
HostList::preludetwin copies before advancingcopy.state;315cea1landed that fix onmain, sohost.rsis now unchanged frommain.)Root Cause
Console depth textures with unordered access get their
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESSflag stripped on the host depth-stencil resource, while compute UAV writes go toTwin::planes(crates/victory-gpu/src/twin.rs). Incrates/victory-gpu/src/list.rs,barrierpreviously translatedkind == 2(UAV) barriers by substitutinghost(b.first)directly:ALLOW_UNORDERED_ACCESSin aD3D12_RESOURCE_UAV_BARRIERis invalid in D3D12.twin.planesat all.Changes
crates/victory-gpu/src/list.rs:host_barrierwithpush_host_barriersso a single console UAV barrier on a depth texture with an initializedTwinexpands to UAV barriers on each plane intwin.planes.D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS(dropping UAV barriers on depth textures before a twin exists or on non-UAV colour textures).uav_barriers_on_depth_textures_target_their_twin_planes.Verification
cargo test -p victory-gpu --locked uav_barriers_on_depth_textures_target_their_twin_planescargo clippy --workspace --all-targets --all-features -- -D warningscargo run -p xtask -- policyImported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:25Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Copy depth twins from pre-list states in prelude + route depth: 34K gpu diff touching copy planning and prelude state. Windows-only; interacts with the placed-copy work reviewed earlier (#1374/#1725) — check for overlap.
Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T22:57:04Z.
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:36:38Z.
Automated triage for the maintainers.
Merge candidate. After the merge with
main, the PR changes onlycrates/victory-gpu/src/list.rs.push_host_barriersreplaceshost_barrier, and a title UAV barrier on a depth texture with a twin now becomes one UAV barrier pertwin.planestexture. Before this, it named the host depth resource, which has noALLOW_UNORDERED_ACCESS(incrate::twin, only the planes have that flag). Direct UAV barriers are now also dropped for host textures without that flag.What I checked in
main:host_barrierpassedhost(b.first)straight through for kind 2, and nothing else inbarrierorders writes to twin planes (the extra globalUAV_BARRIERthere is only added for buffers). Transition and aliasing barriers behave as before. If a twin was never made (Some(None)), the code falls back to the flag check, so no invalid barrier is recorded. The new testuav_barriers_on_depth_textures_target_their_twin_planessubmits the list and checks that the debug layer logged nothing.CI: the
checkrun passed on the current head.Generated by Claude Code
[PR #1803] GPU: copy depth twins from pre-list states in prelude and route depth UAV barriers to twin planesto [PR #1803] GPU: route UAV barriers on depth textures to their twin planesImported from Marvisak/VIctory. Originally posted by mgunes1311-lab on 2026-11-25T17:15:59Z.
Merged
main(67e8ae1) to resolve the conflicts: since315cea1landed theHostList::preludetwin-copy ordering onmain,crates/victory-gpu/src/host.rsnow matchesmainwith zero diff and this PR is narrowed to routing depth-texture UAV barriers totwin.planesincrates/victory-gpu/src/list.rs. Updated the PR title and description accordingly.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T18:48:40Z.
Review: APPROVED
Reviewed
7c609deb480fmerged cleanly onto63bcca43.The
kind == 2UAV barrier routing incrates/victory-gpu/src/list.rs:545-569accurately matches how depth-twin writes execute on the host:pResource == NULLUAV barriers (list.rs:545).list.rs:552-560), covering both depth and stencil planes on dual-plane formats.D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS(list.rs:562-568), cleanly skipping depth textures without a twin and non-UAV colour targets that would otherwise violate D3D12 barrier rules.resource::evictable), callinglist.keep(&plane.texture)/list.keep(©.texture)when emitting a UAV barrier would also protect against a title releasing a resource after recording a UAV barrier on a list that had not yet transitioned it (matchingHostList::transition).Hardware & D3D12 Debug Layer verification (RTX 5090 + Microsoft WARP,
VICTORY_D3D12_DEBUG=1):cargo xtask policyandcargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features) pass cleanly.cargo test --locked -p victory-gpu list::tests:: -- --test-threads=1passed 5/5 on both RTX 5090 and WARP underVICTORY_D3D12_DEBUG=1(0 Debug Layer messages).#1933(e5750d906995) onto63bcca43and verified bothtwin::tests::(4/4) andlist::tests::(5/5), plus an additional probe initializing aD32_FLOAT_S8X24_UINT (20)depth twin via#1933's defaultNoneUAV and executing a batch combining a globalNULLUAV barrier, a pre-transition 2-plane depth UAV barrier (COMMONstate), a transition toUNORDERED_ACCESS, and a post-transition 2-plane UAV barrier — zero D3D12 Debug Layer messages on both RTX 5090 and WARP.LGTM.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T00:09:12Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib list:: -- --test-threads=1: all passed.cargo test -p victory-gpu --lib twin:: -- --test-threads=1: all passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.