[PR #108] [CLOSED] rdna2spirv: an implicit image_sample reads the UINT/SINT view in every dimension and stage (SHADER-1404) #160

Closed
opened 2026-11-26 20:16:59 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/108
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9839


📝 Commits (1)

  • f8252ef rdna2spirv: an implicit image_sample reads the UINT/SINT view in every dimension and stage (SHADER-1404)

📊 Changes

7 files changed (+182 additions, -18 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 runtime/test/shaders/check.py (+4 -1)
➕ runtime/test/shaders/ps_sample_implicit_uint_array.asm (+27 -0)
📝 runtime/test/vk_texture_test.cpp (+14 -8)
📝 scripts/run_gpu_tests.py (+2 -2)
➕ tests/semantic/test_sample_implicit_dims.py (+119 -0)
📝 tools/rdna2spirv.py (+15 -6)

📄 Description

Carried over from old PR 9839 by IDXTRI in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9839, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
IDXTRI: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

SHADER-1404. Finishes what #9517 started: #9517 made image_sample_l / image_sample_lz take the typed read in
every dimension, but plain image_sample still took it only in a 2D pixel shader. A UINT/SINT 2D-array, cube, 3D
or 1D texture, or any implicit sample outside the pixel stage, was sampled through the float view.

The translator change is the one from @evilclanker9000's #9667 (closed without merging, no successor), rebased on
current main: image_sample takes the typed read everywhere, with Grad sized to the dimension (scalar for 1D,
three components for 3D, two for 2D / 2D-array / cube) in the pixel stage and Lod 0 elsewhere.

New in this PR: a GPU fixture for a non-2D integer texture, the check #9667 still listed as missing.

  • runtime/test/shaders/ps_sample_implicit_uint_array.asm: ps_sample_implicit_uint on a one-layer 2D array.
  • vk_texture_test --two-mip-uint-array: binds the same two-mip unsigned image as a 2D array at binding 3.
  • Registered in check.py / run_gpu_tests.py next to the 2D integer fixtures.

Tested on an NVIDIA GeForce RTX 4070 Ti, driver 616.56, Windows 11, MSVC 2022, Vulkan SDK 1.4.357:

  • run_gpu_tests.py --filter ps_sample_implicit: 3/3 pass, both passes of each 4096/4096 pixels exact. With
    main's translator the new array fixture fails, reading (0, 0, 0, 0) at the first pixel; the 2D ones still pass.
  • tests/semantic/test_sample_implicit_dims.py (from #9667): passes; fails on main for 2D-array, cube, 3D, 1D.
  • Full semantic suite: 457 files, 6,018 tests. 3 files fail (test_image_atomics_guard,
    test_image_cube_store_glc, test_image_store_d16) and fail identically on unchanged main.
  • check_no_game_data.py on every changed file: clean. No game files used.

Not GPU-checked: 3D, cube and 1D integer textures and the compute stage (CPU-checked by the semantic test).

AI-assisted (Claude Code).


🔄 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/108 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9839` --- ### 📝 Commits (1) - [`f8252ef`](https://github.com/ubiquitarianism/leonida/commit/f8252efddeb3fb4c8081208e6027b877a44dff1d) rdna2spirv: an implicit image_sample reads the UINT/SINT view in every dimension and stage (SHADER-1404) ### 📊 Changes **7 files changed** (+182 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `runtime/test/shaders/check.py` (+4 -1) ➕ `runtime/test/shaders/ps_sample_implicit_uint_array.asm` (+27 -0) 📝 `runtime/test/vk_texture_test.cpp` (+14 -8) 📝 `scripts/run_gpu_tests.py` (+2 -2) ➕ `tests/semantic/test_sample_implicit_dims.py` (+119 -0) 📝 `tools/rdna2spirv.py` (+15 -6) </details> ### 📄 Description > Carried over from **old PR 9839** by `IDXTRI` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9839`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `IDXTRI`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): SHADER-1404. Finishes what `#9517` started: `#9517` made `image_sample_l` / `image_sample_lz` take the typed read in every dimension, but plain `image_sample` still took it only in a 2D pixel shader. A UINT/SINT 2D-array, cube, 3D or 1D texture, or any implicit sample outside the pixel stage, was sampled through the float view. The translator change is the one from `@evilclanker9000`'s `#9667` (closed without merging, no successor), rebased on current main: `image_sample` takes the typed read everywhere, with Grad sized to the dimension (scalar for 1D, three components for 3D, two for 2D / 2D-array / cube) in the pixel stage and `Lod 0` elsewhere. New in this PR: a GPU fixture for a non-2D integer texture, the check `#9667` still listed as missing. - `runtime/test/shaders/ps_sample_implicit_uint_array.asm`: `ps_sample_implicit_uint` on a one-layer 2D array. - `vk_texture_test --two-mip-uint-array`: binds the same two-mip unsigned image as a 2D array at binding 3. - Registered in `check.py` / `run_gpu_tests.py` next to the 2D integer fixtures. Tested on an NVIDIA GeForce RTX 4070 Ti, driver 616.56, Windows 11, MSVC 2022, Vulkan SDK 1.4.357: - `run_gpu_tests.py --filter ps_sample_implicit`: 3/3 pass, both passes of each 4096/4096 pixels exact. With main's translator the new array fixture fails, reading (0, 0, 0, 0) at the first pixel; the 2D ones still pass. - `tests/semantic/test_sample_implicit_dims.py` (from `#9667`): passes; fails on main for 2D-array, cube, 3D, 1D. - Full semantic suite: 457 files, 6,018 tests. 3 files fail (`test_image_atomics_guard`, `test_image_cube_store_glc`, `test_image_store_d16`) and fail identically on unchanged main. - `check_no_game_data.py` on every changed file: clean. No game files used. Not GPU-checked: 3D, cube and 1D integer textures and the compute stage (CPU-checked by the semantic test). AI-assisted (Claude Code). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:59 +01:00
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#160
No description provided.