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

Closed
github-bot wants to merge 1 commit from gh-pr/108/head into gh-pr/108/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:19 UTC · original
ubiquitarianism:old-pr/9839 → main · +182 −18 · 7 files · 1 commits · closed without merging

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).

**@⁠Andretuta** on GitHub · 2026-11-24 02:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/108) `ubiquitarianism:old-pr/9839` → `main` · +182 −18 · 7 files · 1 commits · closed without merging > 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).
Plain image_sample took the typed read only in a 2D pixel shader, so an integer 2D-array, cube, 3D or 1D
texture, or any implicit sample outside the pixel stage, was sampled through the float view. The translator
change and its semantic test are from #9667 (evilclanker9000), rebased on main; Grad is sized per dimension.

Adds ps_sample_implicit_uint_array with vk_texture_test --two-mip-uint-array: 4096/4096 pixels exact at both
mips on an RTX 4070 Ti (616.56); main's translator reads zeros there.

Co-Authored-By: evilclanker9000 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:44:44 +00:00
github-bot closed this pull request 2026-11-26 08:44:45 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:49 UTC · original

Thanks for this work on SHADER-1404. Closing this carried-over draft in favour of #225, which makes the same
translator change.

  • The image_sample lowering here is the same as #225's (typed read in every dimension, Grad in the PS,
    Lod 0 elsewhere).
  • #225 also adds UINT and SINT GPU fixtures on a 2D array and a 3D volume, and they fail on every pixel without
    the fix.
  • If you think something here is missing from #225, please say so on #225.

The old-pr/* branch stays; see #17 for the list of carried-over PRs.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 19:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/108#issuecomment-7142643415) Thanks for this work on SHADER-1404. Closing this carried-over draft in favour of #225, which makes the same translator change. - The `image_sample` lowering here is the same as #225's (typed read in every dimension, `Grad` in the PS, `Lod 0` elsewhere). - #225 also adds UINT and SINT GPU fixtures on a 2D array and a 3D volume, and they fail on every pixel without the fix. - If you think something here is missing from #225, please say so on #225. The `old-pr/*` branch stays; see #17 for the list of carried-over PRs. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.