D3D12.X: count the barriers that use a depth buffer as a UAV (#970) #1020
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1027"
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 ivall/xcl. Originally posted by IvyNotFound on 2026-11-24T10:30:16Z.
Part of #970: diagnostics only, the first of the four steps planned there. Replaces #1021, closed when its fork was deleted (same commit).
A console depth buffer that shaders write too has no
ALLOW_UNORDERED_ACCESSon the PC (device_x::pc_resource_descdrops it) and its UAVs are null views (real::dev_create_uav_x), so what shaders write through them is lost. This counts and logs the title's barriers that use such a resource as a UAV, so the effect can be measured before anything changes. No behaviour change: every barrier still goes to the PC as before.On the retail title of #505 no legacy barrier touches these resources: its texture transitions come through #146 (enhanced barriers,
D3D12_BARRIER_GROUP), whose description XCL does not read (it emits one global UAV barrier – HANDOFF lists the #146 description as "not yet"). There, D16 shadow maps (768x768x6, 1024x1024, 512x512) go into or out of theUNORDERED_ACCESSlayout once the world starts loading (62–64 s; 12 barriers in a run with every one logged).What is in it
crates/xcl/src/hle/d3d12x/list_x.rs:depth_without_uav(ALLOW_DEPTH_STENCIL without ALLOW_UNORDERED_ACCESS) andnote_depth_uav_barrier(counted; the first 8 and every power of two logged), called for transitions from / toUNORDERED_ACCESSand UAV barriers naming the resource inresource_barrier_x;note_depth_uav_barrier_groupsreads the texture barriers of #146 (uav_barrier_x) and counts those with theUNORDERED_ACCESSlayout or access (barrier_uses_uav). Tests:a_depth_buffer_without_unordered_access_is_one_with_null_uavs,an_enhanced_barrier_into_or_out_of_unordered_access_is_a_uav_use.crates/xcl/src/hle/d3d12x/console_list.rs: the same for console-recorded lists (their replayed transitions and their #146 calls).crates/xcl/src/hle/d3d12x/real.rs: the null-view warning gives its total instead of stopping at 4.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4atd9d11f5(rebased ontomainb7aa9f3) withXCL_SAMPLE_RPF,_DLLS,_TTPF,_BVH4,_BK2,_AWCset: 772 passed, 0 failed, 41 ignored;SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware. Before the rebases, one run of the same change had the #718 flake (715 passed, 3 failed).scripts/smoke.ps1,XCL_PRESS_A_AT=15: the regression runs below (60 s, menus and the start of world loading;mainb7aa9f3and this headd9d11f5, after the rebase), and a 300 s run of this branch for the numbers above (it ends in the title's "GPU Loc Sig" abort at ~92 s, asmaindoes).Regression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T11:19:50Z.
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 -- barrier uav depth: 15 passed, 0 failed — includes the newan_enhanced_barrier_into_or_out_of_unordered_access_is_a_uav_useanda_depth_buffer_without_unordered_access_is_one_with_null_uavs.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:31:37Z.
Empirical test report (
d9d11f5b)Hardware / environment
XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1.1.100.0 (0ef1bc386 2026-11-09)and DXC1.9.2609.5 (01b62ad47). Cargo test profile with debug info and incremental compilation disabled.Commands and results
d9d11f5b93003ea6a0c7f2b67c81ab3c83024ec4for PR #1027.cargo test --workspace --no-runexited 0 and compiled the workspace test targets.cargo test -p xcl --lib -- --exact hle::d3d12x::list_x::tests::a_depth_buffer_without_unordered_access_is_one_with_null_uavs hle::d3d12x::list_x::tests::an_enhanced_barrier_into_or_out_of_unordered_access_is_a_uav_useSKIPPEDlines. The counts come from the case-sensitive Rust test summaries andSKIPPEDline markers in the captured output.Observed behavior
pc_resource_descfor a console depth texture with unordered access.Not tested
The full GPU workspace suite and game smoke runs were omitted. The fixtures cover CPU-side flag and barrier classification. Live barrier counting, warning cadence, and dispatch to a D3D12 device were outside the focused run.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1027-focused.logand published.Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T19:22:22Z.
NVIDIA test report for
d9d11f5(head as is, baseb7aa9f3), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, aftercargo build --workspace:cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 763 passed, 0 failed, 41 ignored. The end-to-end title tests pass.mainat0829441(not currentmain) on the same machine, same command: 1263 passed, 0 failed, 46 ignored (the PR's base is older, so it has fewer tests).hle::xaudio2, because its tests fail or hang on this machine onmaintoo. The PR doesn't touch it.no wave64on this card.AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:39:25Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:39:27Z.
Triage (#1607) – head
d9d11f5#1063 is stacked on this PR, and both target #970. Main has since fixed #970 differently:
hle/d3d12x/depth_uav.rs(#3203, then #3290 with4dd049f6turning it on by default) gives the depth plane of such a buffer an R32/R16 twin. The twin is copied around the title's UAV transitions and #146 layouts, so its UAVs are no longer null views.On main,
note_depth_uav_barrierwould warn "its UAVs are null views, what shaders write there is lost" for buffers that do have a twin. The null-view counter with powers of two is also on main already (depth_uav::null_view).Recommendation: close (superseded by #3290 / #3203).
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:41:49Z.
Closing as superseded: this change is already on
main(702c2d9d). PR is a warning/counter for barriers on depth buffers whose UAVs are null views; main depth_uav.rs (#3203,4dd049f6, #3290 merge702c2d9d) gives such buffers UAV twins on by default (XCL_DEPTH_UAV_TWIN); only D24S8 depth plane has no twin and the diagnostic would not name that case eitherTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed