[PR #189] [CLOSED] rdna2spirv: mesh shader compressed exports unpack their fp16 pairs instead of failing translation #242

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/9921


📝 Commits (2)

  • d3a4d17 fix: mesh shader pos1 misc export writes Layer and ViewportIndex per primitive (rdna2spirv)
  • d165a3d fix: mesh shader compressed exports (exp pos1/param ... compr) unpack their f16 pairs instead of raising Unsupported (rdna2spirv)

📊 Changes

2 files changed (+190 additions, -61 deletions)

View changed files

📝 tests/test_translate.py (+100 -0)
📝 tools/rdna2spirv.py (+90 -61)

📄 Description

Carried over from old PR 9921 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9921, 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.
tedin7: 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):

What

A mesh shader's compressed export (exp pos1 ... compr for clip/cull distances, exp param N ... compr) now unpacks its two fp16 pairs (UnpackHalf2x16 on registers 0 and 2 of the operand list) instead of raising Unsupported("mesh compressed export"), which dropped the whole shader. Uses the existing export_comps helper that the pixel-shader path already uses.

Why

A mesh shader containing one compressed export failed to translate, so its pipeline (PSO) was never built and the draw did not render.

Stacked on #9893

This branch contains the #9893 commit (mesh pos1 Layer/ViewportIndex) because both change Gen.ms_export and conflict; the conflict was resolved by keeping both (misc pos1 check first, then the compressed path). Only the top commit is new here. Rebase after #9893 merges.

Tested

  • python3 -m pytest tests/test_translate.py: 670 passed (73 s), including 4 new tests: pos1 compressed clip unpack, an off register writes nothing, compressed param unpack, uncompressed exports do not unpack halves.
  • Negative control: with tools/rdna2spirv.py from the #9893 base, 3 of the 4 new tests fail (the uncompressed guard passes on both).
  • Not run: GPU/lavapipe validation (pods are off); tests assert on the generated SPIR-V.

Rebased cleanly on current main; conflicts only with #9893, resolved as above.


🔄 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/189 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9921` --- ### 📝 Commits (2) - [`d3a4d17`](https://github.com/ubiquitarianism/leonida/commit/d3a4d1733bf1bd03db387b0a2bded31e70945264) fix: mesh shader pos1 misc export writes Layer and ViewportIndex per primitive (rdna2spirv) - [`d165a3d`](https://github.com/ubiquitarianism/leonida/commit/d165a3d6fbe0b4ca943da0d85a3f00c956160174) fix: mesh shader compressed exports (exp pos1/param ... compr) unpack their f16 pairs instead of raising Unsupported (rdna2spirv) ### 📊 Changes **2 files changed** (+190 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_translate.py` (+100 -0) 📝 `tools/rdna2spirv.py` (+90 -61) </details> ### 📄 Description > Carried over from **old PR 9921** by `tedin7` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9921`, 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. > `tedin7`: 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): ## What A mesh shader's compressed export (`exp pos1 ... compr` for clip/cull distances, `exp param N ... compr`) now unpacks its two fp16 pairs (UnpackHalf2x16 on registers 0 and 2 of the operand list) instead of raising `Unsupported("mesh compressed export")`, which dropped the whole shader. Uses the existing `export_comps` helper that the pixel-shader path already uses. ## Why A mesh shader containing one compressed export failed to translate, so its pipeline (PSO) was never built and the draw did not render. ## Stacked on `#9893` This branch contains the `#9893` commit (mesh pos1 Layer/ViewportIndex) because both change `Gen.ms_export` and conflict; the conflict was resolved by keeping both (misc pos1 check first, then the compressed path). Only the top commit is new here. Rebase after `#9893` merges. ## Tested - `python3 -m pytest tests/test_translate.py`: 670 passed (73 s), including 4 new tests: pos1 compressed clip unpack, an off register writes nothing, compressed param unpack, uncompressed exports do not unpack halves. - Negative control: with `tools/rdna2spirv.py` from the `#9893` base, 3 of the 4 new tests fail (the uncompressed guard passes on both). - Not run: GPU/lavapipe validation (pods are off); tests assert on the generated SPIR-V. Rebased cleanly on current main; conflicts only with `#9893`, resolved as above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:14 +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#242
No description provided.