mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #672] spirv_gs_to_compute: preserve implied Shader cap, fix 64-bit indices, output loads, comments, and helper guards (SHADER-GSC-LOWERING) #711
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#711
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/672
Author: @hamdog0203
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/shader-gsc-lowering📝 Commits (1)
9eb60ccspirv_gs_to_compute: preserve implied Shader cap, fix 64-bit indices, output loads, comments, and helper guards (SHADER-GSC-LOWERING)📊 Changes
2 files changed (+231 additions, -34 deletions)
View changed files
📝
tests/test_spirv_gs_to_compute.py(+136 -0)📝
tools/spirv_gs_to_compute.py(+95 -34)📄 Description
Claimed in the coordination issue as: SHADER-GSC-LOWERING (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129932024)
AI-assisted: yes
No game files touched or included.
Summary
Fixes six SPIR-V correctness and lowering gaps in
tools/spirv_gs_to_compute.py, all verified againstspirv-as/spirv-valand GPU pipeline compilation:OpCapability Shader: emitOpCapability Shaderwhen droppingOpCapability Geometryfrom modules that relied onGeometryimplyingShader.OpUConvert %uintinstead of invalid cross-widthOpBitcastwhen an input access chain uses a non-32-bit integer index (e.g. 64-bitOpTypeInt 64 0).OpLoadfrom loweredOutputvariables (out_vars) to the correspondingPrivatecapture variable (%gsc_outN).OpDecorateId/OpDecorateString/OpDecorateStringGOOGLEtargeting removed variables (and raiseUnsupportedifOpDecorateIdreferences a removed variable as an operand).;comments outside string literals (_strip_comment) across parsing, execution modes,OpEntryPoint,OpPhiedge rewriting,OpEmitVertex,OpEndPrimitive, andOpReturnso trailing comments cannot break lowering or leave unrewritten instructions behind.Unsupportedwhen non-entry helper functions reference removed interface variables or call emit/primitive/stream ops, and rejectOpEmitStreamVertex/OpEndStreamPrimitiveinsidemain.Verification
pytest tests/test_spirv_gs_to_compute.py -v(with Khronosspirv-as/spirv-val+llvm-mc) ->36 passed(30 existing + 6 new regression tests)main(6 failed)vk_pipeline_check.exe --stage cs --jobs 1on NVIDIA GeForce RTX 4060 (Windows 11, subgroup 32..32) compiled the lowered compute module cleanly (cs: 1 modules ok, 0 failed,cs pipelines: 1 ok, 0 failed)python -I -m py_compile tools/spirv_gs_to_compute.py tests/test_spirv_gs_to_compute.py-> OKpython -I scripts/check_no_game_data.py tools/spirv_gs_to_compute.py tests/test_spirv_gs_to_compute.py-> exit0python -I tests/test_text_write_line_endings.py -v->Ran 3 tests ... OK🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.