KhronosGroup / KhronosGroup/glslang
Extra SpecId when using LocalSizeId for SPIRV 1.6
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
With a shader
```glsl
#version 450
layout(local_size_x_id = 18, local_size_z_id = 19) in;
layout(local_size_x = 32) in;
void main() {}
```
running
```
glslangValidator -V shader.comp --target-env vulkan1.3
```
I am getting
```swift
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionModeId %main LocalSizeId %7 %uint_1 %9
OpSource GLSL 450
OpName %main "main"
OpDecorate %7 SpecId 18
OpDecorate %9 SpecId 19
OpDecorate %10 SpecId 18
OpDecorate %11 SpecId 19
%void = OpTypeVoid
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%7 = OpSpecConstant %uint 32
%uint_1 = OpConstant %uint 1
%9 = OpSpecConstant %uint 1
%10 = OpSpecConstant %uint 32
%11 = OpSpecConstant %uint 1
%v3uint = OpTypeVector %uint 3
%13 = OpSpecConstantComposite %v3uint %10 %uint_1 %11
%main = OpFunction %void None %3
%5 = OpLabel
OpReturn
OpFunctionEnd
```
Where there is a double pair of `OpDecorate %_ SpecId` and the following is not used
```
OpDecorate %10 SpecId 18
OpDecorate %11 SpecId 19
%10 = OpSpecConstant %uint 32
%11 = OpSpecConstant %uint 1
%v3uint = OpTypeVector %uint 3
%13 = OpSpecConstantComposite %v3uint %10 %uint_1 %11
```
----
I see the `spv.1.6.specConstant.comp` test is using `gl_WorkGroupSize` so it makes sense why it needs the `OpSpecConstantComposite` but should probably have a test case that doesn't read from `gl_WorkGroupSize` that sets `LocalSizeId`
Contributor guide
Assessment
This issue has not been assessed yet.