d3d12-gpu: record enhanced barriers as the legacy ones they stand for #2906
Closed
aznohonza wants to merge 5 commits from
upstream-pr/2906 into main
pull from: upstream-pr/2906
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
ProjectLeonida/mandy!2906
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2906"
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?
Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T17:12:10Z.
replay/record.rslistedID3D12GraphicsCommandList7::Barrieras not recorded, so a stream that used enhanced barriers lost those ordering points when it was replayed. This hooks the method and records each group as the legacy barriers the runtime itself uses for the same wait:play::wait_for_allfalls back to on a device without enhanced barriers.D3D12_RESOURCE_STATESits layouts stand for (layout_state), with the subresource the range names when it names one. A same-state barrier becomes the UAV barrier it stands for, or nothing at all: a real device rejects a transition to the state it is already in (E_INVALIDARG).The wire already carries
Cmd::Barriers, and playback already issues those legacy barriers, so nothing changes inplay.rsorwire.rs. The enhanced sync/access masks order the same accesses with less; the recorded legacy barriers are the same waits, never fewer.One stated shortcut: a texture range naming more than one subresource is recorded as the whole resource, since a legacy transition carries one subresource. That is conservative; a title that keeps two subresources of one texture in different layouts at once would need the wire extended. The code says so where it happens.
Verification:
layout_statecovers every layout and both queue-specific forms;enhanced_records_its_texture_and_buffer_barriersdrivesenhanced()itself with texture and buffer groups,same_state_texture_barriers_are_a_wait_or_nothingcovers the same-state forms, andone_subresource_ranges_flatten_to_that_subresourcethe range forms.The workspace also checks with the default features (
cargo xwin check --target x86_64-pc-windows-msvc --workspace --all-targets --locked). Replay is behind thediagnosticsfeature, so that unit test runs withcargo test -p leonida-gpu --features diagnostics --lib; there is no D3D12 device on this Linux host, so the recorded-and-replayed path itself is compile/read-verified here and exercised by the crate's device tests on Windows. No game data, no new switch.Claimed in #2570 (RS-RECORD-ENHANCED-BARRIERS). AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-01T17:30:34Z.
Checked on native Windows 11 with a real D3D12 device (rustc 1.98.1, MSVC target), since the run in the description is under Wine.
Head
e18eeaf6emerged withmaind2a564b66(clean merge):cargo test -p leonida-gpu --features diagnostics --lib replay::: 25 passed, 0 failed.enhanced_layouts_record_as_the_states_they_stand_forpasses.21 => 6changed to21 => 1(direct-queue shader resource mapped as generic read), it fails withleft: 2755, right: 192.One case that would break playback: a texture barrier whose two layouts map to the same state.
Enhanced barriers often keep the layout and change only sync/access. Two UAV dispatches on one texture are the usual case:
LayoutBefore == LayoutAfter == UNORDERED_ACCESS. Other pairs map to the same state too:UNDEFINED -> COMMON(both0) andDIRECT_QUEUE_SHADER_RESOURCE -> SHADER_RESOURCE(both0xC0).enhanced()records each of these asBarrier::Transitionwithbefore == after, and playback issues it throughgpu::transition.I issued that legacy barrier on a real device: a 64x64 RGBA8 texture, then one
ResourceBarriertransition andClose().Close()OkE_INVALIDARGResourceBarrier: Before and after states must be different.E_INVALIDARGE_INVALIDARGE_INVALIDARGSo the replayed list fails to close even without the debug layer.
edit.rsjoinonly folds a transition into an earlier one on the same resource; a lone same-state transition goes through unchanged.A possible fix: when
layout_state(before) == layout_state(after), record no transition, and recordBarrier::Uav { res }when the layout isUNORDERED_ACCESS(the wait the barrier stands for). That matches whatjoinalready does when two transitions cancel out onUNORDERED_ACCESS. A test that runsenhanced()on a UAV -> UAV texture group would cover it.Context: on
mainI found no host code that callsBarrier/ setsLayoutBefore, so this only matters once a recorded stream contains enhanced barriers. That is the case this pull request is for, though.Not checked: a full record/replay round trip, and the game.
GPUs tested: the default hardware adapter (device-level
ResourceBarrier/Closecheck only).AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T17:44:27Z.
Recorder check for equivalent single-subresource barriers at
e18eeaf6e+d2a564b66(Win64, Wine 11.22 / VKD3D-Proton 3.1.0). The 25 existingreplay::tests passed in both adapter configurations.A separate test calls
ID3D12GraphicsCommandList7::Barrier, closes the list and decodes the captured commands. The synthetic RGBA8 texture has two mips and two array slices. It specifies mip 1, slice 1, plane 0 in two equivalent ways. WithNumMipLevels = 0, the flattened index 3 records transition subresource 3. With all three counts set to 1, the explicit range records0xffffffff(all subresources). Main emits no recorded barrier in either case. The results match on AMD Radeon (RADV 26.3.1) and GeForce RTX 4070 SUPER (620.73.4 as reported by Wine).NumMipLevels > 0selects the range form even when that range contains only one subresource. A local trial flattened the 1×1×1 range using the texture descriptor and recorded subresource 3 in both forms on both adapters. The test checks the captured commands before queue submission.MEASURED with a synthetic texture. AI-assisted (Codex). D3D12 subresource-range documentation
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T17:52:58Z.
Review: CHANGES_REQUESTED
Blocking: the texture path records a transition even when both layouts stand for the same state, and D3D12 rejects that at
Close().layout_statecollapses UAV→UAV to0x8→0x8, UNDEFINED→COMMON to0x0→0x0, and DIRECT/QUEUE SHADER_RESOURCE→SHADER_RESOURCE to0xC0→0xC0(record.rs:2359-2365), andenhanced()emits aTransitionunconditionally (:2420-2431). On a 4070 Ti SUPER I getE_INVALIDARG (0x80070057)for0x8→0x8,0x4→0x4,0x0→0x0and0xC0→0xC0, with and without the debug layer (debug says "Before and after states must be different"), while the enhanced COMMON→UAV / UAV→UAV pair closes Ok and a control0x8→0xC0is fine.play.rs'sclosepropagates the error (:2402-2414, "a list of the frame could not be recorded again"), so one such barrier aborts the whole frame's replay. Before this PR the call was merely skipped (noted_entry,hook.rs:231) and the capture still replayed — so this regresses the UAV→UAV case the PR exists for.edit::joinonly folds a pair of matching transitions (edit.rs:126-155), so a lone same-state barrier survives, andmerge_barriersis off by default anyway.Fix: emit no transition when
before == after, plusBarrier::Uavwhen the layout is UAV. And testenhanced()itself — replacingafter: layout_state(b.LayoutAfter)withb.LayoutBeforestill passes all 25replay::tests, which is exactly why CI cannot see this.Second, smaller issue: a buffer barrier becomes a UAV barrier even when its access masks are copy/vertex/index/…, and a legacy UAV barrier only orders UAV accesses — so "never fewer" does not hold there. A global alias+UAV flush would be the conservative legacy stand-in.
Minor:
from_raw_parts(ptr, 0)per group (:2403,:2418,:2436) is UB ifNumBarriers == 0with a null pointer; the new test only assertslayout_statevalues (no PRESENT/SHADING_RATE_SOURCE/video); and the "tested viacargo test --test replay" claim does not exerciseenhanced()at all —tests/replay.rsbuilds frames directly.The GLOBAL mapping is right:
Alias(NONE,NONE)+Uav(NONE)matches the non-enhanced fallback inwait_for_all(play.rs:2342-2370,:3392,:3376). Merge is clean against current main, and no other open PR touchesreplay/record.rs.Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T18:18:56Z.
Thanks for the device check — you were right, and that exact case is fixed in
33d9b4f61(merged withmain7fbdf8511).When
layout_state(before) == layout_state(after),enhanced()now recordsBarrier::Uav { flags: 0, res }if the state isUNORDERED_ACCESS, and records nothing otherwise. A UAV -> UAV texture group is covered bysame_state_texture_barriers_are_a_wait_or_nothing, which also checks UNDEFINED -> COMMON and DIRECT_QUEUE_SHADER_RESOURCE -> SHADER_RESOURCE record nothing. The existing test runs under Wine here; the new one passes too.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T18:18:57Z.
Thanks for the captured-command check — you were right about the range form, and it is fixed in
33d9b4f61(merged withmain7fbdf8511).With
NumMipLevels > 0andNumMipLevels == NumArraySlices == NumPlanes == 1, the range now flattens tofirst_mip + first_layer * MipLevels + first_plane * MipLevels * ArraySizeusing the resource's own descriptor (array size is 1 for 3D textures). Any wider range is still recorded as the whole resource, and the index form (NumMipLevels == 0) is unchanged.one_subresource_ranges_flatten_to_that_subresourcecovers mip 1 of slice 1, plane 1 of slice 1, 2 mips, the index form including0xffffffff, and a 3D texture; it passes here under Wine.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T18:27:21Z.
Follow-up device check for both texture-barrier fixes at
33d9b4f6onmain7fbdf851(Win64, Wine 11.22 / VKD3D-Proton 3.1.0). I reran the recorder comparison on AMD Radeon (RADV 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.4 as reported by Wine).Barrier::Uavwith flags 0. A separate list containing the equivalent native legacyD3D12_RESOURCE_BARRIER_TYPE_UAVclosed successfully on both adapters.maincontrol recorded no barriers for the three inputs. The updated PR passed all 27 stockreplay::tests in each adapter configuration, including both new targeted cases.MEASURED with a synthetic texture. The scope was captured commands and command-list closure before queue submission. AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T18:29:59Z.
Review: COMMENTED
Re-checked at
33d9b4f61(merged withmain7fbdf8511; merge-tree clean). The blocker is fixed: on a real 4070 Ti SUPER,enhanced()now recordsUavfor UAV→UAV and nothing for UNDEFINED→COMMON, DIRECT_QUEUE_SHADER_RESOURCE→SHADER_RESOURCE and RT→RT, and all fourClose()calls returnS_OK. A forced0x8→0x8control still returnsE_INVALIDARG, so the probe can still see the original defect.replay::is 27/0, and deleting thebefore == afterbranch now failssame_state_texture_barriers_are_a_wait_or_nothing— good red/green.Two from the review remain, neither the original blocker:
Uav(record.rs:2480-2489). I drove aCOPY_DEST→COPY_SOURCEbuffer barrier through the same path and it records[Uav { res }], which orders nothing for that transition. Either special-case onlyAccessAfter == UAVand use a global alias+UAV pair otherwise, or document that buffer barriers are assumed UAV-adjacent.enhanced()itself is still untested: swappinglayout_state(b.LayoutAfter)forLayoutBeforeatrecord.rs:2473leaves all 27replay::tests green — the same mutation as before. The new tests covertexture_barrier(), not its call site. A test that builds aD3D12_BARRIER_GROUPand asserts the returnedVec<Barrier>would close both this and the buffer case.Minor, unchanged:
std::slice::from_raw_parts(ptr, 0)with a null pointer for aNumBarriers == 0group (:2450,:2465,:2482).Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T18:44:01Z.
Both points addressed in
ba1828afe(merged withmain60f7dcd90):Uavonly whenAccessAfterisUNORDERED_ACCESS; every other access records the global alias + UAV pair thatwait_for_alluses, soCOPY_DEST -> COPY_SOURCEorders everything instead of nothing. The condition is stated inenhanced()'s comment.enhanced_records_its_texture_and_buffer_barriersbuilds realD3D12_BARRIER_GROUPs against a registered test resource and asserts the returnedVec<Barrier>: a UAV -> SRV texture at mip 1 of slice 1, a UAV -> UAV texture, and buffer barriers with and without a UAV access after. SwappingLayoutAfterforLayoutBeforeat the call site now fails that test.from_raw_partswith a possibly null array.The six
replay::record::testspass here under Wine; CI is re-running.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T18:53:03Z.
Buffer-barrier follow-up on the updated recorder at
ba1828afagainst33d9b4f6, both onmain60f7dcd9. I recordedID3D12GraphicsCommandList7::Barrieragainst a synthetic default buffer, closed the lists and decoded their commands on Radeon (RADV 26.3.1) and RTX 4070 SUPER (620.73.4 as reported by Wine).replay::selection now passes 28 tests per adapter setting, including the new recorder test.MEASURED with a synthetic buffer under Win64 Wine 11.22 / VKD3D-Proton 3.1.0. Scope is recording and list closure before queue submission. AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-12-01T19:14:38Z.
Thanks for checking both buffer forms on both adapters — that is the intended split: a bare UAV barrier only when the access after is UAV, the global alias + UAV pair otherwise. Good to know the stock
replay::selection is 28/28 on each.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T19:48:52Z.
Review: COMMENTED
Re-checked at
ba1828afe(merge-tree with current mainab374c7d5is clean). Both re-review points are fixed on native Windows (4070 Ti SUPER):COPY_DEST→COPY_SOURCEnow recordsAlias{NONE,NONE}+Uav{NONE}(and the list closesS_OK), whileUAV→UAVstill records one resource-specificUav(record.rs:2489). The old head recorded a single resourceUavfor the copy case — alsoS_OK, which is why the HRESULT alone could not show the defect; the recorded set now does.enhanced_records_its_texture_and_buffer_barriers(:3106) fails on theLayoutAfter→LayoutBeforemutation ([Uav]vs[Transition 0x8→0xC0]), andreplay::is 28/28 after reverting. That was the last unguarded wiring.from_raw_partsentirely (:2447-2449), so the null-pointer case is gone.Non-blocking, narrow: a buffer barrier with
AccessBefore = COPY_DESTandAccessAfter = UNORDERED_ACCESSstill takes the bare-Uavbranch, and a legacy UAV barrier orders UAV accesses only — not the copy. If that pair occurs in practice, it needs the global alias+UAV pair too.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T21:40:22Z.
Independent check of
ba1828afemerged cleanly onmain(1e3e316c5), on native Windows 10 Pro 22H2 (build 19045) + NVIDIA GeForce RTX 5070 12 GB (driver621.40, Ryzen 9 5950X):cargo test --locked -p leonida-gpu --features diagnostics --lib replay:: -- --nocapture: 28 passed, 0 failed, 0 ignored (including all four new enhanced-barrier tests:one_subresource_ranges_flatten_to_that_subresource,enhanced_layouts_record_as_the_states_they_stand_for,same_state_texture_barriers_are_a_wait_or_nothing, andenhanced_records_its_texture_and_buffer_barriers).replay/record.rs.AI-assisted: Antigravity
Pull request closed