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. |
|
#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 |
bmjask
left a comment
There was a problem hiding this comment.
Review of 0d61b2c2: 5 finding(s). 3 are inline. These are on lines outside the diff:
crates/xcl/src/hle/d3d12x/real.rs:3848: Display targets made through the layout form of CreateCommittedResource (#127 -> create_display_target), and textures from CreateReservedResource/CreateReservedResource1, never call barrier_groups::note_created, so #3489 isn't fixed for them. A title using barrier groups that creates its back-buffer targets with a barrier layout (#127, ALLOW_DISPLAY) goes through create_display_target, which calls dev_create_committed_resource and returns without recording. The first UNDEFINED->RENDER_TARGET barrier finds no record and sends nothing, so the PC texture stays in COMMON while the title draws into it: debug layer 538, then 527 on its next barrier. Recording in one place every PC resource creation passes through (the creator!/adopt(Kind::Resource) path) would cover these and any future path.
crates/xcl/src/hle/d3d12x/barrier_groups.rs:423: The moved closure stores the state before legal() adjusts it (compute lists drop PIXEL_SHADER_RESOURCE 0x80, and DEPTH_READ is removed on non-depth textures), and it also stores transitions that refused() drops. So the record differs from what was actually sent to the PC, and the next barrier from UNDEFINED uses it. A texture made in COMMON gets UNDEFINED->SHADER_RESOURCE on a compute list: the PC receives COMMON->0x40, but LAST holds 0xC0. A later UNDEFINED->RENDER_TARGET on a direct list sends 0xC0->RENDER_TARGET while the texture is in 0x40, which is debug layer 527. Since every texture is now seeded at creation, this path runs for all of them. Storing the legalized state, and nothing for refused transitions, would fix it.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| let Some(mut cur) = LAST.get(res) else { return }; | ||
| } | ||
|
|
||
| fn legacy_moved(mut cur: Tracked, sub: u32, after: u32) -> Tracked { |
There was a problem hiding this comment.
legacy_moved keeps one state per plane, so a legacy transition of one subresource (one mip or slice) moves the whole plane's recorded state, and this now runs on every texture from creation. A 4-mip render target made in COMMON gets a legacy barrier moving subresource 1 to COPY_DEST, so the record says plane 0 = COPY_DEST. A full-texture UNDEFINED->RENDER_TARGET barrier then sends one ALL_SUBRESOURCES COPY_DEST->RENDER_TARGET while mips 0, 2 and 3 are still in COMMON: 527, and those mips are never moved. That matches the PR's own leftover subresource-3 errors. Keeping per-subresource state, or dropping the record (back to untracked) when a single subresource moves, would avoid it.
There was a problem hiding this comment.
Right, and it was the subresource-3 leftover in my own debug runs. A legacy move of some of a plane's subresources now leaves that plane unknown (None) instead of moving it, so a later barrier from the undefined layout sends nothing for that plane, as for an untracked texture, until a transition of all of it; a plane with one subresource still takes the state. I chose this over per-subresource state to match #3599, which marks such a texture mixed and keeps today's behaviour. a_legacy_move_of_some_subresources_then_of_all_leaves_a_known_state covers it and fails with the old rule.
| return; | ||
| } | ||
| let array = if d.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D { 1 } else { d.DepthOrArraySize as u32 }; | ||
| LAST.insert(res, created(state, (d.MipLevels as u32).max(1) * array.max(1))); |
There was a problem hiding this comment.
Not certain about this one: every non-buffer texture is now seeded with its creation state and moved by legacy transitions in recording order, but D3D12's implicit promotion and decay aren't modelled, so textures that used to be untracked (nothing sent) now get a definite but wrong before-state. A sampled texture made in COMMON and written by CopyTextureRegion on a direct list with no barrier is promoted to COPY_DEST (a write state, so it doesn't decay). A texture moved COMMON->COPY_DEST on a copy queue decays back to COMMON after ExecuteCommandLists. In either case the next barrier from UNDEFINED sends the wrong before-state (527), where before nothing was sent.
There was a problem hiding this comment.
The cases are real, but I left them out of this PR. Before it, those textures were untracked and the barrier from the undefined layout sent nothing, which is also wrong (538 instead of 527), so this trades one error for another rather than adding one. Promotion and decay depend on when a list is submitted and on which queue, which a record kept in recording order cannot know; KDenKC's #3599 models decay at submission (Queued::apply with a decay rule), and #3558 removes the before-state for these moves altogether. Listed under Not tested.
| /// A legacy `ResourceBarrier` moves `res`'s subresource `sub` to `after`. A transition of all | ||
| /// subresources sets both planes; one of some sets the plane they are in (as a barrier group's | ||
| /// partial range does). No-op if the texture is not tracked. | ||
| pub(super) fn note_legacy_state(res: usize, sub: u32, after: u32) { |
There was a problem hiding this comment.
Not certain about this one: note_legacy_state reads with LAST.get and writes with LAST.insert, taking the shard lock twice, and it's no longer behind the COUNTS gate, so it now races with forget() and other recording threads. If thread A records a legacy transition and calls LAST.get, and thread B releases the texture so forget() removes the record, then A's insert puts back a record for a freed pointer. A texture later made at that address through a path that doesn't record (display target, reserved resource) inherits the stale state, and its first barrier sends a wrong before-state. Two threads on the same texture can also lose an update. An update-if-present under one shard lock would fix both.
There was a problem hiding this comment.
Right. note_legacy_state now uses a new Sharded::update, which changes the value only if it is there, under one shard lock, so a record forget removed is not put back and two updates of one texture cannot lose each other. an_update_changes_only_a_value_that_is_there tests the helper; the race itself has no test.
|
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any. |
0d61b2c to
7c10aff
Compare
|
@bmjask thank you for the review. All five findings checked against
Tested on AI use: findings checked and fixes written with Claude Code (Claude Opus 5.5), checked by me. |
|
Follow-up review (head 7c10aff, since 94c9514, diff read, not a merge-check):
New:
Fine: refused transitions are left out of the record and the legalized state is recorded (the compute-list case is tested); AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 7c10aff7: 5 finding(s) (3 high, 2 medium), most severe first.
Re-review at 7c10aff7. Display targets and reserved resources are now recorded, a partially moved plane becomes unknown instead of taking the subresource's state, and moves are recorded from the legalised word. That addresses the main points of my earlier review. The new deferred recording brings these:
- High
crates/xcl/src/hle/d3d12x/barrier_groups.rs:436: Barrier-group moves are now saved tomovesand written to LAST only after the whole call, buttransitions_of'slast()reads LAST in the middle of the call, so a later barrier on the same texture in the same ResourceBarrier call sta.... (inline) - High
crates/xcl/src/hle/d3d12x/barrier_groups.rs:462: If any one transition of a texture is refused, every move for that texture in the call is dropped, yet its other transitions in the same call are still kept byretain_mutand sent to the PC, so the record stays at the old state while t.... (inline) - High
crates/xcl/src/hle/d3d12x/barrier_groups.rs:320: A legacy transition of one subresource on a plane with more than one subresource always sets that plane to None (unknown), even when the title moves every subresource of the plane one at a time. (inline) - Medium
crates/xcl/src/hle/d3d12x/barrier_groups.rs:225: see below. - Medium
crates/xcl/src/hle/d3d12x/real.rs:4440: see below.
On lines outside the diff:
-
Medium
crates/xcl/src/hle/d3d12x/barrier_groups.rs:225: A barrier from UNDEFINED whose plane is unknown (None) sends nothing but still recordsSome(after), which breaks the rule that a partially moved plane stays unknown until a transition of all of it. After a legacy move of mip 1 only to COPY_DEST (plane 0 None, PC with mip 0 in COMMON and mip 1 in COPY_DEST), a barrier group UNDEFINED -> RT sends nothing and records RT. A following UNDEFINED -> SR then sends RT -> SR with ALL_SUBRESOURCES while the PC texture is in COMMON/COPY_DEST (527). Keeping the plane None when nothing was sent would fix it. -
Medium
crates/xcl/src/hle/d3d12x/real.rs:4440: Textures made through CreateCommittedResource2 and CreatePlacedResource1 (plaincreator!hooks, real.rs:4440 and 4610), and any other creation path that doesn't callnote_created, still aren't seeded, so #3489 remains for them. A render target made with CreateCommittedResource2 in COMMON whose first barrier group is UNDEFINED -> RENDER_TARGET has no record, nothing is sent, and it's drawn into in COMMON (538).
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| LAST.insert(res, cur); | ||
| }, | ||
| // recorded below, once the states are the ones the PC list gets | ||
| &mut |res, plane, state, stride| moves.push((res, plane, state, stride)), |
There was a problem hiding this comment.
High: Barrier-group moves are now saved to moves and written to LAST only after the whole call, but transitions_of's last() reads LAST in the middle of the call, so a later barrier on the same texture in the same ResourceBarrier call starts from the state before the call. With a texture recorded in COMMON and one call holding barrier A (RENDER_TARGET -> SHADER_RESOURCE, or UNDEFINED -> COPY_DEST) and then barrier B (UNDEFINED -> UNORDERED_ACCESS) on the same plane, B's prev is still COMMON. The word sent is COMMON -> UAV while the PC texture is in SHADER_RESOURCE/COPY_DEST after A, which is debug layer 527/538. The old code wrote LAST inside moved, and the test helper run still does, so the tests miss it. Keeping a per-call overlay that last() consults first would fix it.
| // whose transitions was refused (the PC's texture stays where it was) | ||
| for (res, plane, state, stride) in moves { | ||
| let Some(a) = asked.iter().find(|a| a.0 == res).map(|a| a.1) else { continue }; | ||
| if refused_res.contains(&res) { |
There was a problem hiding this comment.
High: If any one transition of a texture is refused, every move for that texture in the call is dropped, yet its other transitions in the same call are still kept by retain_mut and sent to the PC, so the record stays at the old state while the PC texture has moved. On a compute list, if barrier 1 moves T COMMON -> SHADER_RESOURCE (legal, sent, so the PC is now in 0x40) and barrier 2 moves T's other subresources to a render target (refused), T goes into refused_res and the record stays COMMON. The next barrier from UNDEFINED sends COMMON -> X while the PC is in 0x40 (527). Dropping only the refused transition's move would keep the record in step.
| let p = (sub / cur.plane_stride) as usize; | ||
| if p < 2 { | ||
| cur.states[p] = Some(after); | ||
| cur.states[p] = if cur.plane_stride == 1 { Some(after) } else { None }; |
There was a problem hiding this comment.
High: A legacy transition of one subresource on a plane with more than one subresource always sets that plane to None (unknown), even when the title moves every subresource of the plane one at a time. Before this PR the plane was set to after. In a mip-generation loop that moves mips 0..N-1 one by one to UNORDERED_ACCESS, never ALL_SUBRESOURCES, the plane stays None. The next barrier group UNDEFINED -> RENDER_TARGET then sends nothing (the old code sent UAV -> RT), and the title draws into a texture in UAV: error 538. Tracking which subresources moved, and restoring a known state once all of them share one, would cover it.
7c10aff to
b948e19
Compare
|
@Foniass thank you, the new one was right, and it came from my fix for bmjask's per-plane point.
Tested on AI use: checked and fixed with Claude Code (Claude Opus 5.5), checked by me. |
|
Follow-up review (head b948e19, since 7c10aff, diff read, not a merge-check):
New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of b948e19d: 1 finding(s) (1 high), most severe first.
Re-review at b948e19d. The points from my last review all look still open at this head: moves recorded only after the call (a later barrier in the same call starts from the old state, barrier_groups.rs ~456), one refused transition dropping every move of the texture (~482), a plane moved one subresource at a time staying unknown so the next UNDEFINED barrier sends nothing (~341, error 538), an UNDEFINED barrier on an unknown plane recording a state it never sent (~228), and CreateCommittedResource1/2 / CreatePlacedResource1 still not recorded (real.rs ~4439, ~4610). One new case:
- High
crates/xcl/src/hle/d3d12x/barrier_groups.rs:337:legacy_moved's whole-plane test requires every entry for the plane to have the final after state, rather than checking each subresource's last state, so two transitions of the same subresource in one call make the plane unknown even th.... (inline)
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| LAST.insert(res, cur); | ||
| for p in 0..2 { | ||
| let Some(&(_, last)) = some[p].last() else { continue }; | ||
| let mut subs: Vec<u32> = some[p].iter().map(|m| m.0).collect(); |
There was a problem hiding this comment.
High: legacy_moved's whole-plane test requires every entry for the plane to have the final after state, rather than checking each subresource's last state, so two transitions of the same subresource in one call make the plane unknown even though it ends wholly in one state. A 1-mip texture (plane_stride 1) given ResourceBarrier with sub 0 COMMON->COPY_DEST and then sub 0 COPY_DEST->SHADER_RESOURCE (or a BEGIN_ONLY/END_ONLY pair) in one call gets some[0] = [(0,COPY_DEST),(0,SHADER_RESOURCE)], all(m.1 == last) is false, and plane 0 becomes None. The next UNDEFINED->RENDER_TARGET then sends nothing and the texture stays in SHADER_RESOURCE (538). Keeping only each subresource's last state before the test would fix it.
There was a problem hiding this comment.
Right, fixed in 504f4e14: moves are applied in order per subresource (apply), so the last state of each subresource counts and a 1-level texture moved COMMON→COPY_DEST→SHADER_RESOURCE in one call ends in SHADER_RESOURCE (unit test each_subresource_keeps_its_own_state_until_a_plane_is_in_one_again). Details in the reply on the PR. (Claude Code, Claude Opus 5.5)
…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 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), at display targets made through the layout form of CreateCommittedResource, at reserved resources, and at the PC's own CreateCommittedResource1/2 and CreatePlacedResource1. 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. Release drops it. Buffers are not recorded. Each plane of the record is in one state, in a state per subresource when its subresources differ, or not known. Barrier groups and legacy transitions move it subresource by subresource, in order, and a plane whose subresources agree again is in one state again; so a plane moved one level at a time, or one subresource moved twice in a call, ends where the PC's texture is. A barrier from the undefined layout starts each subresource from its own state; one whose state is not known sends and records nothing. Within one call a barrier starts where the ones before it left the texture. The record holds what the PC list gets: the state after legal() and the depth UAV park; a move the PC would refuse, and the moves a refused transition stands for, are not recorded (on a compute list, SHADER_RESOURCE reaches the PC without PIXEL_SHADER_RESOURCE, and a render target move is refused). The transitions of one ResourceBarrier call are recorded together under one lock per texture (Sharded::update), so a record release removed is not put back. Fixes xcl-dev#3489. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b948e19 to
504f4e1
Compare
|
@bmjask @Foniass thank you both. I checked each point of bmjask's review of
@Foniass, as promised: the discard diagnostic is out of this PR ( Tested: AI use: checked and fixed with Claude Code (Claude Opus 5.5) while I was away; posted by it under my account with my standing approval for this session. |
|
Follow-up review of In short: Since
One new problem: a split barrier from the undefined layout now sends a begin half with no end half on a texture's first move. High
Medium
Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 504f4e14: 2 finding(s) (2 high), most severe first.
- High
crates/xcl/src/hle/d3d12x/barrier_groups.rs:276:applyleaves aPlane::Unknownplane unknown after a move of one of its subresources, even when the plane has only that subresource (stride == 1) or when the moves together cover the whole plane, whereas the old code recorded a per-pl.... (inline) - High
crates/xcl/src/hle/d3d12x/barrier_groups.rs:486: The refused-move filter removes every move in the call for the same texture and subresource, plus any ALL move of that texture (r.1 == ALL || m.1 == ALL), including moves from earlier barriers whose words were sent to the PC. (inline)
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| let Some(plane) = cur.planes.get_mut((sub / stride) as usize) else { continue }; | ||
| let i = (sub % stride) as usize; | ||
| match plane { | ||
| Plane::Unknown => {} |
There was a problem hiding this comment.
High: apply leaves a Plane::Unknown plane unknown after a move of one of its subresources, even when the plane has only that subresource (stride == 1) or when the moves together cover the whole plane, whereas the old code recorded a per-plane state from any explicit move. Take a D24S8 depth buffer with no note_created record (e.g. made through dev_create_committed_resource_x with pc_full == None, or any creation path this PR doesn't hook) that the title moves per plane, DEPTH_WRITE->SHADER_RESOURCE on plane 0 and then plane 1. subresources() returns Some([0]) and Some([1]), and moved reaches apply, but the Plane::Unknown => {} arm does nothing. Every later barrier from UNDEFINED on that texture then sends no transition, so it stays SHADER_RESOURCE on the PC while the title writes depth to it (debug layer 538/527). On main this worked. Setting Plane::All(after) for stride 1, and turning Unknown into All once every subresource has been moved, would restore it.
| // a refused transition leaves the PC's subresources where they were: its moves are not recorded | ||
| if !refused_at.is_empty() { | ||
| const ALL: u32 = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES; | ||
| moves.retain(|m| !refused_at.iter().any(|r| r.0 == m.0 && (r.1 == m.1 || r.1 == ALL || m.1 == ALL))); |
There was a problem hiding this comment.
High: The refused-move filter removes every move in the call for the same texture and subresource, plus any ALL move of that texture (r.1 == ALL || m.1 == ALL), including moves from earlier barriers whose words were sent to the PC. If one Barrier call holds UNDEFINED->RENDER_TARGET on ALL (sent) and then a barrier on the same texture with an out-of-range subresource or a state the PC refuses, refused_at holds (res, sub) and the m.1 == ALL clause drops the first, legitimately sent move. For a texture with no record yet, nothing is recorded, and the follow-up note_legacy_states uses update, which creates nothing. The PC texture is in RENDER_TARGET with no record of it, so the next barrier from UNDEFINED sends nothing (538 on draw). Removing only the moves that the refused word itself stands for (by barrier index, not by (res, sub)) would fix it.
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 with the PC state it was made in, and a barrier from the undefined layout starts each subresource 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 / #3599); that series needs each texture's creation state for its first move, which this record gives.
What is in it (one commit, on
mainc53e9696)crates/xcl/src/hle/d3d12x/barrier_groups.rs:LASTis the one record per texture. Each of its two planes (colour or depth, stencil) isAll(state),Each([state per subresource])when the plane's subresources differ, orUnknown;applymoves it, in order, and makes a planeAllagain when its subresources agree.note_createdseeds 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.Barriercall, a barrier starts where the barriers before it in the call left the texture.legal()and the depth UAV park (pc_state). A move the PC would refuse is not recorded, and neither are the moves a refused transition stands for (same texture and subresource); the texture's other moves are.ResourceBarriercall (the title's own, and the ones made of a barrier group) are recorded together (note_legacy_states), under one lock per texture, so a recordforgetremoved on release is not put back.device_x.rs,real.rs:note_createdat the creation points that calldepth_uav::note_created, theCreatePlacedResourcethe PC accepts on the first try, display targets made through the layout form ofCreateCommittedResource(Runtime: CPU check at start, bounded reads in the exception logger, t… #127),CreateReservedResource/CreateReservedResource1, andCreateCommittedResource1/2andCreatePlacedResource1(creator!, from their initial-state argument).list_x.rs:resource_barrier_xhands a call's transitions tonote_legacy_statestogether.sharded.rs:Sharded::update, a change of a value that is there, under its part's lock (nothing is made when there is none).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, depth then stencil, release and reuse of the pointer, a compute list's legal state recorded and a refused move not, a 2-level D24S8 depth plane moved by a group one word per level, a legacy move of one level followed by a group that moves each level from where it is, and a group with one level's move refused and the other's sent),each_subresource_keeps_its_own_state_until_a_plane_is_in_one_again,a_barrier_starts_where_the_one_before_it_in_the_same_call_left_the_texture,an_update_changes_only_a_value_that_is_there, and the updateda_new_texture_leaves_the_undefined_layout_from_the_state_it_was_made_inandthe_undefined_layout_moves_nothing_and_is_left_from_where_the_texture_was.The diff is +442/-142, about half of it tests; the record and its tests are one change.
Tested
NVIDIA GeForce RTX 3090 24 GB (driver 621.40), Intel Core i5-13600K, 32 GB, Windows 11 build 26300, Rust 1.100.1; debug for the suite, release for the title runs.
cargo test --workspace --no-fail-fast -- --test-threads=4one671f910(the same tree as the head504f4e14, which only rewords the commit message), with Windows' own D3D12 (XCL_D3D12_DIRset to an empty folder, see below): 3009 passed, 0 failed, 52 ignored; SKIPPED: 26 (22 no wave64 on this 32-lane GPU, 2 no xgameruntime.dll, 2 no heap windows).cargo test -p xcl --lib barrier_groups: 12 passed.With the Agility SDK 1.620 in
%LOCALAPPDATA%\XCL\D3D12, the lib test binary did not finish on this machine on the earlier base0d61b2c2either (the Tests: on an AMD RDNA2 iGPU the xcl lib test binary stops itself partway ("sparse upload preparation still failed after bounded retries") since #2959 #3488 stop, "sparse upload preparation still failed after bounded retries"); not caused by this PR.Debug-layer runs of the retail title (on the earlier head
b948e19dandmain493dbd3d, 300 s, Agility SDK 1.620, same input script; XCL logs the first 8 messages of each id).mainended at 121 s with an access violation ind3d12.dllunder the debug layer, so the table compares the first 121 s:main493dbd3b948e19dThe
b948e19drun went on to 300 s and, after the loading screens, logged six more 538s thatmaindid not reach. Not rerun on this head.Regression run
main:
this PR:
Not tested
504f4e14); the table above is fromb948e19d.smoke.ps1sends no input); the title uses barrier groups there already.ResourceBarriercall, oneGetDescand insert per texture made, a small array for a plane whose subresources differ) beyond the smoke run.CreateCommittedResource1/2,CreatePlacedResource1): those paths need the title or are the PC's own methods; the WARP test callsnote_createddirectly.AI use
b948e19dand this update were made and posted by Claude Code while I was away, under the standing approval I gave it for this session.🤖 Generated with Claude Code