D3D12.X: translate list #146 Enhanced Barriers to legacy ResourceBarrier #1025
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1025
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1025"
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?
@raylitebull on GitHub · 2026-11-24 10:27 UTC · original
raylitebull:pr/enhanced-barriers-146→main· +946 −34 · 5 files · 1 commits · draftTranslate console command list slot
#146(ID3D12GraphicsCommandList7::Barrier(NumBarrierGroups, pBarrierGroups)) into legacyResourceBarriercalls instead of emitting only a wildcard UAV barrier. Modern Scarlett titles that create resources with barrier layouts (device#127/#133) rely on#146for all render-target, depth, shader-resource, and copy layout transitions; dropping those transitions left targets stuck in their initial states.(The diff is ~950 lines as one self-contained module: ~520 lines for parsing, layout mapping, state tracking, and legacy barrier translation, plus ~395 lines of unit and GPU tests.)
What is in it
crates/xcl/src/hle/d3d12x/enhanced_barrier.rs: parsesD3D12_BARRIER_GROUP(GLOBAL,TEXTURE,BUFFER) withreadable()guards (falling back to the legacy global UAV barrier on unparseable calls), mapsD3D12_BARRIER_LAYOUT0..=31(including0x1F) plus access-bit fallback for console-only layouts> 0x1F, tracks whole-resource states forUNDEFINEDbefore layouts, emits aliasing barriers forUNDEFINEDplaced textures, skipsUNORDERED_ACCESSon non-UAV textures and states disallowed on compute/copy lists, forwards emitted transitions totitle_textures::note_transitions, and includes 13 unit + GPU tests.crates/xcl/src/hle/d3d12x/device_x.rs,real.rs,list_x.rs,mod.rs: wire slot#146toenhanced_barrier::barrier_x, align#127/#133initial layout states with texture-vs-buffer awareness, record initial/legacy barrier states, and clear tracked state onres_release.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), release + test profilescargo test --workspace -- --test-threads=4: 741 passed, 0 failed, 41 ignored (0 SKIPPED GPU tests)Regression run
main:
PR:
Not tested
AI use
origin/main, cleaned up unused helper/constant warnings, ran the full GPU test suite and 60 s smoke regression check, and drafted this description.@poucosaudavel on GitHub · 2026-11-24 11:01 UTC · original
Test report for the exact head
1ecefdda3b4627ab8160845942f27ab4e75ce0c5, since Not tested lists NVIDIA GPUs.Tested
main(6efdabcdaac93ce5cc123a85e85deba5d49cb294) as the baselinecargo build --workspace, thencargo test --workspace -- --test-threads=4:hle::d3d12x::enhanced_barrier::tests::*; no test present on the base is missing or failing on the PR.enhanced_barriers_move_a_render_target_on_the_gpuran on the NVIDIA adapter (the log shows backendrealon the RTX 5060 Ti) and passed.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskandgpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)Not tested
scripts/smoke.ps1regression run on a retail title: this covers the test suite only.AI use
@DavidM1911 on GitHub · 2026-11-24 11:21 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.
cargo test -p xcl --lib enhanced: 14 passed, 0 failed — allenhanced_barrier::tests, including the GPU testenhanced_barriers_move_a_render_target_on_the_gpu(ran on the default adapter, RTX 3060 Ti).AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@IvyNotFound on GitHub · 2026-11-24 14:30 UTC · original
Retail run into world loading on an RTX 5080:
1ecefddmerged ontomain930e8b4– no crash or device removal, the barriers are translated, the frames after loading stay black as onmain, and the #505 GPU-wait stalls come at least as oftenTested
main930e8b4+ this PR's head1ecefdd(clean merge, local commitbbace0e).cargo test -p xcl --lib enhanced(debug): 14 passed, 0 failed (the GPU test ran on the RTX 5080).scripts/smoke.ps1 -Seconds 140,XCL_PRESS_A_AT=15,XCL_PSO_WAIT_MS=50(so it gets past the firstListX #101into world loading),XCL_FRAME_DUMP=2. Two runs of the PR, compared with one ofmainwith the same settings.main930e8b4GPU queue.Wait … did not complete within 5000 msBarrier: 1 groups, 2 barriers (2 texture) → 2 legacy barriersat 3.1 s.Barrier: N transitions a list of type 2 cannot make – left out(N = 1, 4, 7).main(#505).mainrun. My earliermainruns of the same title reached up to 43 GB peak commit and 13–34 timeouts (https://github.com/ivall/xcl/issues/505#issuecomment-7130913073), so two runs do not show that this PR causes it. Run 2's peak is 127 % of thismainrun's.Not tested
Note for whoever merges: #1063 (mine, stacked on #1027) also acts on this slot's calls, in
list_x::uav_barrier_x. It adds depth ↔ twin copies after the global UAV barrier. With this PR the slot goes toenhanced_barrier::barrier_xinstead, so whichever lands second needs the other's hook.AI use
@deepdev237 on GitHub · 2026-11-24 14:46 UTC · original
Parser observation from a retail run on AMD RDNA4
Tested
32.0.32015.7029), Ryzen 9 5950X, Windows 11 build 26300, Rust 1.100.0 MSVC, release.930e8b49c1c2ec683d22c724a398b39111cd0e56(Git tree391b7fe28b4f99bce3d9183b99f794f50e592f1c) reused the slot #146 parser from1ecefdda3b4627ab8160845942f27ab4e75ce0c5. It retained the existing PC global UAV barrier forwarding.xcl.exe run "<retail-title>"withXCL_NETWORK=0,XCL_DRED=1,XCL_PSO_WAIT_MS=50andXCL_TRACE_INDIRECT_BARRIERS=1: all 80 traced indirect calls matched slot #146 BUFFER records on the same resource, with whole-buffer access0x10 → 0x290before and0x200 → 0x10afterward.DXGI_ERROR_DEVICE_HUNG. The only started, unfinished list was 11 of 17 operations complete, withEXECUTEINDIRECTnext and no usable page-fault address.Not tested — The full #1025 head or its native barrier translation. These are the title's declared access masks. The diagnostic did not read back the dispatch arguments from the GPU.
AI use — OpenAI Codex (
gpt-6.2-sol) ran the tests, checked the local receipts and wrote this report.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.