[PR #1355] Translate ordinary per-sample texture reads on multisampled images (SHADER-IMAGE-LOAD-MSAA) #1385

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

📋 Pull Request Information

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

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


📝 Commits (1)

  • ab4c9c5 Translate ordinary per-sample image_load in the standalone shader tool

📊 Changes

4 files changed (+188 additions, -10 deletions)

View changed files

➕ docs/msaa_image_load.md (+9 -0)
📝 tests/semantic/spirv_mini_interp.py (+3 -3)
➕ tests/semantic/test_image_load_multisample.py (+109 -0)
📝 tools/rdna2spirv.py (+67 -7)

📄 Description

Claimed in the coordination issue as SHADER-IMAGE-LOAD-MSAA.

Depends on: #1199 for merge coordination. Both PRs touch the typed multisample declarations in tools/rdna2spirv.py. This branch builds directly on 66d4f5aa and merges cleanly with 51a6074d. Whichever lands second needs a rebase. Credit to @madhyn for the shared typed declarations and view selection in 4cd97486.

What changed

Ordinary GFX10 image_load can read selected color channels from one sample of a pixel. The standalone translator previously rejected both multisampled dimensions. With --msaa-image-load it now consumes x, y, optional array slice and the explicit sample ID, then emits a typed Vulkan fetch. The opt-in targets devices whose bindless layout exposes all three numeric classes at bindings 20–25. The new contract row and its references are in docs/msaa_image_load.md. The specialized multi-sample gather remains tracked in #1199. AMD RDNA2 ISA, table 42

Tested

  • Exact submitted head ab4c9c59e9a8105928f210a6572687105db263c1. Seven independently generated gfx1030 programs: upstream base translated 0/7 (three 2D and four array rejections). With the target option, 7/7 translated and passed spirv-val. One is a deliberate sample-zero control.
  • Physical runs used Windows 11 Pro 26H2 build 26300.9974. The runner explicitly selected the NVIDIA GeForce RTX 3070 eGPU (PCI 10de:2484, driver 610.88) and Intel Arc Graphics (PCI 8086:7d55, driver 32.0.101.8132). Each adapter passed 18/18 positive dispatches, 576/576 four-word results, with zero skipped cases and zero Khronos validation errors. The control produced exactly 72 expected mismatches on each adapter. Inputs distinguish four samples, two array layers, all three numeric classes, packed addresses and sparse D16 results. Reproduction commands, both scripts and complete output
  • python -I -u scripts/run_semantic_tests.py -j 10 tests/semantic reported 471 files, 6,171 tests and zero failed files. The ordinary baseline GPU suite on 66d4f5aa recorded 235 passes / 17 skips on NVIDIA and 217 passes / 35 skips on Intel, with zero failures on either. The new physical measurements cover translated Vulkan output. Native RDNA2 remains unmeasured here.

AI-assisted: yes, with Codex. All inputs in this report were generated for the tests.


🔄 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/1355 **Author:** [@titoreinaldo](https://github.com/titoreinaldo) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `contrib/msaa-image-load` --- ### 📝 Commits (1) - [`ab4c9c5`](https://github.com/ubiquitarianism/leonida/commit/ab4c9c59e9a8105928f210a6572687105db263c1) Translate ordinary per-sample image_load in the standalone shader tool ### 📊 Changes **4 files changed** (+188 additions, -10 deletions) <details> <summary>View changed files</summary> ➕ `docs/msaa_image_load.md` (+9 -0) 📝 `tests/semantic/spirv_mini_interp.py` (+3 -3) ➕ `tests/semantic/test_image_load_multisample.py` (+109 -0) 📝 `tools/rdna2spirv.py` (+67 -7) </details> ### 📄 Description Claimed in the coordination issue as [SHADER-IMAGE-LOAD-MSAA](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144288740). Depends on: #1199 for merge coordination. Both PRs touch the typed multisample declarations in `tools/rdna2spirv.py`. This branch builds directly on `66d4f5aa` and merges cleanly with `51a6074d`. Whichever lands second needs a rebase. Credit to @madhyn for the shared typed declarations and view selection in `4cd97486`. ### What changed Ordinary GFX10 `image_load` can read selected color channels from one sample of a pixel. The standalone translator previously rejected both multisampled dimensions. With `--msaa-image-load` it now consumes x, y, optional array slice and the explicit sample ID, then emits a typed Vulkan fetch. The opt-in targets devices whose bindless layout exposes all three numeric classes at bindings 20–25. The new contract row and its references are in `docs/msaa_image_load.md`. The specialized multi-sample gather remains tracked in #1199. [AMD RDNA2 ISA, table 42](https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf#page=72) ### Tested - Exact submitted head `ab4c9c59e9a8105928f210a6572687105db263c1`. Seven independently generated gfx1030 programs: upstream base translated 0/7 (three 2D and four array rejections). With the target option, 7/7 translated and passed `spirv-val`. One is a deliberate sample-zero control. - Physical runs used Windows 11 Pro 26H2 build 26300.9974. The runner explicitly selected the NVIDIA GeForce RTX 3070 eGPU (PCI 10de:2484, driver 610.88) and Intel Arc Graphics (PCI 8086:7d55, driver 32.0.101.8132). Each adapter passed 18/18 positive dispatches, 576/576 four-word results, with zero skipped cases and zero Khronos validation errors. The control produced exactly 72 expected mismatches on each adapter. Inputs distinguish four samples, two array layers, all three numeric classes, packed addresses and sparse D16 results. [Reproduction commands, both scripts and complete output](https://github.com/titoreinaldo/leonida/tree/5ec71104dba9f21889423c755514059037c29590/verification/msaa) - `python -I -u scripts/run_semantic_tests.py -j 10 tests/semantic` reported 471 files, 6,171 tests and zero failed files. The ordinary baseline GPU suite on `66d4f5aa` recorded 235 passes / 17 skips on NVIDIA and 217 passes / 35 skips on Intel, with zero failures on either. The new physical measurements cover translated Vulkan output. Native RDNA2 remains unmeasured here. AI-assisted: yes, with Codex. All inputs in this report were generated for the tests. --- <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#1385
No description provided.