D3D12.X: give the queue-specific barrier layouts their resource states #833
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/839"
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 ivall/xcl. Originally posted by mastrr9 on 2026-11-24T06:39:44Z.
Extends
device_x::layout_state()(used byCreateCommittedResource#127 andCreatePlacedResourceX#133 when creating resources with aD3D12_BARRIER_LAYOUT) to mapSHADING_RATE_SOURCE(11) and allDIRECT_QUEUE_*/COMPUTE_QUEUE_*layouts (18–29) to their legacyD3D12_RESOURCE_STATESequivalents instead of falling back toCOMMON.COMPUTE_QUEUE_SHADER_RESOURCE(27) toNON_PIXEL_SHADER_RESOURCE(0x40),DIRECT_QUEUE_SHADER_RESOURCE(21) toALL_SHADER_RESOURCE(0xC0),SHADING_RATE_SOURCE(11) to0x100_0000, and the remaining direct/compute queue layouts (GENERIC_READ,UNORDERED_ACCESS,COPY_SOURCE,COPY_DEST) to their corresponding states.barrier_layouts_become_resource_statesverifying every layout constant by name against thewindowscrate definitions.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC debug, DXC Windows SDK10.0.26100.0,d3d12SDKLayers.dllinstalledba90058f7c5017469e2acd411aa0dd61ae6fc343cargo build --workspace: clean (only pre-existingfetch_updatedeprecation warning)cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored (new testhle::d3d12x::device_x::tests::barrier_layouts_become_resource_statespassed)SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Regression run
Smoke run by @CuteBooty in comment below: https://github.com/xcl-dev/xcl/pull/839#issuecomment-7142450572
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.
main:
PR:
Tester's setup: RTX 3070 8 GB (32-lane waves), NVIDIA 621.24; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build.
Tester's method:
scripts\smoke.ps1 -Game <folder> -Seconds 60, no input, on this PR's head as it is and onmainbeaa245, the commit it branches from, each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. Themainblock is shared with the tester's reports on other PRs of the same base.Tester's AI use: Claude Code (Claude Opus 5.5) made the runs with the tester present and wrote the report from the script's output.
Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T07:06:19Z.
Full-suite run, since this PR has no test report yet. Tested exact head
ba90058(on its basebeaa245).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.barrier_layouts_become_resource_states.Not tested
AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T07:17:50Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
ba90058onto maina1672ef, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 709 passed, 7 failed, 41 ignored. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Queue-specific barrier layout tests green; no new failures.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by CuteBooty on 2026-11-24T19:41:22Z.
Regression run on a retail title for
b904fda: pass (no device removal, no crash, frames and peak commit within the check's limits).Tested
scripts\smoke.ps1 -Game <folder> -Seconds 60, no input, on this PR's head as it is and onmainbeaa245, the commit it branches from, each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. Themainblock is shared with my reports on other PRs of the same base.main:
this PR:
Not tested
mainmerged in, AMD and Intel GPUs.AI use
upstream-sync referenced this pull request2026-11-24 21:29:08 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:57:24Z.
Empirical test report (
b904fda4)Verified PR #839 at commit
b904fda4535b225f2feabe62fd41cbc68d489680.Hardware / environment
1.100.0 (0ef1bc386 2026-11-09). DXC1.9.2609.5 (01b62ad47).XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1, outside the Arc test wrapper.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables. The compiler emitted a deprecation warning forAtomicU32::fetch_updatein XGameRuntime.cargo test -p xcl --lib hle::d3d12x::device_x::tests::barrier_layouts_become_resource_states -- --exactexited 0. The fixture log recorded 1 passed, 0 failed, 0 ignored, 0SKIPPEDlines, and 693 filtered out.Observed behavior
The fixture called
layout_statedirectly and all assertions against D3D12 resource state constants passed. Direct-queue shader resources mapped to all shader stages and compute-queue shader resources mapped to non-pixel shader access. Both queues' generic-read, unordered-access, copy-source and copy-destination layouts mapped to their corresponding legacy states. The shading-rate-source layout mapped to its dedicated state. Undefined and the queue-common cases covered by the fixture mapped toCOMMON. The fixture requires no D3D12 device.Not tested
The full GPU workspace suite and game smoke runs were omitted. The focused run exercised the translation function only. Resource creation and runtime barrier behavior on a D3D12 device remain unverified.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr839-focused.logand published.upstream-sync referenced this pull request2026-11-25 11:07:09 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:27:49Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:40:53Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:16:43Z.
Triage (#1607) – head
b904fdaOverlap: #3238 also extends
device_x.rs:layout_statewith the DIRECT_QUEUE_/COMPUTE_QUEUE_ layouts (18-29) and shading rate (11), and in addition maps the video layouts and strips console modifier bits. The two differ on COMPUTE_QUEUE_SHADER_RESOURCE (27): this PR gives NON_PIXEL_SHADER_RESOURCE (0x40), #3238 gives all-shader 0xC0; 0x40 is the state a compute queue accepts. Nothing of this is on main (main'sbarrier_groups::state_ofhas its own mapping).The test checks every value against the
windowscrate constants. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.