mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #162] rdna2spirv: a mesh shader exp pos1 writes Layer and ViewportIndex per primitive #214
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#214
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/162
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9893📝 Commits (1)
d3a4d17fix: mesh shader pos1 misc export writes Layer and ViewportIndex per primitive (rdna2spirv)📊 Changes
2 files changed (+97 additions, -25 deletions)
View changed files
📝
tests/test_translate.py(+48 -0)📝
tools/rdna2spirv.py(+49 -25)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):What
A mesh shader that exports the misc vector at
exp pos1(z[10:0] = Layer, z[19:16] = ViewportIndex) now writes Layer and ViewportIndex as per-primitive mesh outputs (PerPrimitiveEXTmembers of the primitive block). Before, the pos1 export was staged as if it were an ordinary position and the Layer/ViewportIndex values were lost. The VS/NGG path shares the newexport_misc_pos1helper, so its output is unchanged.ShaderLayer/ShaderViewportIndexcapabilities are skipped for mesh shaders (the builtins are part of MeshShadingEXT).Why
Shaders that render into layered targets or multiple viewports through the mesh path would draw everything into layer 0 / viewport 0, breaking 3D rendering for those draws.
Tested
python3 -m pytest tests/test_translate.py: 666 passed (113 s), including 3 new tests: layer+viewport per primitive, layer only (no viewport member), and no misc outputs keeps the plain primitive block.tools/rdna2spirv.pytaken from origin/main, 2 of the 3 new tests fail (the third guards that nothing changes without misc outputs, and passes on both).Rebased cleanly on current main (the cherry-pick applied without conflicts). Our earlier PR for this was not opened before the org migration, so there is nothing to supersede.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.