shader: pack sparse gfx1030 image load masks #1303
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1310"
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-24T07:30:06Z.
Scope
Extend the gfx1030 compute translator from the four prefix DMASKs to all 15 nonzero XYZW masks for typed 2D
image_loadandimage_load_mip. Bits select channels in XYZW order, and the selected values are packed into consecutive destination VGPRs. Fordmask:0xathe two destination VGPRs receive Y and W. The existing 32-bit anda16address forms,R32G32B32A32_UINTcontract, waits and binding rules apply. Zero, out-of-range bits and a destination tuple whose width disagrees with the mask are rejected. This follows #1265.Validation
Tested
2d60414d4de6c0ec3455278d26ab2a54714e6009on Windows 11 build 26300.9974. The adapters were Intel Arc B390 with driver 32.0.101.8509 and WARP (Microsoft Basic Render Driver) with driver 10.0.26100.9818. Both reporteddebug_layer=unavailable.CTest reported 45 passed, 0 failed and 0 skipped. Each backend executed 60 image cases, covering both opcodes, both address families and all 15 masks. Each case compared all 320 UAV words, including untouched words, with a CPU reference. Replacing Y and W with X and Y for
dmask:0xafirst differed atword=0 expected=20000001 actual=10000000for both opcodes and both address families on both backends. The JUnit-backed coverage records retain two of 111 gfx1030 MIMG mnemonics. The additional masks are variants of those two mnemonics.LLVM 15 assembled and decoded all 60 image cases. The synthetic container CLI emitted the same HLSL as direct text lowering. The coverage and documentation checks passed.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:42:32Z.
Review: COMMENTED
Reviewed at commit
2d60414d4de6c0ec3455278d26ab2a54714e6009.Code Review
tools/compute_store_aot.py: replaces the contiguousdmask != (1 << count) - 1restriction with0 < dmask < (1 << IMAGE_FORMATS[image_format][1])and packs enabledxyzwchannels in ascending order (channels = [component for index, component in enumerate("xyzw") if dmask & (1 << index)]) into consecutive destination VGPRs (first + index). Zero masks and out-of-range bits (0x10) remain rejected, andlast != first + count - 1still enforces tuple width matching.tests/compute_store_check.py:MIMG_CHANNELSindependently enumerates all 15 nonzero masks (0x1..0xf), coveringimage_loadandimage_load_mipwith both 2-dword anda16addresses, plus negative controls (dmask:0x0,dmask:0x10, and mutatingdmask:0xafromywtoxy).README.md&docs/experiments.md: updated cleanly and accurately.Verification
2d60414d):git diff --check origin/main...HEAD: pass/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: pass (16 Markdown files, 289 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: pass (1086 files)LLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so /root/.local/share/x2w-rev-venv/bin/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: pass--target offscreen_check):--preset dev):ctest --preset dev -R '^compute_store_aot_mimg_.*_warp$' --parallel 4 --no-tests=error --output-on-failure— 2/2 passed (compute_store_aot_mimg_load_warp,compute_store_aot_mimg_mip_warp)/O2(--preset release):ctest --preset release -R '^compute_store_aot_mimg_.*_warp$' --parallel 4 --no-tests=error --output-on-failure— 2/2 passed (compute_store_aot_mimg_load_warp,compute_store_aot_mimg_mip_warp)