This instruction is only valid if the Mode operand is an execution mode that takes no Extra Operands, or takes Extra Operands that are not <id> operands.
Whereas LocalSizeId as a Mode operand, takes <id> operands:
LocalSizeId Same as the LocalSize Mode, but using <id> operands instead of literals. The operands are consumed as unsigned and each must be an integer type scalar.
Same thing goes for LocalSizeHintId, etc.
Current compilers seem to use WorkgroupSize to achieve this, but that builtin is deprecated in 1.5, and specification recommends LocalSizeId as replacement.
WorkgroupSize
Deprecated (use LocalSizeId Execution Mode instead).
Work-group size in GLCompute or Kernel Execution Models. See the client API specification for more detail.
error: line 4: OpExecutionMode is only valid when the Mode operand is an execution mode that takes no Extra Operands, or takes Extra Operands that are not id operands.
OpExecutionMode %main LocalSizeId %2 %3 %4
OpExecutionMode
specification states:Whereas
LocalSizeId
as a Mode operand, takes<id>
operands:Same thing goes for LocalSizeHintId, etc.
Current compilers seem to use
WorkgroupSize
to achieve this, but that builtin is deprecated in 1.5, and specification recommendsLocalSizeId
as replacement.Minimal code as illustration:
Code emitted by glslc:
The following when assembled and fed to
spirv-val
results in error:spirv-val
gives following error: