Repository navigation
Conversation
…ween states A title that uses enhanced barriers makes all its texture state changes through command list xcl-dev#146, Barrier(groups). XCL answered xcl-dev#146 with a global UAV barrier only, so no PC texture left the state it was created in: render targets were sampled while still compressed, depth buffers read as textures were never expanded, and a depth buffer the title moved into unordered access never reached depth_uav. On the retail title this left the world dark. New hle/d3d12x/barrier_groups.rs turns each texture barrier of the groups into a legacy transition between the states its layouts stand for (state_of), on the subresources its range names (depth and stencil planes tracked separately), and sends them the way a title's own ResourceBarrier calls go (list_x::resource_barrier_x), after the UAV barrier that still stands for buffer and global barriers. legal() drops what the PC would refuse: an illegal barrier fails Close with E_INVALIDARG. A barrier from the undefined layout starts at the state the texture was last moved to; resource_barrier_x notes legacy transitions for that (note_legacy_state), and a released texture is forgotten. XCL_BARRIER_GROUPS=0 turns the transitions off. Ported from amd-dev: barrier_groups.rs as of fdd1ac2 (which added the per-plane depth / stencil tracking) and the xcl-dev#146 wiring of a68f609 (raylitebull, written with Claude Code), with depth_uav::kept made available outside tests as on amd-dev (barrier_groups asks it), without that commit's other work (depth twins on by default, ambient, kernelx sections, RAM budget, memory map), its XCL_BARRIER_LOG diagnostics, or the format_alias hooks main does not have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks
Contributor
Author
|
Closing: Kalmarv's #3287, which came first, is merged and does the same. Anything still missing from it can go in a small follow-up PR. (Claude Code, Claude Opus 5.5, for Foniass) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A title that uses enhanced barriers makes all its texture state changes
through command list #146, Barrier(groups). XCL answered #146 with a
global UAV barrier only, so no PC texture left the state it was created
in: render targets were sampled while still compressed, depth buffers
read as textures were never expanded, and a depth buffer the title moved
into unordered access never reached depth_uav. On the retail title this
left the world dark.
New hle/d3d12x/barrier_groups.rs turns each texture barrier of the
groups into a legacy transition between the states its layouts stand
for (state_of), on the subresources its range names (depth and stencil
planes tracked separately), and sends them the way a title's own
ResourceBarrier calls go (list_x::resource_barrier_x), after the UAV
barrier that still stands for buffer and global barriers. legal() drops
what the PC would refuse: an illegal barrier fails Close with
E_INVALIDARG. A barrier from the undefined layout starts at the state
the texture was last moved to; resource_barrier_x notes legacy
transitions for that (note_legacy_state), and a released texture is
forgotten. XCL_BARRIER_GROUPS=0 turns the transitions off.
Ported from amd-dev: barrier_groups.rs as of fdd1ac2 (which added the
per-plane depth / stencil tracking) and the #146 wiring of a68f609
(raylitebull, written with Claude Code), with depth_uav::kept made available
outside tests as on amd-dev (barrier_groups asks it), without that commit's other
work (depth twins on by default, ambient, kernelx sections, RAM budget,
memory map), its XCL_BARRIER_LOG diagnostics, or the format_alias hooks
main does not have.
What is in it
crates/xcl/src/hle/d3d12x/barrier_groups.rs(new, about 630 lines of which about 160 are tests):state_of(layout to PC state),subresources/ per-plane tracking,legal,transitions,note_legacy_state,forget; tests for the layout mapping, ranges, planes and illegal statescrates/xcl/src/hle/d3d12x/list_x.rs: Compute dispatches: a shader takes no more arguments from user SGPRs than it has (XboxBvhBuilder builds empty BLAS / TLAS) #146uav_barrier_xsends the transitions after its UAV barrier;resource_barrier_xnotes each legacy transitioncrates/xcl/src/hle/d3d12x/real.rs: a released resource is forgotten;depth_uav.rs:keptavailable outside teststransitionsrefuses a misaligned resource pointer from a title's barrier (windows-core aborts the process on one)Over the 400-line target because the module comes with its tests; the hooks without the module do nothing, and the module without the hooks is dead code.
Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on fb72af5: 2612 passed, 4 failed, 49 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(E_OUTOFMEMORYfromCreateComputePipelineState, seeds 70 / 545 / 1019 / 1507), the same as on main on this machine; they pass on another RTX 5070 Ti. SKIPPED GPU tests: 44 notices, almost allno wave64.xcl-pso-ahead-2, a misaligned COM pointer in windows-core); two reruns ofcargo test -p xcl --libthere and the full run on this head were clean, and no other branch's run hit it.Regression run
main:
this PR:
Not tested
XCL_BARRIER_LOGdiagnostics of the amd-dev commit, and itsformat_aliashooks (main has no format_alias), are left outAI use
🤖 Generated with Claude Code