[PR #1426] rdna2spirv: computed I/J pairs under --bary-fallback (SHADER-COMPUTED-IJ-NO-PERVERTEX) #1457

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1426
Author: @Dashhhhhhhh
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/computed-ij-no-pervertex


📝 Commits (2)

  • e7987db Translate computed I/J pairs when a GPU has no per-vertex inputs.
  • b9191a3 Merge remote-tracking branch 'origin/main' into fix/computed-ij-no-pervertex

📊 Changes

15 files changed (+370 additions, -95 deletions)

View changed files

📝 docs/design.md (+2 -2)
📝 docs/testing.md (+4 -1)
📝 make_game.py (+22 -4)
📝 runtime/test/shaders/build.py (+9 -7)
📝 runtime/test/shaders/check.py (+5 -4)
📝 scripts/run_gpu_tests.py (+6 -5)
📝 tests/semantic/support.py (+4 -2)
📝 tests/semantic/test_interp_computed_ij.py (+153 -14)
📝 tests/test_make_game_translator_flags.py (+20 -5)
📝 tests/test_run_gpu_tests.py (+21 -18)
📝 tests/test_shader_build_fallbacks.py (+22 -14)
📝 tests/test_vk_subgroup_info.py (+14 -0)
📝 tools/bary_fallback_gs.py (+30 -5)
📝 tools/rdna2spirv.py (+48 -12)
📝 tools/vk_subgroup_info.py (+10 -2)

📄 Description

Claimed in the coordination issue as: SHADER-COMPUTED-IJ-NO-PERVERTEX

Fixes: #1285

What and why

A GPU without PerVertexKHR inputs was translated with only --f16-interp-fallback. Every computed I/J pixel shader was then refused (computed I/J pair under --f16-interp-fallback / --bary-fallback), and the shaders stage stopped at 26,296 of 26,503. That is the RX 5700 XT report in #1285: geometry shaders are present, VK_KHR_fragment_shader_barycentric is not.

--bary-fallback now keeps those attributes. Each one is a Flat vec4[3] at three free locations, recorded as bary_fallback_input.per_vertex. The pass-through geometry shader writes vertex k's value into element k, and the pixel shader weights them the same way as the PerVertexKHR path: P0 + I·(P1 − P0) + J·(P2 − P0). --f16-interp-fallback alone still refuses them. That is the MoltenVK case, which has no geometry stage.

make_game.py turns --bary-fallback on together with --f16-interp-fallback when per_vertex_inputs is false and geometry_shader is true. LEONIDA_BARY_FALLBACK=0 still forces the native path. A GPU with no geometry stage stays on the f16 fallback alone.

This is the translator half of draft #120 (old PR 9855), rebased onto current main because that draft no longer merges, plus the make_game selection #1285 needs. #120 by itself left the automatic f16-only path refusing the same 207 shaders.

Tested

  • python -I scripts/run_semantic_tests.py tests/semantic -p test_interp_computed_ij.py — 28 tests, 0 failed
  • python -I scripts/run_semantic_tests.py tests/semantic -p 'test_interp*.py' — 14 files, 211 tests, 0 failed
  • python -I scripts/run_semantic_tests.py tests/semantic -p 'test_bary*.py' and -p 'test_f16_interp*.py' — 0 failed
  • python -I tests/test_shader_build_fallbacks.py, tests/test_run_gpu_tests.py, tests/test_vk_subgroup_info.py, tests/test_make_game_translator_flags.py, tests/test_make_game_argparse.py, tests/test_make_game_wave64.py
  • No game files. spirv-val is not installed here, so test_geometry_shader_validates was skipped.

GPUs tested: n/a (Apple M4, MoltenVK not installed; the geometry-shader path needs a device with geometry shaders)

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.

Made with Cursor


🔄 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/1426 **Author:** [@Dashhhhhhhh](https://github.com/Dashhhhhhhh) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/computed-ij-no-pervertex` --- ### 📝 Commits (2) - [`e7987db`](https://github.com/ubiquitarianism/leonida/commit/e7987db42050179a38945e3682e400252112ad96) Translate computed I/J pairs when a GPU has no per-vertex inputs. - [`b9191a3`](https://github.com/ubiquitarianism/leonida/commit/b9191a3186def22cf2eb10250045156264650d8b) Merge remote-tracking branch 'origin/main' into fix/computed-ij-no-pervertex ### 📊 Changes **15 files changed** (+370 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+2 -2) 📝 `docs/testing.md` (+4 -1) 📝 `make_game.py` (+22 -4) 📝 `runtime/test/shaders/build.py` (+9 -7) 📝 `runtime/test/shaders/check.py` (+5 -4) 📝 `scripts/run_gpu_tests.py` (+6 -5) 📝 `tests/semantic/support.py` (+4 -2) 📝 `tests/semantic/test_interp_computed_ij.py` (+153 -14) 📝 `tests/test_make_game_translator_flags.py` (+20 -5) 📝 `tests/test_run_gpu_tests.py` (+21 -18) 📝 `tests/test_shader_build_fallbacks.py` (+22 -14) 📝 `tests/test_vk_subgroup_info.py` (+14 -0) 📝 `tools/bary_fallback_gs.py` (+30 -5) 📝 `tools/rdna2spirv.py` (+48 -12) 📝 `tools/vk_subgroup_info.py` (+10 -2) </details> ### 📄 Description Claimed in the coordination issue as: SHADER-COMPUTED-IJ-NO-PERVERTEX Fixes: #1285 ### What and why A GPU without `PerVertexKHR` inputs was translated with only `--f16-interp-fallback`. Every computed I/J pixel shader was then refused (`computed I/J pair under --f16-interp-fallback` / `--bary-fallback`), and the shaders stage stopped at 26,296 of 26,503. That is the RX 5700 XT report in #1285: geometry shaders are present, `VK_KHR_fragment_shader_barycentric` is not. `--bary-fallback` now keeps those attributes. Each one is a `Flat vec4[3]` at three free locations, recorded as `bary_fallback_input.per_vertex`. The pass-through geometry shader writes vertex k's value into element k, and the pixel shader weights them the same way as the `PerVertexKHR` path: P0 + I·(P1 − P0) + J·(P2 − P0). `--f16-interp-fallback` alone still refuses them. That is the MoltenVK case, which has no geometry stage. `make_game.py` turns `--bary-fallback` on together with `--f16-interp-fallback` when `per_vertex_inputs` is false and `geometry_shader` is true. `LEONIDA_BARY_FALLBACK=0` still forces the native path. A GPU with no geometry stage stays on the f16 fallback alone. This is the translator half of draft #120 (old PR 9855), rebased onto current `main` because that draft no longer merges, plus the `make_game` selection #1285 needs. #120 by itself left the automatic f16-only path refusing the same 207 shaders. ### Tested - `python -I scripts/run_semantic_tests.py tests/semantic -p test_interp_computed_ij.py` — 28 tests, 0 failed - `python -I scripts/run_semantic_tests.py tests/semantic -p 'test_interp*.py'` — 14 files, 211 tests, 0 failed - `python -I scripts/run_semantic_tests.py tests/semantic -p 'test_bary*.py'` and `-p 'test_f16_interp*.py'` — 0 failed - `python -I tests/test_shader_build_fallbacks.py`, `tests/test_run_gpu_tests.py`, `tests/test_vk_subgroup_info.py`, `tests/test_make_game_translator_flags.py`, `tests/test_make_game_argparse.py`, `tests/test_make_game_wave64.py` - No game files. `spirv-val` is not installed here, so `test_geometry_shader_validates` was skipped. GPUs tested: n/a (Apple M4, MoltenVK not installed; the geometry-shader path needs a device with geometry shaders) 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. Made with [Cursor](https://cursor.com) --- <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#1457
No description provided.