mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:40:52 +01:00
[PR #177] [MERGED] spirv_gs_to_compute: derived input/output pointers keep the capture's storage class (OLD-4126) #228
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#228
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/177
Author: @ItsMrDubey
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:geometry-capture-storage-class📝 Commits (1)
2f9fd8fspirv_gs_to_compute: a pointer derived from a captured input or output keeps the new storage class📊 Changes
2 files changed (+58 additions, -0 deletions)
View changed files
📝
tests/test_spirv_gs_to_compute.py(+43 -0)📝
tools/spirv_gs_to_compute.py(+15 -0)📄 Description
Claimed in the coordination issue as: OLD-4126 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964)
What and why
Old #4126: the geometry capture pass (
tools/spirv_gs_to_compute.py) rewrites an access chain on a GS input to point into the input buffer (StorageBuffer), and one on a GS output to point at the matching private variable. A pointer derived from that result — anotherOpAccessChain/OpInBoundsAccessChain/OpPtrAccessChain, or anOpCopyObject— was passed through unchanged, so it still had its oldInput/Outputpointer type over a base in another storage class, which makes an invalid module.The rewrite now tracks every pointer it moved to the input buffer or to a private output variable, and gives anything derived from one the same storage class (
%gsc_ptr_sb_*/%gsc_ptr_pv_*, for vec4 and float pointees, the only types those hold). A derived pointer to any other type now raisesUnsupportedinstead of being given the wrong type.Tested
Windows 11, Python 3.11.9, no GPU needed. spirv-as / spirv-val are not on PATH here, so the tests that need them were skipped (25); the new test also runs spirv-val on both modules when those tools are present.
%pc = OpCopyObject %ptr_in_v4 %p,%py = OpInBoundsAccessChain %ptr_in_float %pc %u1,%oc = OpCopyObject %ptr_out_float %ox): output kept%ptr_in_v4/%ptr_in_float/%ptr_out_float.python -m pytest -q tests/test_spirv_gs_to_compute.py tests/test_spirv_gs_to_compute_bounds.py: before the fix 1 failed (new test), 4 passed, 25 skipped; after it 12 passed, 25 skipped.python -I scripts/run_semantic_tests.py tests/semantic: 463 files, 6075 tests, 4 files failed: test_exec_computed, test_image_atomics_guard, test_sopc_validation, test_unary_f16_validation (the same four fail on main on this machine; unrelated to this tool).python -I scripts/check_no_game_data.pyon both changed files: clean.AI-assisted: yes
Checklist
docs/design.md(capture-pass rewrite only).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.