HLSL: Fix #1163: treat buffers as references when calling functions.

This continues to prevent writing output buffers (out from a function),
but fixes the problem where the copy-in/out was not getting done.

Making everything work will require knowing both in/out-ness and bufferness,
but these are currently mutually exclusive, because both are storage
qualifiers.
This commit is contained in:
John Kessenich 2017-12-04 02:48:10 -07:00
parent 1f89992423
commit 6a14f78061
4 changed files with 182 additions and 196 deletions

View File

@ -2966,8 +2966,14 @@ bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate*
} }
// Does parameter need a place to keep writes, separate from the original? // Does parameter need a place to keep writes, separate from the original?
// Assumes called after originalParam(), which filters out block/buffer/opaque-based
// qualifiers such that we should have only in/out/inout/constreadonly here.
bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier) bool TGlslangToSpvTraverser::writableParam(glslang::TStorageQualifier qualifier)
{ {
assert(qualifier == glslang::EvqIn ||
qualifier == glslang::EvqOut ||
qualifier == glslang::EvqInOut ||
qualifier == glslang::EvqConstReadOnly);
return qualifier != glslang::EvqConstReadOnly; return qualifier != glslang::EvqConstReadOnly;
} }
@ -2978,7 +2984,7 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier,
if (implicitThisParam) // implicit this if (implicitThisParam) // implicit this
return true; return true;
if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) if (glslangIntermediate->getSource() == glslang::EShSourceHlsl)
return false; return paramType.getBasicType() == glslang::EbtBlock;
return paramType.containsOpaque() || // sampler, etc. return paramType.containsOpaque() || // sampler, etc.
(paramType.getBasicType() == glslang::EbtBlock && qualifier == glslang::EvqBuffer); // SSBO (paramType.getBasicType() == glslang::EbtBlock && qualifier == glslang::EvqBuffer); // SSBO
} }
@ -3609,8 +3615,8 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
glslangArgs[a]->traverse(this); glslangArgs[a]->traverse(this);
argTypes.push_back(&paramType); argTypes.push_back(&paramType);
// keep outputs and pass-by-originals as l-values, evaluate others as r-values // keep outputs and pass-by-originals as l-values, evaluate others as r-values
if (writableParam(qualifiers[a]) || if (originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0) ||
originalParam(qualifiers[a], paramType, function->hasImplicitThis() && a == 0)) { writableParam(qualifiers[a])) {
// save l-value // save l-value
lValues.push_back(builder.getAccessChain()); lValues.push_back(builder.getAccessChain());
} else { } else {

View File

@ -151,12 +151,12 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80002 // Generated by (magic number): 80002
// Id's are bound by 76 // Id's are bound by 70
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 64 67 EntryPoint Fragment 4 "main" 58 61
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
@ -171,55 +171,51 @@ gl_FragCoord origin is upper left
Name 18 "arg_c@count" Name 18 "arg_c@count"
Name 25 "@main(u1;" Name 25 "@main(u1;"
Name 24 "pos" Name 24 "pos"
Name 50 "sbuf_a" Name 49 "sbuf_a"
Name 52 "sbuf_a@count" Name 50 "sbuf_a@count"
Name 53 "sbuf_c" Name 51 "sbuf_c"
Name 54 "sbuf_c@count" Name 52 "sbuf_c@count"
Name 55 "param" Name 56 "pos"
Name 56 "param" Name 58 "pos"
Name 57 "param" Name 61 "@entryPointOutput"
Name 58 "param" Name 62 "param"
Name 62 "pos" Name 65 "sbuf_a@count"
Name 64 "pos" MemberName 65(sbuf_a@count) 0 "@count"
Name 67 "@entryPointOutput" Name 67 "sbuf_a@count"
Name 68 "param" Name 68 "sbuf_c@count"
Name 71 "sbuf_a@count" Name 69 "sbuf_unused"
MemberName 71(sbuf_a@count) 0 "@count"
Name 73 "sbuf_a@count"
Name 74 "sbuf_c@count"
Name 75 "sbuf_unused"
Decorate 8 ArrayStride 16 Decorate 8 ArrayStride 16
MemberDecorate 9 0 Offset 0 MemberDecorate 9 0 Offset 0
Decorate 9 BufferBlock Decorate 9 BufferBlock
Decorate 12 BufferBlock Decorate 12 BufferBlock
Decorate 50(sbuf_a) DescriptorSet 0 Decorate 49(sbuf_a) DescriptorSet 0
Decorate 52(sbuf_a@count) DescriptorSet 0 Decorate 50(sbuf_a@count) DescriptorSet 0
Decorate 53(sbuf_c) DescriptorSet 0 Decorate 51(sbuf_c) DescriptorSet 0
Decorate 54(sbuf_c@count) DescriptorSet 0 Decorate 52(sbuf_c@count) DescriptorSet 0
Decorate 64(pos) Flat Decorate 58(pos) Flat
Decorate 64(pos) Location 0 Decorate 58(pos) Location 0
Decorate 67(@entryPointOutput) Location 0 Decorate 61(@entryPointOutput) Location 0
MemberDecorate 71(sbuf_a@count) 0 Offset 0 MemberDecorate 65(sbuf_a@count) 0 Offset 0
Decorate 71(sbuf_a@count) BufferBlock Decorate 65(sbuf_a@count) BufferBlock
Decorate 73(sbuf_a@count) DescriptorSet 0 Decorate 67(sbuf_a@count) DescriptorSet 0
Decorate 74(sbuf_c@count) DescriptorSet 0 Decorate 68(sbuf_c@count) DescriptorSet 0
Decorate 75(sbuf_unused) DescriptorSet 0 Decorate 69(sbuf_unused) DescriptorSet 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
7: TypeVector 6(float) 4 7: TypeVector 6(float) 4
8: TypeRuntimeArray 7(fvec4) 8: TypeRuntimeArray 7(fvec4)
9: TypeStruct 8 9: TypeStruct 8
10: TypePointer Function 9(struct) 10: TypePointer Uniform 9(struct)
11: TypeInt 32 1 11: TypeInt 32 1
12: TypeStruct 11(int) 12: TypeStruct 11(int)
13: TypePointer Function 12(struct) 13: TypePointer Uniform 12(struct)
14: TypeFunction 7(fvec4) 10(ptr) 13(ptr) 10(ptr) 13(ptr) 14: TypeFunction 7(fvec4) 10(ptr) 13(ptr) 10(ptr) 13(ptr)
21: TypeInt 32 0 21: TypeInt 32 0
22: TypePointer Function 21(int) 22: TypePointer Function 21(int)
23: TypeFunction 7(fvec4) 22(ptr) 23: TypeFunction 7(fvec4) 22(ptr)
27: 11(int) Constant 0 27: 11(int) Constant 0
28: TypePointer Function 11(int) 28: TypePointer Uniform 11(int)
30: 11(int) Constant 1 30: 11(int) Constant 1
31: 21(int) Constant 1 31: 21(int) Constant 1
32: 21(int) Constant 0 32: 21(int) Constant 0
@ -228,33 +224,31 @@ gl_FragCoord origin is upper left
36: 6(float) Constant 1077936128 36: 6(float) Constant 1077936128
37: 6(float) Constant 1082130432 37: 6(float) Constant 1082130432
38: 7(fvec4) ConstantComposite 34 35 36 37 38: 7(fvec4) ConstantComposite 34 35 36 37
39: TypePointer Function 7(fvec4) 39: TypePointer Uniform 7(fvec4)
42: 11(int) Constant 4294967295 42: 11(int) Constant 4294967295
49: TypePointer Uniform 9(struct) 49(sbuf_a): 10(ptr) Variable Uniform
50(sbuf_a): 49(ptr) Variable Uniform 50(sbuf_a@count): 13(ptr) Variable Uniform
51: TypePointer Uniform 12(struct) 51(sbuf_c): 10(ptr) Variable Uniform
52(sbuf_a@count): 51(ptr) Variable Uniform 52(sbuf_c@count): 13(ptr) Variable Uniform
53(sbuf_c): 49(ptr) Variable Uniform 57: TypePointer Input 21(int)
54(sbuf_c@count): 51(ptr) Variable Uniform 58(pos): 57(ptr) Variable Input
63: TypePointer Input 21(int) 60: TypePointer Output 7(fvec4)
64(pos): 63(ptr) Variable Input 61(@entryPointOutput): 60(ptr) Variable Output
66: TypePointer Output 7(fvec4) 65(sbuf_a@count): TypeStruct 11(int)
67(@entryPointOutput): 66(ptr) Variable Output 66: TypePointer Uniform 65(sbuf_a@count)
71(sbuf_a@count): TypeStruct 11(int) 67(sbuf_a@count): 66(ptr) Variable Uniform
72: TypePointer Uniform 71(sbuf_a@count) 68(sbuf_c@count): 66(ptr) Variable Uniform
73(sbuf_a@count): 72(ptr) Variable Uniform 69(sbuf_unused): 10(ptr) Variable Uniform
74(sbuf_c@count): 72(ptr) Variable Uniform
75(sbuf_unused): 49(ptr) Variable Uniform
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
62(pos): 22(ptr) Variable Function 56(pos): 22(ptr) Variable Function
68(param): 22(ptr) Variable Function 62(param): 22(ptr) Variable Function
65: 21(int) Load 64(pos) 59: 21(int) Load 58(pos)
Store 62(pos) 65 Store 56(pos) 59
69: 21(int) Load 62(pos) 63: 21(int) Load 56(pos)
Store 68(param) 69 Store 62(param) 63
70: 7(fvec4) FunctionCall 25(@main(u1;) 68(param) 64: 7(fvec4) FunctionCall 25(@main(u1;) 62(param)
Store 67(@entryPointOutput) 70 Store 61(@entryPointOutput) 64
Return Return
FunctionEnd FunctionEnd
19(Fn2(block--vf4[0]1;block--vf4[0]1;): 7(fvec4) Function None 14 19(Fn2(block--vf4[0]1;block--vf4[0]1;): 7(fvec4) Function None 14
@ -277,10 +271,6 @@ gl_FragCoord origin is upper left
25(@main(u1;): 7(fvec4) Function None 23 25(@main(u1;): 7(fvec4) Function None 23
24(pos): 22(ptr) FunctionParameter 24(pos): 22(ptr) FunctionParameter
26: Label 26: Label
55(param): 10(ptr) Variable Function 53: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 49(sbuf_a) 50(sbuf_a@count) 51(sbuf_c) 52(sbuf_c@count)
56(param): 13(ptr) Variable Function ReturnValue 53
57(param): 10(ptr) Variable Function
58(param): 13(ptr) Variable Function
59: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 55(param) 56(param) 57(param) 58(param)
ReturnValue 59
FunctionEnd FunctionEnd

View File

@ -139,12 +139,12 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80002 // Generated by (magic number): 80002
// Id's are bound by 83 // Id's are bound by 78
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 68 71 EntryPoint Fragment 4 "main" 63 66
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
@ -165,24 +165,21 @@ gl_FragCoord origin is upper left
Name 35 "@main(u1;" Name 35 "@main(u1;"
Name 34 "pos" Name 34 "pos"
Name 47 "sbuf2" Name 47 "sbuf2"
Name 49 "sbuf2@count" Name 48 "sbuf2@count"
Name 52 "sbuf" Name 50 "sbuf"
Name 52 "param"
Name 54 "param" Name 54 "param"
Name 55 "param" Name 55 "param"
Name 57 "param" Name 61 "pos"
Name 58 "param" Name 63 "pos"
Name 59 "param" Name 66 "@entryPointOutput"
Name 60 "param" Name 67 "param"
Name 66 "pos" Name 70 "sbuf2@count"
Name 68 "pos" MemberName 70(sbuf2@count) 0 "@count"
Name 71 "@entryPointOutput" Name 72 "sbuf2@count"
Name 72 "param" Name 75 "sbuf3"
Name 75 "sbuf2@count" MemberName 75(sbuf3) 0 "@data"
MemberName 75(sbuf2@count) 0 "@count" Name 77 "sbuf3"
Name 77 "sbuf2@count"
Name 80 "sbuf3"
MemberName 80(sbuf3) 0 "@data"
Name 82 "sbuf3"
Decorate 8 ArrayStride 16 Decorate 8 ArrayStride 16
MemberDecorate 9 0 NonWritable MemberDecorate 9 0 NonWritable
MemberDecorate 9 0 Offset 0 MemberDecorate 9 0 Offset 0
@ -193,74 +190,72 @@ gl_FragCoord origin is upper left
Decorate 18 BufferBlock Decorate 18 BufferBlock
Decorate 21 BufferBlock Decorate 21 BufferBlock
Decorate 47(sbuf2) DescriptorSet 0 Decorate 47(sbuf2) DescriptorSet 0
Decorate 49(sbuf2@count) DescriptorSet 0 Decorate 48(sbuf2@count) DescriptorSet 0
Decorate 52(sbuf) DescriptorSet 0 Decorate 50(sbuf) DescriptorSet 0
Decorate 52(sbuf) Binding 10 Decorate 50(sbuf) Binding 10
Decorate 68(pos) Flat Decorate 63(pos) Flat
Decorate 68(pos) Location 0 Decorate 63(pos) Location 0
Decorate 71(@entryPointOutput) Location 0 Decorate 66(@entryPointOutput) Location 0
MemberDecorate 75(sbuf2@count) 0 Offset 0 MemberDecorate 70(sbuf2@count) 0 Offset 0
Decorate 75(sbuf2@count) BufferBlock Decorate 70(sbuf2@count) BufferBlock
Decorate 77(sbuf2@count) DescriptorSet 0 Decorate 72(sbuf2@count) DescriptorSet 0
Decorate 79 ArrayStride 16 Decorate 74 ArrayStride 16
MemberDecorate 80(sbuf3) 0 NonWritable MemberDecorate 75(sbuf3) 0 NonWritable
MemberDecorate 80(sbuf3) 0 Offset 0 MemberDecorate 75(sbuf3) 0 Offset 0
Decorate 80(sbuf3) BufferBlock Decorate 75(sbuf3) BufferBlock
Decorate 82(sbuf3) DescriptorSet 0 Decorate 77(sbuf3) DescriptorSet 0
Decorate 82(sbuf3) Binding 12 Decorate 77(sbuf3) Binding 12
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 0 6: TypeInt 32 0
7: TypeVector 6(int) 4 7: TypeVector 6(int) 4
8: TypeRuntimeArray 7(ivec4) 8: TypeRuntimeArray 7(ivec4)
9: TypeStruct 8 9: TypeStruct 8
10: TypePointer Function 9(struct) 10: TypePointer Uniform 9(struct)
11: TypePointer Function 6(int) 11: TypePointer Function 6(int)
12: TypeFunction 7(ivec4) 10(ptr) 11(ptr) 12: TypeFunction 7(ivec4) 10(ptr) 11(ptr)
17: TypeRuntimeArray 7(ivec4) 17: TypeRuntimeArray 7(ivec4)
18: TypeStruct 17 18: TypeStruct 17
19: TypePointer Function 18(struct) 19: TypePointer Uniform 18(struct)
20: TypeInt 32 1 20: TypeInt 32 1
21: TypeStruct 20(int) 21: TypeStruct 20(int)
22: TypePointer Function 21(struct) 22: TypePointer Uniform 21(struct)
23: TypePointer Function 7(ivec4) 23: TypePointer Function 7(ivec4)
24: TypeFunction 2 19(ptr) 22(ptr) 11(ptr) 23(ptr) 24: TypeFunction 2 19(ptr) 22(ptr) 11(ptr) 23(ptr)
31: TypeFloat 32 31: TypeFloat 32
32: TypeVector 31(float) 4 32: TypeVector 31(float) 4
33: TypeFunction 32(fvec4) 11(ptr) 33: TypeFunction 32(fvec4) 11(ptr)
37: 20(int) Constant 0 37: 20(int) Constant 0
46: TypePointer Uniform 18(struct) 39: TypePointer Uniform 7(ivec4)
47(sbuf2): 46(ptr) Variable Uniform 47(sbuf2): 19(ptr) Variable Uniform
48: TypePointer Uniform 21(struct) 48(sbuf2@count): 22(ptr) Variable Uniform
49(sbuf2@count): 48(ptr) Variable Uniform 49: 6(int) Constant 2
50: 6(int) Constant 2 50(sbuf): 10(ptr) Variable Uniform
51: TypePointer Uniform 9(struct) 51: 6(int) Constant 3
52(sbuf): 51(ptr) Variable Uniform 57: 31(float) Constant 0
53: 6(int) Constant 3 58: 32(fvec4) ConstantComposite 57 57 57 57
62: 31(float) Constant 0 62: TypePointer Input 6(int)
63: 32(fvec4) ConstantComposite 62 62 62 62 63(pos): 62(ptr) Variable Input
67: TypePointer Input 6(int) 65: TypePointer Output 32(fvec4)
68(pos): 67(ptr) Variable Input 66(@entryPointOutput): 65(ptr) Variable Output
70: TypePointer Output 32(fvec4) 70(sbuf2@count): TypeStruct 20(int)
71(@entryPointOutput): 70(ptr) Variable Output 71: TypePointer Uniform 70(sbuf2@count)
75(sbuf2@count): TypeStruct 20(int) 72(sbuf2@count): 71(ptr) Variable Uniform
76: TypePointer Uniform 75(sbuf2@count) 73: TypeVector 6(int) 3
77(sbuf2@count): 76(ptr) Variable Uniform 74: TypeRuntimeArray 73(ivec3)
78: TypeVector 6(int) 3 75(sbuf3): TypeStruct 74
79: TypeRuntimeArray 78(ivec3) 76: TypePointer Uniform 75(sbuf3)
80(sbuf3): TypeStruct 79 77(sbuf3): 76(ptr) Variable Uniform
81: TypePointer Uniform 80(sbuf3)
82(sbuf3): 81(ptr) Variable Uniform
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
66(pos): 11(ptr) Variable Function 61(pos): 11(ptr) Variable Function
72(param): 11(ptr) Variable Function 67(param): 11(ptr) Variable Function
69: 6(int) Load 68(pos) 64: 6(int) Load 63(pos)
Store 66(pos) 69 Store 61(pos) 64
73: 6(int) Load 66(pos) 68: 6(int) Load 61(pos)
Store 72(param) 73 Store 67(param) 68
74: 32(fvec4) FunctionCall 35(@main(u1;) 72(param) 69: 32(fvec4) FunctionCall 35(@main(u1;) 67(param)
Store 71(@entryPointOutput) 74 Store 66(@entryPointOutput) 69
Return Return
FunctionEnd FunctionEnd
15(get(block--vu4[0]1;u1;): 7(ivec4) Function None 12 15(get(block--vu4[0]1;u1;): 7(ivec4) Function None 12
@ -268,9 +263,9 @@ gl_FragCoord origin is upper left
14(bufferOffset): 11(ptr) FunctionParameter 14(bufferOffset): 11(ptr) FunctionParameter
16: Label 16: Label
38: 6(int) Load 14(bufferOffset) 38: 6(int) Load 14(bufferOffset)
39: 23(ptr) AccessChain 13(sb) 37 38 40: 39(ptr) AccessChain 13(sb) 37 38
40: 7(ivec4) Load 39 41: 7(ivec4) Load 40
ReturnValue 40 ReturnValue 41
FunctionEnd FunctionEnd
29(set(block--vu4[0]1;u1;vu4;): 2 Function None 24 29(set(block--vu4[0]1;u1;vu4;): 2 Function None 24
25(sb): 19(ptr) FunctionParameter 25(sb): 19(ptr) FunctionParameter
@ -278,25 +273,22 @@ gl_FragCoord origin is upper left
27(bufferOffset): 11(ptr) FunctionParameter 27(bufferOffset): 11(ptr) FunctionParameter
28(data): 23(ptr) FunctionParameter 28(data): 23(ptr) FunctionParameter
30: Label 30: Label
43: 6(int) Load 27(bufferOffset) 44: 6(int) Load 27(bufferOffset)
44: 7(ivec4) Load 28(data) 45: 7(ivec4) Load 28(data)
45: 23(ptr) AccessChain 25(sb) 37 43 46: 39(ptr) AccessChain 25(sb) 37 44
Store 45 44 Store 46 45
Return Return
FunctionEnd FunctionEnd
35(@main(u1;): 32(fvec4) Function None 33 35(@main(u1;): 32(fvec4) Function None 33
34(pos): 11(ptr) FunctionParameter 34(pos): 11(ptr) FunctionParameter
36: Label 36: Label
54(param): 10(ptr) Variable Function 52(param): 11(ptr) Variable Function
55(param): 11(ptr) Variable Function 54(param): 11(ptr) Variable Function
57(param): 19(ptr) Variable Function 55(param): 23(ptr) Variable Function
58(param): 22(ptr) Variable Function Store 52(param) 51
59(param): 11(ptr) Variable Function 53: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 50(sbuf) 52(param)
60(param): 23(ptr) Variable Function Store 54(param) 49
Store 55(param) 53 Store 55(param) 53
56: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 54(param) 55(param) 56: 2 FunctionCall 29(set(block--vu4[0]1;u1;vu4;) 47(sbuf2) 48(sbuf2@count) 54(param) 55(param)
Store 59(param) 50 ReturnValue 58
Store 60(param) 56
61: 2 FunctionCall 29(set(block--vu4[0]1;u1;vu4;) 57(param) 58(param) 59(param) 60(param)
ReturnValue 63
FunctionEnd FunctionEnd

View File

@ -135,14 +135,14 @@ local_size = (256, 1, 1)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80002 // Generated by (magic number): 80002
// Id's are bound by 62 // Id's are bound by 61
Capability Shader Capability Shader
Capability ImageBuffer Capability ImageBuffer
Capability StorageImageExtendedFormats Capability StorageImageExtendedFormats
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 57 EntryPoint GLCompute 4 "main" 56
ExecutionMode 4 LocalSize 256 1 1 ExecutionMode 4 LocalSize 256 1 1
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
@ -155,14 +155,13 @@ local_size = (256, 1, 1)
Name 18 "dispatchId" Name 18 "dispatchId"
Name 22 "result" Name 22 "result"
Name 25 "byteAddrTemp" Name 25 "byteAddrTemp"
Name 42 "result" Name 43 "result"
Name 44 "g_input" Name 44 "g_input"
Name 45 "param" Name 45 "param"
Name 47 "param" Name 50 "g_output"
Name 51 "g_output" Name 54 "dispatchId"
Name 55 "dispatchId" Name 56 "dispatchId"
Name 57 "dispatchId" Name 58 "param"
Name 59 "param"
Decorate 8 ArrayStride 4 Decorate 8 ArrayStride 4
MemberDecorate 9 0 NonWritable MemberDecorate 9 0 NonWritable
MemberDecorate 9 0 Offset 0 MemberDecorate 9 0 Offset 0
@ -170,16 +169,16 @@ local_size = (256, 1, 1)
Decorate 14(buffer) NonWritable Decorate 14(buffer) NonWritable
Decorate 44(g_input) DescriptorSet 0 Decorate 44(g_input) DescriptorSet 0
Decorate 44(g_input) Binding 0 Decorate 44(g_input) Binding 0
Decorate 51(g_output) DescriptorSet 0 Decorate 50(g_output) DescriptorSet 0
Decorate 51(g_output) Binding 1 Decorate 50(g_output) Binding 1
Decorate 57(dispatchId) BuiltIn GlobalInvocationId Decorate 56(dispatchId) BuiltIn GlobalInvocationId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 0 6: TypeInt 32 0
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
8: TypeRuntimeArray 6(int) 8: TypeRuntimeArray 6(int)
9: TypeStruct 8 9: TypeStruct 8
10: TypePointer Function 9(struct) 10: TypePointer Uniform 9(struct)
11: TypeVector 6(int) 2 11: TypeVector 6(int) 2
12: TypeFunction 11(ivec2) 7(ptr) 10(ptr) 12: TypeFunction 11(ivec2) 7(ptr) 10(ptr)
17: TypeFunction 2 7(ptr) 17: TypeFunction 2 7(ptr)
@ -188,23 +187,23 @@ local_size = (256, 1, 1)
24: TypePointer Function 23(int) 24: TypePointer Function 23(int)
27: 23(int) Constant 2 27: 23(int) Constant 2
29: 23(int) Constant 0 29: 23(int) Constant 0
34: 23(int) Constant 1 31: TypePointer Uniform 6(int)
43: TypePointer Uniform 9(struct) 35: 23(int) Constant 1
44(g_input): 43(ptr) Variable Uniform 44(g_input): 10(ptr) Variable Uniform
49: TypeImage 6(int) Buffer nonsampled format:Rg32ui 48: TypeImage 6(int) Buffer nonsampled format:Rg32ui
50: TypePointer UniformConstant 49 49: TypePointer UniformConstant 48
51(g_output): 50(ptr) Variable UniformConstant 50(g_output): 49(ptr) Variable UniformConstant
56: TypePointer Input 6(int) 55: TypePointer Input 6(int)
57(dispatchId): 56(ptr) Variable Input 56(dispatchId): 55(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
55(dispatchId): 7(ptr) Variable Function 54(dispatchId): 7(ptr) Variable Function
59(param): 7(ptr) Variable Function 58(param): 7(ptr) Variable Function
58: 6(int) Load 57(dispatchId) 57: 6(int) Load 56(dispatchId)
Store 55(dispatchId) 58 Store 54(dispatchId) 57
60: 6(int) Load 55(dispatchId) 59: 6(int) Load 54(dispatchId)
Store 59(param) 60 Store 58(param) 59
61: 2 FunctionCall 19(@main(u1;) 59(param) 60: 2 FunctionCall 19(@main(u1;) 58(param)
Return Return
FunctionEnd FunctionEnd
15(testLoad(u1;block--u1[0]1;): 11(ivec2) Function None 12 15(testLoad(u1;block--u1[0]1;): 11(ivec2) Function None 12
@ -217,30 +216,29 @@ local_size = (256, 1, 1)
28: 23(int) ShiftRightLogical 26 27 28: 23(int) ShiftRightLogical 26 27
Store 25(byteAddrTemp) 28 Store 25(byteAddrTemp) 28
30: 23(int) Load 25(byteAddrTemp) 30: 23(int) Load 25(byteAddrTemp)
31: 7(ptr) AccessChain 14(buffer) 29 30 32: 31(ptr) AccessChain 14(buffer) 29 30
32: 6(int) Load 31 33: 6(int) Load 32
33: 23(int) Load 25(byteAddrTemp) 34: 23(int) Load 25(byteAddrTemp)
35: 23(int) IAdd 33 34 36: 23(int) IAdd 34 35
36: 7(ptr) AccessChain 14(buffer) 29 35 37: 31(ptr) AccessChain 14(buffer) 29 36
37: 6(int) Load 36 38: 6(int) Load 37
38: 11(ivec2) CompositeConstruct 32 37 39: 11(ivec2) CompositeConstruct 33 38
Store 22(result) 38 Store 22(result) 39
39: 11(ivec2) Load 22(result) 40: 11(ivec2) Load 22(result)
ReturnValue 39 ReturnValue 40
FunctionEnd FunctionEnd
19(@main(u1;): 2 Function None 17 19(@main(u1;): 2 Function None 17
18(dispatchId): 7(ptr) FunctionParameter 18(dispatchId): 7(ptr) FunctionParameter
20: Label 20: Label
42(result): 21(ptr) Variable Function 43(result): 21(ptr) Variable Function
45(param): 7(ptr) Variable Function 45(param): 7(ptr) Variable Function
47(param): 10(ptr) Variable Function
46: 6(int) Load 18(dispatchId) 46: 6(int) Load 18(dispatchId)
Store 45(param) 46 Store 45(param) 46
48: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 47(param) 47: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 44(g_input)
Store 42(result) 48 Store 43(result) 47
52: 49 Load 51(g_output) 51: 48 Load 50(g_output)
53: 6(int) Load 18(dispatchId) 52: 6(int) Load 18(dispatchId)
54: 11(ivec2) Load 42(result) 53: 11(ivec2) Load 43(result)
ImageWrite 52 53 54 ImageWrite 51 52 53
Return Return
FunctionEnd FunctionEnd