D3D12.X: count the barriers that use a depth buffer as a UAV (#970) #1021
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!1021
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1021/head"
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?
@IvyNotFound on GitHub · 2026-11-24 10:26 UTC · original
depth-uav-diagnostics→main· +131 −4 · 3 files · 1 commits · closed without mergingPart of #970: diagnostics only, the first of the four steps planned there.
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=4withXCL_SAMPLE_RPF,_DLLS,_TTPF,_BVH4set, at65eb999(the same tree as the headba8d356, whose only change is the commit message): 718 passed, 0 failed, 41 ignored;SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware. An earlier run of the same tree had the #718 flake (placed_title_textures_share_vram_and_preserve_pixels,cubemap extra_pages must be reused at same va, and the twoPoisonErrorfailures after it): 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), 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
Pull request closed