GPU: route UAV barriers on depth textures to their twin planes #1803
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!1803
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@mgunes1311-lab on GitHub · 2026-11-24 22:48 UTC · original
mgunes1311-lab:gpu-twin-prelude-barriers→main· +190 −29 · 1 files · 7 commits · openSummary
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 -- policy@DesertGamer on GitHub · 2026-11-24 22:57 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 01:36 UTC · original · edited 2026-11-25 18:23 UTC
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
@mgunes1311-lab on GitHub · 2026-11-25 17:15 UTC · original
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.@catminou4 on GitHub · 2026-11-24 23:03 UTC · original · reviewed
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.
@fuzeofficlal on GitHub · 2026-11-26 18:48 UTC · original · approved these changes
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.
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.