Flatten all interface variables (#2217)

Specifically, add flattening of arrayed io for geometry and
tesselation shaders. Previously some interface structs just had
builtins split out which caused some interfaces to not be exactly
the same as that of flattened adjacent stages, affecting validation
and correctness.

This obviates builtin splitting. That will be removed in a followup
commit. It was left in for this commit to better exhibit the functional
changes that were made.

Fixes #1660.
This commit is contained in:
greg-lunarg 2020-05-18 02:13:10 -06:00 committed by GitHub
parent 1a906168cd
commit 7c753a7253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 3325 additions and 1561 deletions

View file

@ -24,15 +24,65 @@ vertex spacing = equal_spacing
0:26 Function Definition: main( ( temp void)
0:26 Function Parameters:
0:? Sequence
0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Sequence
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 0 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 0 (const int)
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 1 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 1 (const int)
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 2 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 2 (const int)
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 3 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 3 (const int)
0:26 Sequence
0:26 move second child to first child ( temp 3-component vector of float)
0:26 indirect index (layout( location=0) out 3-component vector of float)
0:? '@entryPointOutput.cpoint' (layout( location=0) out 4-element array of 3-component vector of float)
0:? 'InvocationId' ( in uint InvocationID)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 0 (const int)
0:? Barrier ( temp void)
0:? Test condition and select ( temp void)
0:? Condition
@ -100,8 +150,8 @@ vertex spacing = equal_spacing
0:38 Branch: Return with expression
0:38 'output' ( temp structure{ temp 2-element array of float edges})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput.cpoint' (layout( location=0) out 4-element array of 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:? 'InvocationId' ( in uint InvocationID)
0:? 'pid' ( in uint PrimitiveID)
0:? 'pos' ( in 4-component vector of float Position)
@ -136,15 +186,65 @@ vertex spacing = equal_spacing
0:26 Function Definition: main( ( temp void)
0:26 Function Parameters:
0:? Sequence
0:26 move second child to first child ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Sequence
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 0 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 0 (const int)
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 1 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 1 (const int)
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 2 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 2 (const int)
0:26 move second child to first child ( temp 3-component vector of float)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 direct index ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 3 (const int)
0:26 Constant:
0:26 0 (const int)
0:26 direct index (layout( location=0) in 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:26 Constant:
0:26 3 (const int)
0:26 Sequence
0:26 move second child to first child ( temp 3-component vector of float)
0:26 indirect index (layout( location=0) out 3-component vector of float)
0:? '@entryPointOutput.cpoint' (layout( location=0) out 4-element array of 3-component vector of float)
0:? 'InvocationId' ( in uint InvocationID)
0:26 cpoint: direct index for structure ( temp 3-component vector of float)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 Constant:
0:26 0 (const int)
0:? Barrier ( temp void)
0:? Test condition and select ( temp void)
0:? Condition
@ -212,8 +312,8 @@ vertex spacing = equal_spacing
0:38 Branch: Return with expression
0:38 'output' ( temp structure{ temp 2-element array of float edges})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput.cpoint' (layout( location=0) out 4-element array of 3-component vector of float)
0:? 'ip.cpoint' (layout( location=0) in 4-element array of 3-component vector of float)
0:? 'InvocationId' ( in uint InvocationID)
0:? 'pid' ( in uint PrimitiveID)
0:? 'pos' ( in 4-component vector of float Position)
@ -221,12 +321,12 @@ vertex spacing = equal_spacing
// Module Version 10000
// Generated by (magic number): 80008
// Id's are bound by 91
// Id's are bound by 106
Capability Tessellation
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 42 46 48 63 65 73
EntryPoint TessellationControl 4 "main" 43 61 63 79 81 89
ExecutionMode 4 OutputVertices 4
ExecutionMode 4 Isolines
ExecutionMode 4 SpacingEqual
@ -245,24 +345,24 @@ vertex spacing = equal_spacing
Name 26 "pos"
Name 30 "output"
Name 40 "ip"
Name 42 "ip"
Name 46 "@entryPointOutput"
Name 48 "InvocationId"
Name 50 "param"
Name 62 "@patchConstantResult"
Name 63 "pid"
Name 65 "pos"
Name 66 "param"
Name 68 "param"
Name 73 "@patchConstantOutput.edges"
Name 83 "output"
Decorate 42(ip) Location 0
Decorate 46(@entryPointOutput) Location 0
Decorate 48(InvocationId) BuiltIn InvocationId
Decorate 63(pid) BuiltIn PrimitiveId
Decorate 65(pos) BuiltIn Position
Decorate 73(@patchConstantOutput.edges) Patch
Decorate 73(@patchConstantOutput.edges) BuiltIn TessLevelOuter
Name 43 "ip.cpoint"
Name 61 "@entryPointOutput.cpoint"
Name 63 "InvocationId"
Name 65 "param"
Name 78 "@patchConstantResult"
Name 79 "pid"
Name 81 "pos"
Name 82 "param"
Name 84 "param"
Name 89 "@patchConstantOutput.edges"
Name 98 "output"
Decorate 43(ip.cpoint) Location 0
Decorate 61(@entryPointOutput.cpoint) Location 0
Decorate 63(InvocationId) BuiltIn InvocationId
Decorate 79(pid) BuiltIn PrimitiveId
Decorate 81(pos) BuiltIn Position
Decorate 89(@patchConstantOutput.edges) Patch
Decorate 89(@patchConstantOutput.edges) BuiltIn TessLevelOuter
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -285,65 +385,83 @@ vertex spacing = equal_spacing
31: TypeInt 32 1
32: 31(int) Constant 0
33: TypePointer Function 7(fvec3)
41: TypePointer Input 11
42(ip): 41(ptr) Variable Input
44: TypeArray 13(HS_OUT) 10
45: TypePointer Output 44
46(@entryPointOutput): 45(ptr) Variable Output
47: TypePointer Input 9(int)
48(InvocationId): 47(ptr) Variable Input
53: TypePointer Output 13(HS_OUT)
55: 9(int) Constant 0
57: TypeBool
61: TypePointer Function 23(HS_CONSTANT_OUT)
63(pid): 47(ptr) Variable Input
64: TypePointer Input 19(fvec4)
65(pos): 64(ptr) Variable Input
71: TypeArray 6(float) 10
72: TypePointer Output 71
73(@patchConstantOutput.edges): 72(ptr) Variable Output
74: TypePointer Function 6(float)
77: TypePointer Output 6(float)
79: 31(int) Constant 1
84: 6(float) Constant 1073741824
86: 6(float) Constant 1090519040
41: TypeArray 7(fvec3) 10
42: TypePointer Input 41
43(ip.cpoint): 42(ptr) Variable Input
44: TypePointer Input 7(fvec3)
48: 31(int) Constant 1
52: 31(int) Constant 2
56: 31(int) Constant 3
60: TypePointer Output 41
61(@entryPointOutput.cpoint): 60(ptr) Variable Output
62: TypePointer Input 9(int)
63(InvocationId): 62(ptr) Variable Input
69: TypePointer Output 7(fvec3)
71: 9(int) Constant 0
73: TypeBool
77: TypePointer Function 23(HS_CONSTANT_OUT)
79(pid): 62(ptr) Variable Input
80: TypePointer Input 19(fvec4)
81(pos): 80(ptr) Variable Input
87: TypeArray 6(float) 10
88: TypePointer Output 87
89(@patchConstantOutput.edges): 88(ptr) Variable Output
90: TypePointer Function 6(float)
93: TypePointer Output 6(float)
99: 6(float) Constant 1073741824
101: 6(float) Constant 1090519040
4(main): 2 Function None 3
5: Label
40(ip): 12(ptr) Variable Function
50(param): 12(ptr) Variable Function
62(@patchConstantResult): 61(ptr) Variable Function
66(param): 18(ptr) Variable Function
68(param): 20(ptr) Variable Function
43: 11 Load 42(ip)
Store 40(ip) 43
49: 9(int) Load 48(InvocationId)
51: 11 Load 40(ip)
Store 50(param) 51
52: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 50(param)
54: 53(ptr) AccessChain 46(@entryPointOutput) 49
Store 54 52
ControlBarrier 21 10 55
56: 9(int) Load 48(InvocationId)
58: 57(bool) IEqual 56 32
SelectionMerge 60 None
BranchConditional 58 59 60
59: Label
67: 9(int) Load 63(pid)
Store 66(param) 67
69: 19(fvec4) Load 65(pos)
Store 68(param) 69
70:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 66(param) 68(param)
Store 62(@patchConstantResult) 70
75: 74(ptr) AccessChain 62(@patchConstantResult) 32 32
76: 6(float) Load 75
78: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 32
Store 78 76
80: 74(ptr) AccessChain 62(@patchConstantResult) 32 79
81: 6(float) Load 80
82: 77(ptr) AccessChain 73(@patchConstantOutput.edges) 79
Store 82 81
Branch 60
60: Label
65(param): 12(ptr) Variable Function
78(@patchConstantResult): 77(ptr) Variable Function
82(param): 18(ptr) Variable Function
84(param): 20(ptr) Variable Function
45: 44(ptr) AccessChain 43(ip.cpoint) 32
46: 7(fvec3) Load 45
47: 33(ptr) AccessChain 40(ip) 32 32
Store 47 46
49: 44(ptr) AccessChain 43(ip.cpoint) 48
50: 7(fvec3) Load 49
51: 33(ptr) AccessChain 40(ip) 48 32
Store 51 50
53: 44(ptr) AccessChain 43(ip.cpoint) 52
54: 7(fvec3) Load 53
55: 33(ptr) AccessChain 40(ip) 52 32
Store 55 54
57: 44(ptr) AccessChain 43(ip.cpoint) 56
58: 7(fvec3) Load 57
59: 33(ptr) AccessChain 40(ip) 56 32
Store 59 58
64: 9(int) Load 63(InvocationId)
66: 11 Load 40(ip)
Store 65(param) 66
67: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 65(param)
68: 7(fvec3) CompositeExtract 67 0
70: 69(ptr) AccessChain 61(@entryPointOutput.cpoint) 64
Store 70 68
ControlBarrier 21 10 71
72: 9(int) Load 63(InvocationId)
74: 73(bool) IEqual 72 32
SelectionMerge 76 None
BranchConditional 74 75 76
75: Label
83: 9(int) Load 79(pid)
Store 82(param) 83
85: 19(fvec4) Load 81(pos)
Store 84(param) 85
86:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 82(param) 84(param)
Store 78(@patchConstantResult) 86
91: 90(ptr) AccessChain 78(@patchConstantResult) 32 32
92: 6(float) Load 91
94: 93(ptr) AccessChain 89(@patchConstantOutput.edges) 32
Store 94 92
95: 90(ptr) AccessChain 78(@patchConstantResult) 32 48
96: 6(float) Load 95
97: 93(ptr) AccessChain 89(@patchConstantOutput.edges) 48
Store 97 96
Branch 76
76: Label
Return
FunctionEnd
16(@main(struct-VS_OUT-vf31[4];): 13(HS_OUT) Function None 14
@ -361,11 +479,11 @@ vertex spacing = equal_spacing
25(pid): 18(ptr) FunctionParameter
26(pos): 20(ptr) FunctionParameter
28: Label
83(output): 61(ptr) Variable Function
85: 74(ptr) AccessChain 83(output) 32 32
Store 85 84
87: 74(ptr) AccessChain 83(output) 32 79
Store 87 86
88:23(HS_CONSTANT_OUT) Load 83(output)
ReturnValue 88
98(output): 77(ptr) Variable Function
100: 90(ptr) AccessChain 98(output) 32 32
Store 100 99
102: 90(ptr) AccessChain 98(output) 32 48
Store 102 101
103:23(HS_CONSTANT_OUT) Load 98(output)
ReturnValue 103
FunctionEnd