spirv_gs_to_compute: derived input/output pointers keep the capture's storage class (OLD-4126) #177
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!177
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/177/head"
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?
@ItsMrDubey on GitHub · 2026-11-24 02:36 UTC · original
ItsMrDubey:geometry-capture-storage-class→main· +58 −0 · 2 files · 1 commits · merged 2026-11-24 03:28 UTCClaimed in the coordination issue as: OLD-4126 (#14)
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).