[PR #1247] rdna2spirv: image_sample* outside 2D selects the UINT/SINT sampled view (OLD-9959 / SHADER-1404) #1279

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

📋 Pull Request Information

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

Base: main ← Head: carry/old-9959-sample-typed-dims


📝 Commits (2)

  • 85146ea rdna2spirv: image_sample* outside 2D selects the UINT/SINT sampled view (SHADER-1404)
  • 58b2f94 tests/test_shader_checks: count and patch sample_dims_test for SHADER-1404

📊 Changes

12 files changed (+560 additions, -38 deletions)

View changed files

📝 docs/design.md (+2 -1)
📝 runtime/test/shaders/check.py (+21 -0)
➕ runtime/test/shaders/ps_sample_array_sint.asm (+71 -0)
➕ runtime/test/shaders/ps_sample_array_uint.asm (+58 -0)
➕ runtime/test/shaders/ps_sample_volume_sint.asm (+71 -0)
➕ runtime/test/shaders/ps_sample_volume_uint.asm (+58 -0)
📝 runtime/test/vk_texture_test.cpp (+113 -27)
📝 scripts/run_gpu_tests.py (+6 -0)
➕ tests/semantic/test_sample_implicit_dims.py (+139 -0)
📝 tests/semantic/test_sample_typed_dims.py (+2 -2)
📝 tests/test_shader_checks.py (+2 -1)
📝 tools/rdna2spirv.py (+17 -7)

📄 Description

Claimed in the coordination issue as: OLD-9959 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143833765)

What and why

Carries forward old-pr/9959 (draft #225, original commit author slipperysquid preserved; indexed in #17; SHADER-1404), rebased cleanly onto current main, plus a small follow-up commit (68762f09c) updating tests/test_shader_checks.py for the new SAMPLE_DIMS_TESTS / sample_dims_test hook in check.py.

Extends typed UINT/SINT view selection in tools/rdna2spirv.py to implicit image_sample across every texture dimension and stage (matching image_sample_l / image_sample_lz):

  • Selects the T# FORMAT's float, UINT, or SINT sampled view for image_sample across 1D, 2D, 2D-array, cube, and 3D dimensions and in both pixel and non-pixel stages.
  • Computes quad gradients (OpDPdx / OpDPdy) before the per-format branch at the non-layer coordinate width in pixel shaders, and samples at explicit LOD 0 outside the pixel stage.
  • Adds tests/semantic/test_sample_implicit_dims.py, updates tests/semantic/test_sample_typed_dims.py, adds GPU fixtures ps_sample_array_uint/sint and ps_sample_volume_uint/sint with new vk_texture_test modes wired into check.py and scripts/run_gpu_tests.py, updates tests/test_shader_checks.py, and updates the contract row in docs/design.md.

Tested

  • python -m unittest discover -s tests/semantic -p test_sample_implicit_dims.py -v: 6 tests, OK (1 skipped: spirv-val not on PATH).
  • python -m unittest discover -s tests/semantic -p test_sample_typed_dims.py -v: 4 tests, OK (1 skipped: spirv-val not on PATH).
  • python -I tests/test_shader_checks.py: 87 tests, OK.
  • python -I tests/test_docs_links.py: 16 tests, OK.
  • python -I scripts/run_semantic_tests.py tests/semantic: 471 files, 6,174 tests, 0 files failed.
  • python -I scripts/check_no_game_data.py on all 12 touched files: exit 0 (no game data).

GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10; original author verified the GPU fixtures on RX 6800 XT / RTX 3070 / llvmpipe)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🔄 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/1247 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9959-sample-typed-dims` --- ### 📝 Commits (2) - [`85146ea`](https://github.com/ubiquitarianism/leonida/commit/85146ea0e2f82393bf8155207292e97d2ed11a1f) rdna2spirv: image_sample* outside 2D selects the UINT/SINT sampled view (SHADER-1404) - [`58b2f94`](https://github.com/ubiquitarianism/leonida/commit/58b2f94a4936b1320a2c0ccb511b769977331513) tests/test_shader_checks: count and patch sample_dims_test for SHADER-1404 ### 📊 Changes **12 files changed** (+560 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+2 -1) 📝 `runtime/test/shaders/check.py` (+21 -0) ➕ `runtime/test/shaders/ps_sample_array_sint.asm` (+71 -0) ➕ `runtime/test/shaders/ps_sample_array_uint.asm` (+58 -0) ➕ `runtime/test/shaders/ps_sample_volume_sint.asm` (+71 -0) ➕ `runtime/test/shaders/ps_sample_volume_uint.asm` (+58 -0) 📝 `runtime/test/vk_texture_test.cpp` (+113 -27) 📝 `scripts/run_gpu_tests.py` (+6 -0) ➕ `tests/semantic/test_sample_implicit_dims.py` (+139 -0) 📝 `tests/semantic/test_sample_typed_dims.py` (+2 -2) 📝 `tests/test_shader_checks.py` (+2 -1) 📝 `tools/rdna2spirv.py` (+17 -7) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9959 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143833765) ### What and why Carries forward `old-pr/9959` (draft #225, original commit author `slipperysquid` preserved; indexed in #17; SHADER-1404), rebased cleanly onto current `main`, plus a small follow-up commit (`68762f09c`) updating `tests/test_shader_checks.py` for the new `SAMPLE_DIMS_TESTS` / `sample_dims_test` hook in `check.py`. Extends typed UINT/SINT view selection in `tools/rdna2spirv.py` to implicit `image_sample` across every texture dimension and stage (matching `image_sample_l` / `image_sample_lz`): - Selects the T# FORMAT's float, UINT, or SINT sampled view for `image_sample` across 1D, 2D, 2D-array, cube, and 3D dimensions and in both pixel and non-pixel stages. - Computes quad gradients (`OpDPdx` / `OpDPdy`) before the per-format branch at the non-layer coordinate width in pixel shaders, and samples at explicit LOD 0 outside the pixel stage. - Adds `tests/semantic/test_sample_implicit_dims.py`, updates `tests/semantic/test_sample_typed_dims.py`, adds GPU fixtures `ps_sample_array_uint`/`sint` and `ps_sample_volume_uint`/`sint` with new `vk_texture_test` modes wired into `check.py` and `scripts/run_gpu_tests.py`, updates `tests/test_shader_checks.py`, and updates the contract row in `docs/design.md`. ### Tested - `python -m unittest discover -s tests/semantic -p test_sample_implicit_dims.py -v`: 6 tests, OK (1 skipped: `spirv-val` not on PATH). - `python -m unittest discover -s tests/semantic -p test_sample_typed_dims.py -v`: 4 tests, OK (1 skipped: `spirv-val` not on PATH). - `python -I tests/test_shader_checks.py`: 87 tests, OK. - `python -I tests/test_docs_links.py`: 16 tests, OK. - `python -I scripts/run_semantic_tests.py tests/semantic`: 471 files, 6,174 tests, 0 files failed. - `python -I scripts/check_no_game_data.py` on all 12 touched files: exit 0 (no game data). GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10; original author verified the GPU fixtures on RX 6800 XT / RTX 3070 / llvmpipe) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. --- <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#1279
No description provided.