shader: lower typed gfx1030 2D image stores #1337

Merged
stan495 merged 2 commits from upstream-pr/1344 into main 2026-11-24 10:19:45 +00:00
stan495 commented 2026-11-24 08:43:23 +00:00 (Migrated from github.com)

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


Scope

Lower gfx1030 image_store and image_store_mip for linear R32G32B32A32_UINT 2D images. Both opcodes write one full texel at u0 and zero channels omitted by DMASK. The translator accepts one store per shader and both 32-bit and a16 address forms. Use --image-uav-mip to bind a single view. An explicit native mip must be a compile-time constant that matches the view. Coordinates must be in range and each invocation must write a distinct texel.

This extends the gfx1030 compute MIMG path from #1310 and #1321.

Validation

Tested 382d1db2201cec10f17bac580372994e1eb98246 on Windows 11 build 26300.9974 with Intel Arc B390 (driver 32.0.101.8509) and WARP (Microsoft Basic Render Driver, driver 10.0.26100.9818). Both reported debug_layer=unavailable.

. .\tools\dev.ps1
cmake --preset dev -DINTAKE_PYTHON=<dev-python>
cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -V -j 2 --output-junit <absolute-path-to-1344-junit.xml>
python -B tools/form_coverage.py <absolute-path-to-1344-junit.xml> --records out/build/dev/form_coverage --json out/1344-coverage.json --gaps gfx1030
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py

CTest reported 57 passed, 0 failed and 0 skipped. Each backend executed 18 typed write variants using mip levels 0, 1 and 2, two address widths, DMASKs 0x1, 0xa, 0xf, and dispatches of one or two groups. The independent CPU reference compared all 1,344 channel values across three mips, including untouched texels. The masked-channel mutation first differed at mip=0 word=0 expected=00000000 actual=deadbeef. The wrong UAV mip mutation first differed at mip=0 word=0 expected=c0000000 actual=11000000. The tests reject dynamic or mismatched mip levels, unexpected flags, a second image store, and invalid descriptor bindings and waits. The JUnit-backed gfx1030 compute coverage includes both new MIMG mnemonics. The same run covered formatted MUBUF stores and the upstream D16 load and atomic reduction cases from #1343, #1346 and #1354.

python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

LLVM 15 assembled and disassembled all 18 write cases. The synthetic container CLI emitted the same HLSL as the text path. The GPU tests ran the translated desktop DXIL.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6577946051 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1344). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T08:43:23Z. --- ## Scope Lower gfx1030 `image_store` and `image_store_mip` for linear `R32G32B32A32_UINT` 2D images. Both opcodes write one full texel at `u0` and zero channels omitted by DMASK. The translator accepts one store per shader and both 32-bit and `a16` address forms. Use `--image-uav-mip` to bind a single view. An explicit native mip must be a compile-time constant that matches the view. Coordinates must be in range and each invocation must write a distinct texel. This extends the gfx1030 compute MIMG path from #1310 and #1321. ## Validation Tested `382d1db2201cec10f17bac580372994e1eb98246` on Windows 11 build 26300.9974 with Intel Arc B390 (driver 32.0.101.8509) and WARP (Microsoft Basic Render Driver, driver 10.0.26100.9818). Both reported `debug_layer=unavailable`. ```powershell . .\tools\dev.ps1 cmake --preset dev -DINTAKE_PYTHON=<dev-python> cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -V -j 2 --output-junit <absolute-path-to-1344-junit.xml> python -B tools/form_coverage.py <absolute-path-to-1344-junit.xml> --records out/build/dev/form_coverage --json out/1344-coverage.json --gaps gfx1030 python -B tests/form_coverage_check.py python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py ``` CTest reported 57 passed, 0 failed and 0 skipped. Each backend executed 18 typed write variants using mip levels 0, 1 and 2, two address widths, DMASKs `0x1`, `0xa`, `0xf`, and dispatches of one or two groups. The independent CPU reference compared all 1,344 channel values across three mips, including untouched texels. The masked-channel mutation first differed at `mip=0 word=0 expected=00000000 actual=deadbeef`. The wrong UAV mip mutation first differed at `mip=0 word=0 expected=c0000000 actual=11000000`. The tests reject dynamic or mismatched mip levels, unexpected flags, a second image store, and invalid descriptor bindings and waits. The JUnit-backed gfx1030 compute coverage includes both new MIMG mnemonics. The same run covered formatted MUBUF stores and the upstream D16 load and atomic reduction cases from #1343, #1346 and #1354. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` LLVM 15 assembled and disassembled all 18 write cases. The synthetic container CLI emitted the same HLSL as the text path. The GPU tests ran the translated desktop DXIL.
upstream-sync closed this pull request 2026-11-24 11:02:37 +00:00
tablefrogpillow commented 2026-11-24 11:02:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tablefrogpillow on 2026-11-24T10:08:19Z.


