KhronosGroup / KhronosGroup/SPIRV-Registry
SPIR-V environment: Validation rules rule out linkable modules with unknown WorkgroupSize
- Dominant language
- HTML
- Stars
- 149
- Forks
- 99
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 2
Description
The following rule:
> VUID-WorkgroupSize-WorkgroupSize-04426
> The variable decorated with WorkgroupSize must be a specialization constant or a constant
prevents creating a shader module that refers to an indeterminate workgroup size. It forces the use of (spec) constants which is problematic since you cannot encode a constant with no value, and specifying a bogus sentinel value like (0,0,0) is also ruled out. This runs into conflict with what the SPIR-V spec suggests: (emphasis mine)
> Workgroup: The set of invocations partitioned in some execution models (e.g. GLCompute, Kernel) as a
workgroup. Its size is defined statically by either the WorkgroupSize built-in or the LocalSize or
LocalSizeId Execution Modes, or can be _queried_ via the WorkgroupSize built-in.
that we can _query_ the workgroup size, without defining it.
For clarity this issue concerns shader modules using the `Linkage` capability, _not_ modules fit for direct consumption by a Vulkan application.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing VUID-WorkgroupSize-WorkgroupSize-04426 alongside the cited SPIR-V Workgroup definition and the Linkage capability context. Determine how validation should handle linkable modules whose workgroup size is queried rather than defined; done means resolving the conflict without weakening validation for modules intended for direct Vulkan consumption.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100