diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 81aacd11..1d8f1994 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -4236,6 +4236,8 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim); if (specNode != nullptr) { builder.clearAccessChain(); + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); specNode->traverse(this); return accessChainLoad(specNode->getAsTyped()->getType()); } diff --git a/Test/baseResults/spv.noWorkgroup.comp.out b/Test/baseResults/spv.noWorkgroup.comp.out index 9cd130c0..a8969e02 100644 --- a/Test/baseResults/spv.noWorkgroup.comp.out +++ b/Test/baseResults/spv.noWorkgroup.comp.out @@ -1,7 +1,7 @@ spv.noWorkgroup.comp // Module Version 10000 // Generated by (magic number): 8000a -// Id's are bound by 12 +// Id's are bound by 23 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -10,6 +10,7 @@ spv.noWorkgroup.comp ExecutionMode 4 LocalSize 1 1 1 Source GLSL 450 Name 4 "main" + Name 22 "keys" Decorate 7 SpecId 18 Decorate 8 SpecId 10 Decorate 9 SpecId 19 @@ -22,6 +23,17 @@ spv.noWorkgroup.comp 9: 6(int) SpecConstant 1 10: TypeVector 6(int) 3 11: 10(ivec3) SpecConstantComposite 7 8 9 + 12: 6(int) Constant 0 + 13: 6(int) SpecConstantOp 81 11 0 + 14: 6(int) Constant 1 + 15: 6(int) SpecConstantOp 81 11 1(GLSL.std.450) + 16: 6(int) SpecConstantOp 132 13 15 + 17: TypeArray 6(int) 16 + 18: 6(int) Constant 2 + 19: 6(int) SpecConstantOp 81 11 2 + 20: TypeArray 17 19 + 21: TypePointer Workgroup 20 + 22(keys): 21(ptr) Variable Workgroup 4(main): 2 Function None 3 5: Label Return diff --git a/Test/spv.noWorkgroup.comp b/Test/spv.noWorkgroup.comp index 0c77f278..37df3887 100644 --- a/Test/spv.noWorkgroup.comp +++ b/Test/spv.noWorkgroup.comp @@ -2,6 +2,8 @@ layout(local_size_x_id = 18, local_size_y_id=10,local_size_z_id = 19) in; +shared uint keys[gl_WorkGroupSize.z][gl_WorkGroupSize.x * gl_WorkGroupSize.y]; + void main() { }