compute: lower 2D a16 image_store with 32-bit data in direct compute #3374

Manually merged
github merged 1 commit from github-bot/gh-3372 into main 2026-11-29 08:39:20 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-28 15:24 UTC · original
Leyukaka:compute-a16-image-store → main · +115 −1 · 3 files · 1 commits · merged 2026-11-29 08:35 UTC

Refs #3226.

Change

The direct compute path refused a16 image stores unless the data was d16 (store && !half in image_io). A16 selects 16-bit addresses independently of the data width (RDNA 2 ISA, MIMG A16). A 2D store with 32-bit data now uses the same packed coordinates as an a16 load: x is the low half and y the high half of the first address VGPR. Graphics stages keep the refusal for 32-bit data.

Test

tests/native_image_store_a16_check.py (new):

  • native_image_store_a16_controls: one textureStore.f32 whose coordinates are and ..., 65535 and lshr ..., 16 of the same value. An a16 image_load_mip and an a16 3D image_store still refuse with packed image addressing.
  • native_image_store_a16_hardware / _warp: a 32-lane source-built program with EXEC 0x55555555, read back from an RGBA32_FLOAT texture (1,344 words).

ctest --test-dir out/build/release -R native_image_store_a16, Windows 11 build 26300, RTX 5080 driver 32.0.16.2101 (debug layer unavailable):

main f5a6f6ba this branch
_controls fails (packed image addressing) passes
_hardware fails 1,344 words matched
_warp skip 77 (wave32 fixture) skip 77

Swapping x and y in the unpacking fails both _controls and _hardware.

Broad selection (ctest -R "native_|startup_compute|compile_dxil|salu"): 560/566. The same 6 tests fail on main f5a6f6ba.

Measurement

On the 873 compute requests of the run in my #3226 census, 3 shaders (1,017 dispatches) move from packed image addressing to compiled, and none is lost. One publishes a runtime manifest; two stop at SRV kind typed_buffer_srv.

Not covered: write masks other than 15; a16 stores with LOD, on 1D, 3D or array images, or in graphics stages (the graphics refusal is not tested).

**@⁠Leyukaka** on GitHub · 2026-11-28 15:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3372) `Leyukaka:compute-a16-image-store` → `main` · +115 −1 · 3 files · 1 commits · merged 2026-11-29 08:35 UTC Refs #3226. ## Change The direct compute path refused `a16` image stores unless the data was `d16` (`store && !half` in `image_io`). A16 selects 16-bit addresses independently of the data width (RDNA 2 ISA, MIMG `A16`). A 2D store with 32-bit data now uses the same packed coordinates as an a16 load: x is the low half and y the high half of the first address VGPR. Graphics stages keep the refusal for 32-bit data. ## Test `tests/native_image_store_a16_check.py` (new): - `native_image_store_a16_controls`: one `textureStore.f32` whose coordinates are `and ..., 65535` and `lshr ..., 16` of the same value. An a16 `image_load_mip` and an a16 3D `image_store` still refuse with `packed image addressing`. - `native_image_store_a16_hardware` / `_warp`: a 32-lane source-built program with EXEC `0x55555555`, read back from an RGBA32_FLOAT texture (1,344 words). `ctest --test-dir out/build/release -R native_image_store_a16`, Windows 11 build 26300, RTX 5080 driver 32.0.16.2101 (debug layer unavailable): | | `main` `f5a6f6ba` | this branch | |---|---|---| | `_controls` | fails (`packed image addressing`) | passes | | `_hardware` | fails | 1,344 words matched | | `_warp` | skip 77 (wave32 fixture) | skip 77 | Swapping x and y in the unpacking fails both `_controls` and `_hardware`. Broad selection (`ctest -R "native_|startup_compute|compile_dxil|salu"`): 560/566. The same 6 tests fail on `main` `f5a6f6ba`. ## Measurement On the 873 compute requests of the run in my #3226 census, 3 shaders (1,017 dispatches) move from `packed image addressing` to compiled, and none is lost. One publishes a runtime manifest; two stop at `SRV kind typed_buffer_srv`. Not covered: write masks other than 15; a16 stores with LOD, on 1D, 3D or array images, or in graphics stages (the graphics refusal is not tested).
The direct path refused a16 image stores unless the data was d16. A16
selects 16-bit addresses independently of the data width, so a 2D store
with 32-bit data uses the same packed coordinates as an a16 load: x in
the low half of the address VGPR and y in the high half. Graphics keeps
its refusal.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:25:35 +00:00
Author
Owner

