Skip to content

fix void-returning meta_ext_inst SPIR-V emission - #60

Open
abbator wants to merge 67 commits into
shady-gang:mainfrom
abbator:fix-void-ext-inst
Open

fix void-returning meta_ext_inst SPIR-V emission#60
abbator wants to merge 67 commits into
shady-gang:mainfrom
abbator:fix-void-ext-inst

Conversation

@abbator

@abbator abbator commented Jun 10, 2026

Copy link
Copy Markdown

meta_ext_inst unconditionally sets has_result=true in the ExtOpDef, which causes void-returning SPIR-V instructions (e.g. OpImageWrite) to be emitted with a spurious result type and result ID. This produces malformed SPIR-V that fails spirv-val.

Check whether the LLVM return type is void (unit_type) and set has_result=false with result_t=NULL accordingly, so the backend emits spvb_no_result for these instructions.

Hugobros3 and others added 30 commits March 23, 2026 10:46
Currently, only triangle output mode is supported; the corresponding
ExecutionMode annotation is ignored.
Also, it is not technically possible to emit anything yet, as the member
annotations for the position array are not supported yet.
This is a bugfix, we need a size to generate the memory layout.
This change is crucial to getting mesh shaders to work: The way we get
this to work for now is by requiring the input shader do annotate a
struct member with BuiltIn Position so we can pass this field down into
the output shader.
meta_ext_inst unconditionally sets has_result=true in the ExtOpDef,
which causes void-returning SPIR-V instructions (e.g. OpImageWrite) to
be emitted with a spurious result type and result ID. This produces
malformed SPIR-V that fails spirv-val.

Check whether the LLVM return type is void (unit_type) and set
has_result=false with result_t=NULL accordingly, so the backend emits
spvb_no_result for these instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants