Repository navigation
D3D12.X: translate list #146 Enhanced Barriers to legacy ResourceBarrier - #1025
raylitebull wants to merge 1 commit into
Conversation
…rceBarrier Console command list slot xcl-dev#146 is ID3D12GraphicsCommandList7::Barrier(NumBarrierGroups, pBarrierGroups) on both older and newer layouts; previously it emitted only a wildcard UAV barrier, dropping every texture layout transition. - Parse D3D12_BARRIER_GROUP (GLOBAL, TEXTURE, BUFFER) safely with readable() checks; unparseable calls fall back to the legacy global UAV barrier. - Map D3D12_BARRIER_LAYOUT 0..=31 including 0x1F (DIRECT_QUEUE_GENERIC_READ_COMPUTE_QUEUE_ACCESSIBLE) and fall back to access bits for console-only layouts > 0x1F; align device xcl-dev#127/xcl-dev#133 initial layout states with texture-vs-buffer awareness. - Track whole-resource states across xcl-dev#127/xcl-dev#133 creation, legacy xcl-dev#26, and enhanced xcl-dev#146 (cleared on res_release) for UNDEFINED Before layouts, forward emitted transitions to title_textures::note_transitions, emit wildcard aliasing barriers for UNDEFINED placed textures, keep non-UAV textures out of UNORDERED_ACCESS, and skip states disallowed on compute/copy lists.
|
Test report for the exact head Tested
Not tested
AI use
|
itsonewi
left a comment
There was a problem hiding this comment.
Global barriers with AccessBefore = NO_ACCESS emit nothing
Access::orders_earlier_work() returns false when access_before == NO_ACCESS, so the Item::Global arm of translate contributes no UAV barrier in that case. A global barrier is the enhanced-barrier form of a legacy NULL UAV barrier (D3D12 enhanced-barriers spec, "UAV Barriers": "Legacy Resource Barriers support NULL UAV barriers. These are equivalent to enhanced Barrier global barriers."), and SyncBefore = ALL with AccessBefore = NO_ACCESS is valid: only SyncBefore = NONE requires AccessBefore = NO_ACCESS, not the reverse.
The old #146 handler (list_x::uav_barrier_x) always emitted a NULL UAV barrier, so an XboxBvhBuilder global barrier that carries no access bits now emits nothing. The 60 s "Game Assets" smoke run does not reach the BVH builder, and the NVIDIA suite run in the thread covers the tests, not that path.
Could you either emit a UAV barrier for a global barrier with SyncBefore != SYNC_NONE (or for every global barrier, as before), or explain why a no-access global barrier needs no legacy barrier? The test unordered_access_gets_one_uav_barrier_for_all_resources covers AccessBefore = 0x10, and the NO_ACCESS case only with SyncBefore = NONE; a test with SyncBefore = ALL, AccessBefore = NO_ACCESS would pin the answer.
The rest of what I checked reads correctly: the struct offsets, the layout table, the subresource index formula, and the UAV-before/after rules match the spec.
Prepared with AI assistance; I checked each point against the code and the D3D12 enhanced-barriers spec.
|
Independent verification, merged onto current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Retail run into world loading on an RTX 5080: Tested
Not tested
Note for whoever merges: #1063 (mine, stacked on #1027) also acts on this slot's calls, in AI use
|
|
Parser observation from a retail run on AMD RDNA4 Tested
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 ( |
# Conflicts: # crates/xcl/src/hle/d3d12x/list_x.rs # crates/xcl/src/hle/d3d12x/real.rs
|
Nothing has happened on this PR for 3 days, so it is marked |
|
A note from a separate translation of #146 on our side (not a run of this PR's head), about the read layouts of depth buffers. What we saw (RTX 3090, the retail title, one run per setting, our own #146 translation, not this PR's code)
In this PR (read in Setup: our lab tree (merge base Not tested
AI use: Claude Code, model Claude Opus 5.5, wrote this note from our run logs and a reading of the diff. The person running these tests asked for this post. |
|
Review (head 1ecefdd, diff read, not a merge-check; draft and conflicting, so not built or run):
Fine: the bounded AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Translate 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.