Fix arrays dimensioned with spec constant sized gl_WorkGroupSize
This commit is contained in:
parent
41e39c615b
commit
1464d036b8
@ -4236,6 +4236,8 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra
|
|||||||
glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
|
glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
|
||||||
if (specNode != nullptr) {
|
if (specNode != nullptr) {
|
||||||
builder.clearAccessChain();
|
builder.clearAccessChain();
|
||||||
|
SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
|
||||||
|
spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
|
||||||
specNode->traverse(this);
|
specNode->traverse(this);
|
||||||
return accessChainLoad(specNode->getAsTyped()->getType());
|
return accessChainLoad(specNode->getAsTyped()->getType());
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
spv.noWorkgroup.comp
|
spv.noWorkgroup.comp
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 8000a
|
// Generated by (magic number): 8000a
|
||||||
// Id's are bound by 12
|
// Id's are bound by 23
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
@ -10,6 +10,7 @@ spv.noWorkgroup.comp
|
|||||||
ExecutionMode 4 LocalSize 1 1 1
|
ExecutionMode 4 LocalSize 1 1 1
|
||||||
Source GLSL 450
|
Source GLSL 450
|
||||||
Name 4 "main"
|
Name 4 "main"
|
||||||
|
Name 22 "keys"
|
||||||
Decorate 7 SpecId 18
|
Decorate 7 SpecId 18
|
||||||
Decorate 8 SpecId 10
|
Decorate 8 SpecId 10
|
||||||
Decorate 9 SpecId 19
|
Decorate 9 SpecId 19
|
||||||
@ -22,6 +23,17 @@ spv.noWorkgroup.comp
|
|||||||
9: 6(int) SpecConstant 1
|
9: 6(int) SpecConstant 1
|
||||||
10: TypeVector 6(int) 3
|
10: TypeVector 6(int) 3
|
||||||
11: 10(ivec3) SpecConstantComposite 7 8 9
|
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
|
4(main): 2 Function None 3
|
||||||
5: Label
|
5: Label
|
||||||
Return
|
Return
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
layout(local_size_x_id = 18, local_size_y_id=10,local_size_z_id = 19) in;
|
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()
|
void main()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user