[PR #765] OLD-2528: mesh_compute_vs: read output address from %pc_tail when pc_tail_address_dwords is set #803

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

📋 Pull Request Information

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

Base: main ← Head: mesh-compute-vs-pc-tail


📝 Commits (2)

  • 476f014 mesh_compute_vs: read output address from %pc_tail when pc_tail_address_dwords is set
  • 4bbeddd mesh_compute_vs: reject duplicate or out-of-range pc_tail_address_dwords indices

📊 Changes

3 files changed (+118 additions, -13 deletions)

View changed files

📝 tests/test_mesh_compute.py (+18 -2)
📝 tests/test_mesh_compute_vs.py (+47 -0)
📝 tools/mesh_compute_vs.py (+53 -11)

📄 Description

Restores my open PR from the original repository (OLD-2528), rebased onto current main (2d73c242f).

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133003627

Summary

  • When index.json's mesh_compute layout carries pc_tail_address_dwords (as emitted by rdna2spirv.py --mesh-compute --pc-tail-ubo), tools/mesh_compute_vs.py reads the output-buffer address from the set-1 binding-0 Uniform block %pc_tail (%PcTail) instead of a 152-byte PushConstant block, omitting PushConstant completely so the vertex shader fits 128-byte push-constant devices.
  • Without pc_tail_address_dwords, the emitted SPIR-V assembly is byte-identical to before.
  • Adds unit tests in tests/test_mesh_compute_vs.py and tests/test_mesh_compute.py.

Verification (rebased on 2d73c242f)

  • py -3.14 -m compileall -q tools/mesh_compute_vs.py tests/test_mesh_compute.py tests/test_mesh_compute_vs.py — clean
  • LLVM_MC="wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" py -3.14 -m pytest tests/test_mesh_compute_vs.py tests/test_mesh_compute.py -q -p no:cacheprovider — 44 passed, 13 subtests passed
  • py -3.14 -I tests/test_text_write_line_endings.py — 3 passed

AI-assisted (Gemini 4 Neon).


🔄 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/765 **Author:** [@whoalin1](https://github.com/whoalin1) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mesh-compute-vs-pc-tail` --- ### 📝 Commits (2) - [`476f014`](https://github.com/ubiquitarianism/leonida/commit/476f014a2e207fcab0851852c2864357df52829e) mesh_compute_vs: read output address from %pc_tail when pc_tail_address_dwords is set - [`4bbeddd`](https://github.com/ubiquitarianism/leonida/commit/4bbeddd5ab33b36ade8d3bd6e5403d1bf14a4609) mesh_compute_vs: reject duplicate or out-of-range pc_tail_address_dwords indices ### 📊 Changes **3 files changed** (+118 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_mesh_compute.py` (+18 -2) 📝 `tests/test_mesh_compute_vs.py` (+47 -0) 📝 `tools/mesh_compute_vs.py` (+53 -11) </details> ### 📄 Description Restores my open PR from the original repository (OLD-2528), rebased onto current `main` (`2d73c242f`). Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133003627 ### Summary - When `index.json`'s `mesh_compute` layout carries `pc_tail_address_dwords` (as emitted by `rdna2spirv.py --mesh-compute --pc-tail-ubo`), `tools/mesh_compute_vs.py` reads the output-buffer address from the set-1 binding-0 `Uniform` block `%pc_tail` (`%PcTail`) instead of a 152-byte `PushConstant` block, omitting `PushConstant` completely so the vertex shader fits 128-byte push-constant devices. - Without `pc_tail_address_dwords`, the emitted SPIR-V assembly is byte-identical to before. - Adds unit tests in `tests/test_mesh_compute_vs.py` and `tests/test_mesh_compute.py`. ### Verification (rebased on `2d73c242f`) - `py -3.14 -m compileall -q tools/mesh_compute_vs.py tests/test_mesh_compute.py tests/test_mesh_compute_vs.py` — clean - `LLVM_MC="wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc" py -3.14 -m pytest tests/test_mesh_compute_vs.py tests/test_mesh_compute.py -q -p no:cacheprovider` — **44 passed, 13 subtests passed** - `py -3.14 -I tests/test_text_write_line_endings.py` — **3 passed** AI-assisted (Gemini 4 Neon). --- <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#803
No description provided.