microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] Allow thread group size to be specified with specialization constants
@s-perron is already working on this.
Since Aug 22, 2024.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
In glsl it's possible to set the thread group / work group size for compute shaders via specialization constants. This allows an application to use different sizes depending e.g. on the hardware limits, without the need for different shaders.
The GL_ARB_gl_spirv extension added explicit qualifiers for this:
"The built-in constant vector gl_WorkGroupSize can be specialized using
the local_size_{xyz}_id qualifiers, to individually give the components
an id. For example:layout(local_size_x_id = 18, local_size_z_id = 19) in;
There doesn't seem to be an equivalent of this for HLSL to SPIR-V right now.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.