[PR #1199] rdna2spirv: lower image_msaa_load through set-0 MSAA bindings 20-25 (SHADER-IMAGE-MSAA-LOAD) #1231

Open
opened 2026-11-26 20:20:32 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1199
Author: @madhyn
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/image-msaa-load


📝 Commits (2)

  • 4cd9748 rdna2spirv: lower image_msaa_load through set-0 MSAA bindings 20-25 (SHADER-IMAGE-MSAA-LOAD)
  • 2fc4f96 rdna2spirv: fetch one MSAA sample per active dmask bit in image_msaa_load

📊 Changes

5 files changed (+218 additions, -14 deletions)

View changed files

📝 docs/design.md (+1 -0)
➕ tests/semantic/test_image_msaa_load.py (+127 -0)
📝 tools/rdna2spirv.py (+85 -9)
📝 tools/wave64_emulate_opt.py (+2 -2)
📝 tools/wave64_halves.py (+3 -3)

📄 Description

Claimed in the coordination issue as: SHADER-IMAGE-MSAA-LOAD (claim)

Follow-up to roanh47's finding in #14 and #1183 (RT-MSAA-DEPTH-SRV).

What and why

  • tools/rdna2spirv.py: lower image_msaa_load for dim:SQ_RSRC_IMG_2D_MSAA and dim:SQ_RSRC_IMG_2D_MSAA_ARRAY via OpImageFetch ... Sample %sample, declaring the set-0 multisampled sampled-image arrays at bindings 20–25 (20/22/24 for 2DMS float/uint/sint and 21/23/25 for 2DMS-array float/uint/sint, matching runtime/src/vulkan_bindless.h::sampled_binding). Handles a16 (u16 packed coords/slice/sample) and d16 via image_read_typed. Non-MSAA dimensions, glc, tfe, lwe, and non-VGPR destinations raise Unsupported.
  • tools/wave64_halves.py, tools/wave64_emulate_opt.py: classify image_msaa_load with image_load for memory ordering and d16 packing.
  • tests/semantic/test_image_msaa_load.py: checks bindings 20–25, OpTypeImage ... MS=1, OpImageFetch ... Sample, a16/d16, --wave64-emulate, Unsupported rejections, and spirv-val --target-env vulkan1.3.
  • docs/design.md: documents the image_msaa_load contract row.

Tested

  • PYTHONPATH=tests/semantic python3 -m unittest tests/semantic/test_image_msaa_load.py tests/semantic/test_sample_typed_dims.py tests/semantic/test_image_coherent.py tests/semantic/test_image_store_d16.py tests/semantic/test_image_store_dmask.py tests/semantic/test_mem_crash_forms.py: 37 tests passed (0.577 s), including spirv-as + spirv-val --target-env vulkan1.3.
  • python3 -m unittest discover -s tests -p "test_docs_*.py": 47 tests passed (12.097 s).
  • python3 runtime/test/shaders/build.py runtime/build/linux: 284/284 fixtures translated and passed spirv-val.
  • Not measured: GPU readback on an MSAA image (current vk_harness / vk_compute_test harnesses only allocate single-sample images).

AI-assisted: yes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1199 **Author:** [@madhyn](https://github.com/madhyn) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/image-msaa-load` --- ### 📝 Commits (2) - [`4cd9748`](https://github.com/ubiquitarianism/leonida/commit/4cd974867da6b05266f48e15f6f38617ca63d026) rdna2spirv: lower image_msaa_load through set-0 MSAA bindings 20-25 (SHADER-IMAGE-MSAA-LOAD) - [`2fc4f96`](https://github.com/ubiquitarianism/leonida/commit/2fc4f9637f1ba2e64e7727445d2333b9082b02ec) rdna2spirv: fetch one MSAA sample per active dmask bit in image_msaa_load ### 📊 Changes **5 files changed** (+218 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -0) ➕ `tests/semantic/test_image_msaa_load.py` (+127 -0) 📝 `tools/rdna2spirv.py` (+85 -9) 📝 `tools/wave64_emulate_opt.py` (+2 -2) 📝 `tools/wave64_halves.py` (+3 -3) </details> ### 📄 Description Claimed in the coordination issue as: SHADER-IMAGE-MSAA-LOAD ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142826368)) Follow-up to `roanh47`'s finding in #14 and #1183 (`RT-MSAA-DEPTH-SRV`). ### What and why - `tools/rdna2spirv.py`: lower `image_msaa_load` for `dim:SQ_RSRC_IMG_2D_MSAA` and `dim:SQ_RSRC_IMG_2D_MSAA_ARRAY` via `OpImageFetch ... Sample %sample`, declaring the set-0 multisampled sampled-image arrays at bindings 20–25 (`20/22/24` for 2DMS float/uint/sint and `21/23/25` for 2DMS-array float/uint/sint, matching `runtime/src/vulkan_bindless.h::sampled_binding`). Handles `a16` (u16 packed coords/slice/sample) and `d16` via `image_read_typed`. Non-MSAA dimensions, `glc`, `tfe`, `lwe`, and non-VGPR destinations raise `Unsupported`. - `tools/wave64_halves.py`, `tools/wave64_emulate_opt.py`: classify `image_msaa_load` with `image_load` for memory ordering and `d16` packing. - `tests/semantic/test_image_msaa_load.py`: checks bindings 20–25, `OpTypeImage ... MS=1`, `OpImageFetch ... Sample`, `a16`/`d16`, `--wave64-emulate`, `Unsupported` rejections, and `spirv-val --target-env vulkan1.3`. - `docs/design.md`: documents the `image_msaa_load` contract row. ### Tested - `PYTHONPATH=tests/semantic python3 -m unittest tests/semantic/test_image_msaa_load.py tests/semantic/test_sample_typed_dims.py tests/semantic/test_image_coherent.py tests/semantic/test_image_store_d16.py tests/semantic/test_image_store_dmask.py tests/semantic/test_mem_crash_forms.py`: **37 tests passed** (0.577 s), including `spirv-as` + `spirv-val --target-env vulkan1.3`. - `python3 -m unittest discover -s tests -p "test_docs_*.py"`: **47 tests passed** (12.097 s). - `python3 runtime/test/shaders/build.py runtime/build/linux`: **284/284** fixtures translated and passed `spirv-val`. - Not measured: GPU readback on an MSAA image (current `vk_harness` / `vk_compute_test` harnesses only allocate single-sample images). AI-assisted: yes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1231
No description provided.