Ran the PR's validation subset on AMD hardware, which the Validation section (Intel Arc + WARP) didn't cover.

Host: AMD Radeon RX 7900 GRE (Navi31, RDNA3), vendor 1002 device 744c, driver 31.0.22030.2, Windows 11 26300, D3D12 (debug_layer=unavailable). Built offscreen_check at head 382d1db.

ctest --preset dev -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -j 1 → 57/57 passed. The gfx1030 image-store cases pass — compute_store_aot_mimg_store_hardware and compute_store_aot_mimg_mip_hardware, compared_words=1344 mismatches=0 across mips 0/1/2 and 1–2 groups — with the built-in controls catching the mutations (masked-channel → mip=0 word=0 expected=00000000 actual=deadbeef; wrong-UAV-mip → expected=c0000000 actual=11000000).

Note for single-GPU hosts: with -j 2 (as in the PR command) every *_hardware test spuriously fails here — concurrent D3D12 submissions to one adapter contend; -j 1 is clean. Single-gen RDNA3 datapoint. AI-assisted (Claude).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7128366943 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1344#issuecomment-7128366943). Originally posted by [tablefrogpillow](https://github.com/tablefrogpillow) on 2026-11-24T10:08:19Z. --- Ran the PR's validation subset on **AMD hardware**, which the `Validation` section (Intel Arc + WARP) didn't cover. **Host:** AMD Radeon RX 7900 GRE (Navi31, RDNA3), vendor `1002` device `744c`, driver `31.0.22030.2`, Windows 11 26300, D3D12 (`debug_layer=unavailable`). Built `offscreen_check` at head `382d1db`. `ctest --preset dev -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -j 1` → **57/57 passed**. The gfx1030 image-store cases pass — `compute_store_aot_mimg_store_hardware` and `compute_store_aot_mimg_mip_hardware`, `compared_words=1344 mismatches=0` across mips 0/1/2 and 1–2 groups — with the built-in controls catching the mutations (masked-channel → `mip=0 word=0 expected=00000000 actual=deadbeef`; wrong-UAV-mip → `expected=c0000000 actual=11000000`). Note for single-GPU hosts: with `-j 2` (as in the PR command) every `*_hardware` test spuriously fails here — concurrent D3D12 submissions to one adapter contend; **`-j 1` is clean**. Single-gen RDNA3 datapoint. AI-assisted (Claude).
R0Y00 commented 2026-11-24 11:02:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T10:16:05Z.


I kept your updated image-store revision and integrated the current raw reductions before pushing f236a41b. The image-UAV path now explicitly rejects both 32-bit and 64-bit raw atomics, with controls for both. I reran typed image stores on RTX 4060 Laptop and WARP after the sync. The earlier integration also passed the 64-bit atomic and formatted D16 readback regressions on both adapters. CI is checking the updated head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7128544334 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1344#issuecomment-7128544334). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T10:16:05Z. --- I kept your updated image-store revision and integrated the current raw reductions before pushing f236a41b. The image-UAV path now explicitly rejects both 32-bit and 64-bit raw atomics, with controls for both. I reran typed image stores on RTX 4060 Laptop and WARP after the sync. The earlier integration also passed the 64-bit atomic and formatted D16 readback regressions on both adapters. CI is checking the updated head.
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!1337
No description provided.