@⁠KelboLive on GitHub · 2026-11-28 20:46 UTC · original · approved these changes

LGTM — clean A16 image_store lowering for the direct compute path.

Changes the A16 guard from graphics_input && store && !half to graphics_input && store && !half (relaxed to allow compute-only A16 stores), with a clear ISA comment. The test fixture verifies coordinate packing, both refusal diagnostics, and hardware readback of RGBA32 texture words.

Ready to land.

**@⁠KelboLive** on GitHub · 2026-11-28 20:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3372#pullrequestreview-6100016997) · **approved these changes** LGTM — clean A16 image_store lowering for the direct compute path. Changes the A16 guard from `graphics_input && store && !half` to `graphics_input && store && !half` (relaxed to allow compute-only A16 stores), with a clear ISA comment. The test fixture verifies coordinate packing, both refusal diagnostics, and hardware readback of RGBA32 texture words. Ready to land.
Author
Owner

@⁠KelboLive on GitHub · 2026-11-28 21:09 UTC · original · approved these changes

LGTM — clean fix with thorough tests.

Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics.

Ready to land.

**@⁠KelboLive** on GitHub · 2026-11-28 21:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3372#pullrequestreview-6100097634) · **approved these changes** LGTM — clean fix with thorough tests. Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics. Ready to land.
Author
Owner

@⁠KelboLive on GitHub · 2026-11-28 21:57 UTC · original · approved these changes

LGTM — clean fix with thorough tests.

Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics.

Ready to land.

**@⁠KelboLive** on GitHub · 2026-11-28 21:57 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3372#pullrequestreview-6100255612) · **approved these changes** LGTM — clean fix with thorough tests. Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics. Ready to land.
github manually merged commit d4fa16dab5 into main 2026-11-29 08:39:20 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 17:24 UTC · original

Thanks, Leyukaka. This is in main now. The RTX 5080 readback matched all 1,344 words, and the swapped-coordinate control caught the X/Y regression. WARP reported a wave32 capability skip. The two shaders that still stop at SRV kind typed_buffer_srv are a separate follow-up under #3226.

**@⁠R0Y00** on GitHub · 2026-12-02 17:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3372#issuecomment-7353272219) Thanks, Leyukaka. This is in `main` now. The RTX 5080 readback matched all 1,344 words, and the swapped-coordinate control caught the X/Y regression. WARP reported a wave32 capability skip. The two shaders that still stop at `SRV kind typed_buffer_srv` are a separate follow-up under #3226.
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 06:19 UTC · original

One follow-up on the two shaders that compiled after this change but stopped at SRV kind typed_buffer_srv: #3388 added published typed-buffer SRV bindings for 32-bit components, and #3462 added the corresponding in-process binding used by the default launch path. Those changes were verified with source-built fixtures. The remaining check under #3226 is to rerun the same two requests on current main and record whether each reaches a translated dispatch or hits another refusal.

**@⁠R0Y00** on GitHub · 2026-12-03 06:19 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3372#issuecomment-7369705816) One follow-up on the two shaders that compiled after this change but stopped at `SRV kind typed_buffer_srv`: #3388 added published typed-buffer SRV bindings for 32-bit components, and #3462 added the corresponding in-process binding used by the default launch path. Those changes were verified with source-built fixtures. The remaining check under #3226 is to rerun the same two requests on current `main` and record whether each reaches a translated dispatch or hits another refusal.
This discussion has been locked. Commenting is limited to contributors.
No description provided.