spirv_gs_to_compute: derived input/output pointers keep the capture's storage class (OLD-4126) #177
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/177"
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?
Imported from ubiquitarianism/leonida. Originally posted by ItsMrDubey on 2026-11-24T02:36:24Z.
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).