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

@ -22,19 +22,57 @@ triangle order = cw
0:27 Function Definition: main( ( temp void)
0:27 Function Parameters:
0:? Sequence
0:27 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
0:27 Sequence
0:27 move second child to first child ( temp 3-component vector of float)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 direct index ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index (layout( location=0) in 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:27 Constant:
0:27 0 (const int)
0:27 move second child to first child ( temp 3-component vector of float)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 direct index ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:27 Constant:
0:27 1 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index (layout( location=0) in 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:27 Constant:
0:27 1 (const int)
0:27 move second child to first child ( temp 3-component vector of float)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 direct index ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:27 Constant:
0:27 2 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index (layout( location=0) in 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:27 Constant:
0:27 2 (const int)
0:27 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:27 move second child to first child ( temp structure{ temp 3-component vector of float val})
0:27 indirect index (layout( location=0) out structure{ temp 3-component vector of float val})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( in uint InvocationID)
0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( temp uint)
0:27 Sequence
0:27 move second child to first child ( temp 3-component vector of float)
0:27 indirect index (layout( location=0) out 3-component vector of float)
0:? '@entryPointOutput.val' (layout( location=0) out 3-element array of 3-component vector of float)
0:? 'cpid' ( in uint InvocationID)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( temp uint)
0:27 Constant:
0:27 0 (const int)
0:? Barrier ( temp void)
0:? Test condition and select ( temp void)
0:? Condition
@ -189,8 +227,8 @@ triangle order = cw
0:42 Branch: Return with expression
0:42 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
0:? '@entryPointOutput.val' (layout( location=0) out 3-element array of 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:? 'cpid' ( in uint InvocationID)
0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter)
0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner)
@ -222,19 +260,57 @@ triangle order = cw
0:27 Function Definition: main( ( temp void)
0:27 Function Parameters:
0:? Sequence
0:27 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
0:27 Sequence
0:27 move second child to first child ( temp 3-component vector of float)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 direct index ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index (layout( location=0) in 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:27 Constant:
0:27 0 (const int)
0:27 move second child to first child ( temp 3-component vector of float)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 direct index ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:27 Constant:
0:27 1 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index (layout( location=0) in 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:27 Constant:
0:27 1 (const int)
0:27 move second child to first child ( temp 3-component vector of float)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 direct index ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:27 Constant:
0:27 2 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index (layout( location=0) in 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:27 Constant:
0:27 2 (const int)
0:27 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:27 move second child to first child ( temp structure{ temp 3-component vector of float val})
0:27 indirect index (layout( location=0) out structure{ temp 3-component vector of float val})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( in uint InvocationID)
0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( temp uint)
0:27 Sequence
0:27 move second child to first child ( temp 3-component vector of float)
0:27 indirect index (layout( location=0) out 3-component vector of float)
0:? '@entryPointOutput.val' (layout( location=0) out 3-element array of 3-component vector of float)
0:? 'cpid' ( in uint InvocationID)
0:27 val: direct index for structure ( temp 3-component vector of float)
0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( temp uint)
0:27 Constant:
0:27 0 (const int)
0:? Barrier ( temp void)
0:? Test condition and select ( temp void)
0:? Condition
@ -389,20 +465,20 @@ triangle order = cw
0:42 Branch: Return with expression
0:42 'o' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor})
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
0:? '@entryPointOutput.val' (layout( location=0) out 3-element array of 3-component vector of float)
0:? 'i.val' (layout( location=0) in 3-element array of 3-component vector of float)
0:? 'cpid' ( in uint InvocationID)
0:? '@patchConstantOutput.tfactor' ( patch out 4-element array of float TessLevelOuter)
0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
// Generated by (magic number): 80008
// Id's are bound by 124
// Id's are bound by 135
Capability Tessellation
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 41 45 48 94 108
EntryPoint TessellationControl 4 "main" 42 57 60 105 119
ExecutionMode 4 OutputVertices 3
ExecutionMode 4 Triangles
ExecutionMode 4 SpacingFractionalOdd
@ -423,33 +499,33 @@ triangle order = cw
Name 24 "pcf_out"
Name 28 "o"
Name 39 "i"
Name 41 "i"
Name 43 "cpid"
Name 45 "cpid"
Name 48 "@entryPointOutput"
Name 50 "param"
Name 52 "param"
Name 66 "pcf_out"
Name 67 "i"
Name 68 "param"
Name 70 "param"
Name 74 "i"
Name 76 "param"
Name 78 "param"
Name 82 "i"
Name 42 "i.val"
Name 55 "cpid"
Name 57 "cpid"
Name 60 "@entryPointOutput.val"
Name 62 "param"
Name 64 "param"
Name 79 "pcf_out"
Name 80 "i"
Name 81 "param"
Name 83 "param"
Name 85 "param"
Name 89 "@patchConstantResult"
Name 94 "@patchConstantOutput.tfactor"
Name 108 "@patchConstantOutput.flInFactor"
Name 112 "o"
Decorate 41(i) Location 0
Decorate 45(cpid) BuiltIn InvocationId
Decorate 48(@entryPointOutput) Location 0
Decorate 94(@patchConstantOutput.tfactor) Patch
Decorate 94(@patchConstantOutput.tfactor) BuiltIn TessLevelOuter
Decorate 108(@patchConstantOutput.flInFactor) Patch
Decorate 108(@patchConstantOutput.flInFactor) BuiltIn TessLevelInner
Name 86 "i"
Name 88 "param"
Name 90 "param"
Name 93 "i"
Name 94 "param"
Name 96 "param"
Name 100 "@patchConstantResult"
Name 105 "@patchConstantOutput.tfactor"
Name 119 "@patchConstantOutput.flInFactor"
Name 123 "o"
Decorate 42(i.val) Location 0
Decorate 57(cpid) BuiltIn InvocationId
Decorate 60(@entryPointOutput.val) Location 0
Decorate 105(@patchConstantOutput.tfactor) Patch
Decorate 105(@patchConstantOutput.tfactor) BuiltIn TessLevelOuter
Decorate 119(@patchConstantOutput.flInFactor) Patch
Decorate 119(@patchConstantOutput.flInFactor) BuiltIn TessLevelInner
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -470,105 +546,118 @@ triangle order = cw
29: TypeInt 32 1
30: 29(int) Constant 0
34: TypePointer Function 7(fvec3)
40: TypePointer Input 11
41(i): 40(ptr) Variable Input
44: TypePointer Input 9(int)
45(cpid): 44(ptr) Variable Input
47: TypePointer Output 20
48(@entryPointOutput): 47(ptr) Variable Output
55: TypePointer Output 14(hs_out_t)
57: 9(int) Constant 2
58: 9(int) Constant 4
59: 9(int) Constant 0
61: TypeBool
65: TypePointer Function 20
73: 29(int) Constant 1
75: 9(int) Constant 1
81: 29(int) Constant 2
88: TypePointer Function 22(hs_pcf_t)
92: TypeArray 6(float) 58
93: TypePointer Output 92
94(@patchConstantOutput.tfactor): 93(ptr) Variable Output
95: TypePointer Function 6(float)
98: TypePointer Output 6(float)
106: TypeArray 6(float) 57
107: TypePointer Output 106
108(@patchConstantOutput.flInFactor): 107(ptr) Variable Output
119: 6(float) Constant 1082130432
40: TypeArray 7(fvec3) 10
41: TypePointer Input 40
42(i.val): 41(ptr) Variable Input
43: TypePointer Input 7(fvec3)
47: 29(int) Constant 1
51: 29(int) Constant 2
56: TypePointer Input 9(int)
57(cpid): 56(ptr) Variable Input
59: TypePointer Output 40
60(@entryPointOutput.val): 59(ptr) Variable Output
68: TypePointer Output 7(fvec3)
70: 9(int) Constant 2
71: 9(int) Constant 4
72: 9(int) Constant 0
74: TypeBool
78: TypePointer Function 20
87: 9(int) Constant 1
99: TypePointer Function 22(hs_pcf_t)
103: TypeArray 6(float) 71
104: TypePointer Output 103
105(@patchConstantOutput.tfactor): 104(ptr) Variable Output
106: TypePointer Function 6(float)
109: TypePointer Output 6(float)
117: TypeArray 6(float) 70
118: TypePointer Output 117
119(@patchConstantOutput.flInFactor): 118(ptr) Variable Output
130: 6(float) Constant 1082130432
4(main): 2 Function None 3
5: Label
39(i): 12(ptr) Variable Function
43(cpid): 13(ptr) Variable Function
50(param): 12(ptr) Variable Function
52(param): 13(ptr) Variable Function
66(pcf_out): 65(ptr) Variable Function
67(i): 12(ptr) Variable Function
68(param): 12(ptr) Variable Function
70(param): 13(ptr) Variable Function
74(i): 12(ptr) Variable Function
76(param): 12(ptr) Variable Function
78(param): 13(ptr) Variable Function
82(i): 12(ptr) Variable Function
83(param): 12(ptr) Variable Function
85(param): 13(ptr) Variable Function
89(@patchConstantResult): 88(ptr) Variable Function
42: 11 Load 41(i)
Store 39(i) 42
46: 9(int) Load 45(cpid)
Store 43(cpid) 46
49: 9(int) Load 45(cpid)
51: 11 Load 39(i)
Store 50(param) 51
53: 9(int) Load 43(cpid)
Store 52(param) 53
54:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 50(param) 52(param)
56: 55(ptr) AccessChain 48(@entryPointOutput) 49
Store 56 54
ControlBarrier 57 58 59
60: 9(int) Load 45(cpid)
62: 61(bool) IEqual 60 30
SelectionMerge 64 None
BranchConditional 62 63 64
63: Label
69: 11 Load 67(i)
Store 68(param) 69
Store 70(param) 59
71:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 68(param) 70(param)
72: 27(ptr) AccessChain 66(pcf_out) 30
Store 72 71
77: 11 Load 74(i)
Store 76(param) 77
Store 78(param) 75
79:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 76(param) 78(param)
80: 27(ptr) AccessChain 66(pcf_out) 73
Store 80 79
84: 11 Load 82(i)
Store 83(param) 84
Store 85(param) 57
86:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 83(param) 85(param)
87: 27(ptr) AccessChain 66(pcf_out) 81
Store 87 86
90: 20 Load 66(pcf_out)
91:22(hs_pcf_t) FunctionCall 25(PCF(struct-hs_out_t-vf31[3];) 90
Store 89(@patchConstantResult) 91
96: 95(ptr) AccessChain 89(@patchConstantResult) 30 30
97: 6(float) Load 96
99: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 30
Store 99 97
100: 95(ptr) AccessChain 89(@patchConstantResult) 30 73
101: 6(float) Load 100
102: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 73
Store 102 101
103: 95(ptr) AccessChain 89(@patchConstantResult) 30 81
104: 6(float) Load 103
105: 98(ptr) AccessChain 94(@patchConstantOutput.tfactor) 81
Store 105 104
109: 95(ptr) AccessChain 89(@patchConstantResult) 73
110: 6(float) Load 109
111: 98(ptr) AccessChain 108(@patchConstantOutput.flInFactor) 30
Store 111 110
Branch 64
64: Label
55(cpid): 13(ptr) Variable Function
62(param): 12(ptr) Variable Function
64(param): 13(ptr) Variable Function
79(pcf_out): 78(ptr) Variable Function
80(i): 12(ptr) Variable Function
81(param): 12(ptr) Variable Function
83(param): 13(ptr) Variable Function
86(i): 12(ptr) Variable Function
88(param): 12(ptr) Variable Function
90(param): 13(ptr) Variable Function
93(i): 12(ptr) Variable Function
94(param): 12(ptr) Variable Function
96(param): 13(ptr) Variable Function
100(@patchConstantResult): 99(ptr) Variable Function
44: 43(ptr) AccessChain 42(i.val) 30
45: 7(fvec3) Load 44
46: 34(ptr) AccessChain 39(i) 30 30
Store 46 45
48: 43(ptr) AccessChain 42(i.val) 47
49: 7(fvec3) Load 48
50: 34(ptr) AccessChain 39(i) 47 30
Store 50 49
52: 43(ptr) AccessChain 42(i.val) 51
53: 7(fvec3) Load 52
54: 34(ptr) AccessChain 39(i) 51 30
Store 54 53
58: 9(int) Load 57(cpid)
Store 55(cpid) 58
61: 9(int) Load 57(cpid)
63: 11 Load 39(i)
Store 62(param) 63
65: 9(int) Load 55(cpid)
Store 64(param) 65
66:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 62(param) 64(param)
67: 7(fvec3) CompositeExtract 66 0
69: 68(ptr) AccessChain 60(@entryPointOutput.val) 61
Store 69 67
ControlBarrier 70 71 72
73: 9(int) Load 57(cpid)
75: 74(bool) IEqual 73 30
SelectionMerge 77 None
BranchConditional 75 76 77
76: Label
82: 11 Load 80(i)
Store 81(param) 82
Store 83(param) 72
84:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 81(param) 83(param)
85: 27(ptr) AccessChain 79(pcf_out) 30
Store 85 84
89: 11 Load 86(i)
Store 88(param) 89
Store 90(param) 87
91:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 88(param) 90(param)
92: 27(ptr) AccessChain 79(pcf_out) 47
Store 92 91
95: 11 Load 93(i)
Store 94(param) 95
Store 96(param) 70
97:14(hs_out_t) FunctionCall 18(@main(struct-hs_in_t-vf31[3];u1;) 94(param) 96(param)
98: 27(ptr) AccessChain 79(pcf_out) 51
Store 98 97
101: 20 Load 79(pcf_out)
102:22(hs_pcf_t) FunctionCall 25(PCF(struct-hs_out_t-vf31[3];) 101
Store 100(@patchConstantResult) 102
107: 106(ptr) AccessChain 100(@patchConstantResult) 30 30
108: 6(float) Load 107
110: 109(ptr) AccessChain 105(@patchConstantOutput.tfactor) 30
Store 110 108
111: 106(ptr) AccessChain 100(@patchConstantResult) 30 47
112: 6(float) Load 111
113: 109(ptr) AccessChain 105(@patchConstantOutput.tfactor) 47
Store 113 112
114: 106(ptr) AccessChain 100(@patchConstantResult) 30 51
115: 6(float) Load 114
116: 109(ptr) AccessChain 105(@patchConstantOutput.tfactor) 51
Store 116 115
120: 106(ptr) AccessChain 100(@patchConstantResult) 47
121: 6(float) Load 120
122: 109(ptr) AccessChain 119(@patchConstantOutput.flInFactor) 30
Store 122 121
Branch 77
77: Label
Return
FunctionEnd
18(@main(struct-hs_in_t-vf31[3];u1;):14(hs_out_t) Function None 15
@ -587,18 +676,18 @@ triangle order = cw
25(PCF(struct-hs_out_t-vf31[3];):22(hs_pcf_t) Function None 23
24(pcf_out): 20 FunctionParameter
26: Label
112(o): 88(ptr) Variable Function
113: 6(float) CompositeExtract 24(pcf_out) 0 0 0
114: 95(ptr) AccessChain 112(o) 30 30
Store 114 113
115: 6(float) CompositeExtract 24(pcf_out) 1 0 0
116: 95(ptr) AccessChain 112(o) 30 73
Store 116 115
117: 6(float) CompositeExtract 24(pcf_out) 2 0 0
118: 95(ptr) AccessChain 112(o) 30 81
Store 118 117
120: 95(ptr) AccessChain 112(o) 73
Store 120 119
121:22(hs_pcf_t) Load 112(o)
ReturnValue 121
123(o): 99(ptr) Variable Function
124: 6(float) CompositeExtract 24(pcf_out) 0 0 0
125: 106(ptr) AccessChain 123(o) 30 30
Store 125 124
126: 6(float) CompositeExtract 24(pcf_out) 1 0 0
127: 106(ptr) AccessChain 123(o) 30 47
Store 127 126
128: 6(float) CompositeExtract 24(pcf_out) 2 0 0
129: 106(ptr) AccessChain 123(o) 30 51
Store 129 128
131: 106(ptr) AccessChain 123(o) 47
Store 131 130
132:22(hs_pcf_t) Load 123(o)
ReturnValue 132
FunctionEnd