Repository navigation
Conversation
|
@afpruivo I found a creation-order case on
The creation hook only starts recording initial states after the first batch has been counted. The existing test seeds the creation state directly, so it covers the second case. Could you add a regression that calls the creation hook before processing any barriers? I reproduced both outcomes in two fresh Windows CPU test processes using the state-tracking and translation functions extracted from the PR head. I didn’t run this through D3D12 or establish that the textures in #3489 were created in that order. I used Codex GPT-6.2 Sol to build and run the fixture. A separate GPT-6.2 Sol agent reviewed the source and results. Codex GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting. |
|
Following the creation-order reproduction, I traced two more ways the starting state is lost on head
Please track each texture's initial state from creation through final release, independent of the statistics counter. Preserve the state of each untouched plane, and let a whole-resource legacy transition reestablish a known state after a partial one. A single per-resource record seeded with both planes would keep those updates together; This is a source trace; I did not run a new GPU or title test. AI use: Codex (GPT-6.2 Sol) traced the calls and drafted this note; Codex (GPT-6.2 Astra) independently checked the lifecycle. |
|
Review (head 94c9514, diff read, not a merge-check; draft, so not built or run):
Fine: the last-moved state still wins, AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
…state A barrier group's texture barrier from the undefined layout started at the state a barrier group last moved the texture to; a texture no group had moved yet got no PC transition at all. A render target or depth buffer made in COMMON then stayed there while the title drew into or cleared it, and the title's next barrier named a state the PC texture was not in: debug layer errors 538 and 527 on the retail title (xcl-dev#3489). Each texture now has one record from creation to release, seeded on both planes with the PC state it was made in, at the creation points that pass that state to depth_uav (and the CreatePlacedResource the PC accepts on the first try). It is kept whether or not the title has used barrier groups yet, since most render targets and depth buffers are made at load, before the first group. Barrier groups and legacy transitions move it per plane; a legacy transition of all subresources sets both planes, so a known state comes back after a partial one. Release drops it. Buffers are not recorded. Barriers from the undefined layout that ask for a discard (D3D12_TEXTURE_BARRIER_FLAG_DISCARD) are counted and logged by kind of texture. XCL sends no discard for them; the count shows whether the title relies on it. Fixes xcl-dev#3489. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#3558 works on the same barriers (#3489) differently: it sends moves from the undefined layout as enhanced barriers with no before-state (opt-in AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
94c9514 to
0d61b2c
Compare
|
Thank you @Gevroska, @thehollowedone and @Foniass. All of your points held up against the code, and the new head
On the title (RTX 3090, debug layer, 300 s): the draw and the depth clears in COMMON and the RENDER_TARGET-vs-COMMON 527 that #3489 reported are gone in both runs of this head. ClearRenderTargetView in COMMON still happens later in loading; a run that logged barriers finding no record of their texture logged none, so those are recorded textures in a different state on the GPU: the recording-order limit KDenKC's submit-time series is for, plus per-level moves. Numbers in the description. The run also showed the title asks for AI use: Claude Code (Claude Opus 5.5) wrote the change, ran the tests and the runs, and drafted this reply; I checked each point. |
|
Ran the Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build, All 11 tests pass here, the same count as the description, including the creation-to-release tracking case and the partial-then-whole legacy move case. The description's WARP fixtures and title runs were not repeated. Not tested: the full workspace suite, a retail title, the debug-layer 538/527 symptom, WARP as a separate device, AMD adapters, Wine, release profile, game data. AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
merge-check |
A barrier group's texture barrier from the undefined layout started at the state a barrier group last moved the texture to, so a texture no group had moved yet got no PC transition. A render target or depth buffer made in COMMON then stayed in COMMON while the title drew into or cleared it, and its next barrier named a state the PC texture was not in (debug layer 538 and 527). Each texture now has one record from creation to release, seeded on both planes with the PC state it was made in, and a barrier from the undefined layout starts there. Fixes #3489.
This is the starting state only. Barrier states still follow the order the title records its lists, not the order the GPU runs them (#3094; KDenKC's submit-time series, #3559); that series needs each texture's creation state for its first move, which this record gives.
What is in it (one commit)
crates/xcl/src/hle/d3d12x/barrier_groups.rs:LASTis the one record per texture.note_createdseeds it on both planes at creation, whether or not the title has used barrier groups yet (most render targets and depth buffers are made at load, before the first group); buffers are not recorded. Barrier groups and legacy transitions move it per plane; a legacy transition of all subresources sets both planes, so a known state comes back after a partial one (legacy_moved).forgetdrops it on release. Barriers from the undefined layout that ask forD3D12_TEXTURE_BARRIER_FLAG_DISCARDare counted and logged by kind of texture (log only; nothing sent changes).device_x.rs,real.rs:note_createdat the creation points that calldepth_uav::note_created, and theCreatePlacedResourcethe PC accepts on the first try.a_texture_is_tracked_from_creation_through_legacy_and_group_barriers_to_release(WARP textures through the creation, legacy, barrier-group and release hooks: creation before any group, a legacy move first, a partial then a whole legacy move, depth then stencil, release and reuse of the pointer; it fails with the old gate on creation),a_legacy_move_of_some_subresources_then_of_all_leaves_a_known_state, and the updateda_new_texture_leaves_the_undefined_layout_from_the_state_it_was_made_in.Tested
NVIDIA GeForce RTX 3090 24 GB (driver 621.40), Intel Core i5-13600K, 32 GB, Windows 11 build 26300, Rust 1.99.1; debug for the suite, release for the title runs.
cargo test --workspace --no-fail-fast -- --test-threads=4(the change onmain493dbd3d): 2903 passed, 0 failed, 51 ignored; SKIPPED: 27 (no wave64 on this 32-lane GPU, no heap windows, no D3D12 debug layer at the time).cargo test -p xcl --lib barrier_groups: 11 passed.The retail title with
XCL_D3D12_DEBUG=1,XCL_PREPARE=0, 300 s, the same input script on both (XCL logs the first 8 messages of each id, so 8 means 8 or more):main493dbd3A third run with a log line for any barrier from the undefined layout that finds no record of its texture logged none: the ClearRenderTargetView errors left are on recorded textures whose recorded state differs from the GPU's. Two are on subresource 3 (the record has one state per plane, not per level, as before); the others fit the recording-order limit above. The counter shows the title asks for a discard on most of its moves from the undefined layout (run 2: render targets 19,582 of 24,393, depth 1,251 of 2,256, unordered access 44,717 of 44,717); XCL sends no discard for them, which is not changed here.
PR run 1 ended at 122 s with an access violation in
D3D12Core.dllunder the debug layer, inSetPipelineState(bind.rs~4642), not in barrier code; it did not happen in the next two runs of this head or in themainrun.Regression run
main:
this PR:
Not tested
XCL_PREPARE=0(menus and loading screens); errors that only happen there are not counted.GetDescper texture made) beyond the smoke run.AI use
🤖 Generated with Claude Code