shader: lower indexed gfx1030 raw subword stores #1281
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1288"
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 R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T06:50:09Z.
Change
Lower the gfx1030 raw MUBUF
buffer_store_byte,buffer_store_short,buffer_store_byte_d16_hi, andbuffer_store_short_d16_hiforms in the compute store profile. Write the low or high-half source field into a naturally aligned byte or halfword atidxenwith zero scalar offset. The UAV descriptor must be ready, and each invocation must own an in-range, DWORD-aligned record in the caller-bound raw UAV.The generated DXIL preserves neighboring bytes with a full-DWORD read/modify/write. The existing address-layout and overlap checks give each containing DWORD one writer. The translator rejects another write to that DWORD, including a disjoint byte write. The binding requires initialized, unswizzled records and exclusive access during dispatch. Concurrent shared-word updates, native descriptor bounds and other address modes are outside the supported subset.
This extends the raw MUBUF compute store fixtures after #1254. The load follow-up in #1282 is independent. Both landing orders were simulated on
02f2f3dcd83ed0b2a202a5f72b92589af06aa021and produced tree146a096ab732d3d3645d232b9e2eca5e3dac436c. Before publication both landing orders again produced the same tree on current main3212a9c24fd05e263bf7c4e28f0ab84b6dc6d4d0(5e3edea61f32d8d712ecfb590c9628d56d4d9901). The earlier combined shader sources also passed both new fixture modes on WARP and the physical GPU.Verification
Tested clean head
06e764bfd90a0db86fbc8a3df7486f81cc20b752.36 passed, 0 failed, 0 skipped. Both
compute_store_aot_mubuf_store_subword_{hardware,warp}fixtures recorded all four gfx1030 forms. Windows build 26300.9974, Intel Arc B390 (32.0.101.8509) and Microsoft Basic Render Driver/WARP (10.0.26100.9818). The debug layer was unavailable on both backends. Each program compared all 320 DWORDs against a CPU byte-slice reference for one and three groups, including adjacent bytes, records and the untouched tail. Forbuffer_store_byte, selecting the other VGPR half or overwriting the containing DWORD first differed at word 1 (c5c578c5expected,c5c534c5and12345678actual). Rejection controls cover same-DWORD overlap, non-separating addresses, record overruns, misaligned shorts and missing descriptor waits.Passed on Ubuntu 22.04.5 with LLVM 15.0.7. The check assembles all four wave32 fixtures and verifies that the synthetic container CLI and direct lowering emit the same HLSL. The GPU tests execute the translated desktop DXIL. Markdown links and coverage self-tests also passed.
The original synthetic fixtures use the repository's MIT License. The AMD RDNA 2 Shader ISA documents MUBUF opcodes 24 through 27.
This change was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:05:53Z.
Review: COMMENTED
Dual-platform review at commit
06e764bfd90a0db86fbc8a3df7486f81cc20b752(note: PR was merged during the Windows verification run):Linux checks
git diff --check origin/main...HEAD: passedpython -B tests/docs_links_check.py: passed (16 Markdown files, 287 links)python -B tests/bidi_controls_check.py: passed (1076 tracked files)LLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so python -B tests/compute_store_check.py binary /usr/bin/llvm-mc-19 /usr/bin/llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed (exit 0)Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)
--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6:2.80sctest --preset dev -R '^compute_store_aot_mubuf_store_subword_' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (compute_store_aot_mubuf_store_subword_warp,compute_store_aot_mubuf_store_subword_hardware)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6:0.35sctest --preset release -R '^compute_store_aot_mubuf_store_subword_' --parallel 4 --no-tests=error --output-on-failure: 2/2 passedNotes & Edge Cases
tools/compute_store_aot.pycleanly reserves the full containing DWORD (offset &= ~3,written_spans.append((offset, offset + 4))) and masks/shifts the selected byte or halfword from bit 0 or bit 16.docs/experiments.mdspecifies a DWORD-aligned record, andoffset + 4 * count <= stridechecks record bounds, butstride % 4 == 0is not explicitly enforced inlower()forsubword(unlikeByteAddressBuffer.Load/Storewhich require 4-byte-aligned addresses and would otherwise collide across adjacent records ifstridewere e.g.6).