shader: lower gfx1030 formatted UINT buffer stores #1326

Merged
stan495 merged 1 commit from upstream-pr/1333 into main 2026-11-24 08:35:35 +00:00
stan495 commented 2026-11-24 08:25:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T08:25:39Z.


Summary

  • Lower indexed gfx1030 buffer_store_format_x, _xy, _xyz, and _xyzw to consecutive DWORD writes in the raw u0 binding. --output-format declares the corresponding one- to four-channel 32-bit UINT descriptor with identity selectors. The opcode must write the entire declared texel.
  • Reuse the compute store profile's descriptor and VGPR wait tracking, checked per-invocation addressing, record bounds, and overlap checks. The profile requires idxen and zero scalar offset. See the experiment for the caller's view and descriptor constraints.
  • Exercise each form through LLVM 15 assembly, disassembly, and the compute-container CLI. Dispatch the equivalent translated desktop DXIL for one and two groups and compare all 320 output words, including padding and the untouched tail, against the CPU reference.

This follows the descriptor-format contract introduced for reads in #1297, which is already merged. The ISA reference is the AMD RDNA 2 Shader ISA, §8.1.4 and MUBUF opcodes 4–7.

Validation

Commit tested: 23ff04e2f0af14a4326098e11c74625d05de854a.

cmake --preset dev
cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^compute_store_aot_' -V --output-junit "$PWD/out/compute-store-junit.xml"
python -B tools/form_coverage.py out/compute-store-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/compute-store-coverage.json
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py
  • 44 passed, 0 failed, 0 capability skips. The two compute_store_aot_mubuf_store_format_* fixtures register all four mnemonics as passing in the same CTest run. The selected run records 29 of 73 gfx1030 MUBUF forms. The coverage and documentation checks pass.
  • Windows build 26300.9974. WARP on Microsoft Basic Render Driver (10.0.26100.9818) and hardware on Intel Arc B390 (32.0.101.8509). The debug layer was unavailable on both. GPU comparisons cover translated DXIL.
  • Both adapters report first differences of word 0, expected c5c5c5c5, actual 89abcdef for the shifted x store, and word 1, expected 89abcdef, actual 01234567, dcbafed0, and 76543210 for the xy, xyz, and xyzw channel swaps respectively. Negative cases also require the expected rejection for a missing descriptor wait, pending data, a format-width mismatch, a record overrun, and overlapping stores.
python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

Passed on Ubuntu 22.04.5 with LLVM 15.0.7. This checks gfx1030 encoding and container translation.

git diff --check passed. git merge-tree --write-tree refs/remotes/origin/main HEAD succeeded against 0f09ca936fe73399d8ffc8ec5e99541d6799ba1a.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6577678112 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1333). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T08:25:39Z. --- ## Summary - Lower indexed gfx1030 `buffer_store_format_x`, `_xy`, `_xyz`, and `_xyzw` to consecutive DWORD writes in the raw `u0` binding. `--output-format` declares the corresponding one- to four-channel 32-bit UINT descriptor with identity selectors. The opcode must write the entire declared texel. - Reuse the compute store profile's descriptor and VGPR wait tracking, checked per-invocation addressing, record bounds, and overlap checks. The profile requires `idxen` and zero scalar offset. See the experiment for the caller's view and descriptor constraints. - Exercise each form through LLVM 15 assembly, disassembly, and the compute-container CLI. Dispatch the equivalent translated desktop DXIL for one and two groups and compare all 320 output words, including padding and the untouched tail, against the CPU reference. This follows the descriptor-format contract introduced for reads in #1297, which is already merged. The ISA reference is the AMD RDNA 2 Shader ISA, §8.1.4 and MUBUF opcodes 4–7. ## Validation Commit tested: `23ff04e2f0af14a4326098e11c74625d05de854a`. ```powershell cmake --preset dev cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^compute_store_aot_' -V --output-junit "$PWD/out/compute-store-junit.xml" python -B tools/form_coverage.py out/compute-store-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/compute-store-coverage.json python -B tests/form_coverage_check.py python -B tests/docs_links_check.py ``` - 44 passed, 0 failed, 0 capability skips. The two `compute_store_aot_mubuf_store_format_*` fixtures register all four mnemonics as passing in the same CTest run. The selected run records 29 of 73 gfx1030 MUBUF forms. The coverage and documentation checks pass. - Windows build `26300.9974`. WARP on Microsoft Basic Render Driver (`10.0.26100.9818`) and hardware on Intel Arc B390 (`32.0.101.8509`). The debug layer was unavailable on both. GPU comparisons cover translated DXIL. - Both adapters report first differences of word 0, expected `c5c5c5c5`, actual `89abcdef` for the shifted `x` store, and word 1, expected `89abcdef`, actual `01234567`, `dcbafed0`, and `76543210` for the `xy`, `xyz`, and `xyzw` channel swaps respectively. Negative cases also require the expected rejection for a missing descriptor wait, pending data, a format-width mismatch, a record overrun, and overlapping stores. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` Passed on Ubuntu 22.04.5 with LLVM 15.0.7. This checks gfx1030 encoding and container translation. `git diff --check` passed. `git merge-tree --write-tree refs/remotes/origin/main HEAD` succeeded against `0f09ca936fe73399d8ffc8ec5e99541d6799ba1a`.
upstream-sync closed this pull request 2026-11-24 09:04:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
R0Y00/Xbox2Windows!1326
No description provided.