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

@ -93,11 +93,8 @@ triangle order = cw
0:39 0 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 direct index (layout( location=0) in 4-component vector of float)
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
@ -120,13 +117,10 @@ triangle order = cw
0:39 1 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 direct index (layout( location=0) in 4-component vector of float)
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 1 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
@ -147,13 +141,10 @@ triangle order = cw
0:39 2 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 direct index (layout( location=0) in 4-component vector of float)
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 2 (const int)
0:39 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
@ -230,7 +221,7 @@ triangle order = cw
0:? Linker Objects
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:? 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:? 'cpid' ( in uint InvocationID)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
@ -333,11 +324,8 @@ triangle order = cw
0:39 0 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 direct index (layout( location=0) in 4-component vector of float)
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
@ -360,13 +348,10 @@ triangle order = cw
0:39 1 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 direct index (layout( location=0) in 4-component vector of float)
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 1 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
@ -387,13 +372,10 @@ triangle order = cw
0:39 2 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 direct index (layout( location=0) in 4-component vector of float)
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 2 (const int)
0:39 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
@ -470,19 +452,19 @@ triangle order = cw
0:? Linker Objects
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:? 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:? 'I.m_Normal' (layout( location=0) in 3-element array of 4-component vector of float)
0:? 'cpid' ( in uint InvocationID)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
// Generated by (magic number): 80008
// Id's are bound by 127
// Id's are bound by 124
Capability Tessellation
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 56 64 83 86 110 123
EntryPoint TessellationControl 4 "main" 56 61 80 83 107 120
ExecutionMode 4 OutputVertices 3
ExecutionMode 4 Triangles
ExecutionMode 4 SpacingFractionalOdd
@ -506,26 +488,24 @@ triangle order = cw
Name 45 "output"
Name 53 "I"
Name 56 "I.m_Position"
Name 61 "HS_Input"
MemberName 61(HS_Input) 0 "m_Normal"
Name 64 "I"
Name 81 "cpid"
Name 83 "cpid"
Name 86 "@entryPointOutput.m_Position"
Name 88 "param"
Name 90 "param"
Name 104 "@patchConstantResult"
Name 105 "param"
Name 110 "@patchConstantOutput.fTessFactor"
Name 123 "@patchConstantOutput.fInsideTessFactor"
Name 61 "I.m_Normal"
Name 78 "cpid"
Name 80 "cpid"
Name 83 "@entryPointOutput.m_Position"
Name 85 "param"
Name 87 "param"
Name 101 "@patchConstantResult"
Name 102 "param"
Name 107 "@patchConstantOutput.fTessFactor"
Name 120 "@patchConstantOutput.fInsideTessFactor"
Decorate 56(I.m_Position) BuiltIn Position
Decorate 64(I) Location 0
Decorate 83(cpid) BuiltIn InvocationId
Decorate 86(@entryPointOutput.m_Position) BuiltIn Position
Decorate 110(@patchConstantOutput.fTessFactor) Patch
Decorate 110(@patchConstantOutput.fTessFactor) BuiltIn TessLevelOuter
Decorate 123(@patchConstantOutput.fInsideTessFactor) Patch
Decorate 123(@patchConstantOutput.fInsideTessFactor) BuiltIn TessLevelInner
Decorate 61(I.m_Normal) Location 0
Decorate 80(cpid) BuiltIn InvocationId
Decorate 83(@entryPointOutput.m_Position) BuiltIn Position
Decorate 107(@patchConstantOutput.fTessFactor) Patch
Decorate 107(@patchConstantOutput.fTessFactor) BuiltIn TessLevelOuter
Decorate 120(@patchConstantOutput.fInsideTessFactor) Patch
Decorate 120(@patchConstantOutput.fInsideTessFactor) BuiltIn TessLevelInner
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -557,98 +537,95 @@ triangle order = cw
55: TypePointer Input 54
56(I.m_Position): 55(ptr) Variable Input
57: TypePointer Input 7(fvec4)
61(HS_Input): TypeStruct 7(fvec4)
62: TypeArray 61(HS_Input) 10
63: TypePointer Input 62
64(I): 63(ptr) Variable Input
74: 31(int) Constant 2
82: TypePointer Input 9(int)
83(cpid): 82(ptr) Variable Input
85: TypePointer Output 54
86(@entryPointOutput.m_Position): 85(ptr) Variable Output
94: TypePointer Output 7(fvec4)
96: 9(int) Constant 2
97: 9(int) Constant 4
98: 9(int) Constant 0
100: TypeBool
108: TypeArray 6(float) 97
109: TypePointer Output 108
110(@patchConstantOutput.fTessFactor): 109(ptr) Variable Output
113: TypePointer Output 6(float)
121: TypeArray 6(float) 96
122: TypePointer Output 121
123(@patchConstantOutput.fInsideTessFactor): 122(ptr) Variable Output
61(I.m_Normal): 55(ptr) Variable Input
71: 31(int) Constant 2
79: TypePointer Input 9(int)
80(cpid): 79(ptr) Variable Input
82: TypePointer Output 54
83(@entryPointOutput.m_Position): 82(ptr) Variable Output
91: TypePointer Output 7(fvec4)
93: 9(int) Constant 2
94: 9(int) Constant 4
95: 9(int) Constant 0
97: TypeBool
105: TypeArray 6(float) 94
106: TypePointer Output 105
107(@patchConstantOutput.fTessFactor): 106(ptr) Variable Output
110: TypePointer Output 6(float)
118: TypeArray 6(float) 93
119: TypePointer Output 118
120(@patchConstantOutput.fInsideTessFactor): 119(ptr) Variable Output
4(main): 2 Function None 3
5: Label
53(I): 12(ptr) Variable Function
81(cpid): 19(ptr) Variable Function
88(param): 12(ptr) Variable Function
90(param): 19(ptr) Variable Function
104(@patchConstantResult): 26(ptr) Variable Function
105(param): 12(ptr) Variable Function
78(cpid): 19(ptr) Variable Function
85(param): 12(ptr) Variable Function
87(param): 19(ptr) Variable Function
101(@patchConstantResult): 26(ptr) Variable Function
102(param): 12(ptr) Variable Function
58: 57(ptr) AccessChain 56(I.m_Position) 33
59: 7(fvec4) Load 58
60: 48(ptr) AccessChain 53(I) 33 33
Store 60 59
65: 57(ptr) AccessChain 64(I) 33 33
62: 57(ptr) AccessChain 61(I.m_Normal) 33
63: 7(fvec4) Load 62
64: 48(ptr) AccessChain 53(I) 33 32
Store 64 63
65: 57(ptr) AccessChain 56(I.m_Position) 32
66: 7(fvec4) Load 65
67: 48(ptr) AccessChain 53(I) 33 32
67: 48(ptr) AccessChain 53(I) 32 33
Store 67 66
68: 57(ptr) AccessChain 56(I.m_Position) 32
68: 57(ptr) AccessChain 61(I.m_Normal) 32
69: 7(fvec4) Load 68
70: 48(ptr) AccessChain 53(I) 32 33
70: 48(ptr) AccessChain 53(I) 32 32
Store 70 69
71: 57(ptr) AccessChain 64(I) 32 33
72: 7(fvec4) Load 71
73: 48(ptr) AccessChain 53(I) 32 32
Store 73 72
75: 57(ptr) AccessChain 56(I.m_Position) 74
72: 57(ptr) AccessChain 56(I.m_Position) 71
73: 7(fvec4) Load 72
74: 48(ptr) AccessChain 53(I) 71 33
Store 74 73
75: 57(ptr) AccessChain 61(I.m_Normal) 71
76: 7(fvec4) Load 75
77: 48(ptr) AccessChain 53(I) 74 33
77: 48(ptr) AccessChain 53(I) 71 32
Store 77 76
78: 57(ptr) AccessChain 64(I) 74 33
79: 7(fvec4) Load 78
80: 48(ptr) AccessChain 53(I) 74 32
Store 80 79
84: 9(int) Load 83(cpid)
Store 81(cpid) 84
87: 9(int) Load 83(cpid)
89: 11 Load 53(I)
Store 88(param) 89
91: 9(int) Load 81(cpid)
Store 90(param) 91
92:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 88(param) 90(param)
93: 7(fvec4) CompositeExtract 92 0
95: 94(ptr) AccessChain 86(@entryPointOutput.m_Position) 87
Store 95 93
ControlBarrier 96 97 98
99: 9(int) Load 83(cpid)
101: 100(bool) IEqual 99 33
SelectionMerge 103 None
BranchConditional 101 102 103
102: Label
106: 11 Load 53(I)
Store 105(param) 106
107:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 105(param)
Store 104(@patchConstantResult) 107
111: 34(ptr) AccessChain 104(@patchConstantResult) 33 33
112: 6(float) Load 111
114: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 33
Store 114 112
115: 34(ptr) AccessChain 104(@patchConstantResult) 33 32
81: 9(int) Load 80(cpid)
Store 78(cpid) 81
84: 9(int) Load 80(cpid)
86: 11 Load 53(I)
Store 85(param) 86
88: 9(int) Load 78(cpid)
Store 87(param) 88
89:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 85(param) 87(param)
90: 7(fvec4) CompositeExtract 89 0
92: 91(ptr) AccessChain 83(@entryPointOutput.m_Position) 84
Store 92 90
ControlBarrier 93 94 95
96: 9(int) Load 80(cpid)
98: 97(bool) IEqual 96 33
SelectionMerge 100 None
BranchConditional 98 99 100
99: Label
103: 11 Load 53(I)
Store 102(param) 103
104:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 102(param)
Store 101(@patchConstantResult) 104
108: 34(ptr) AccessChain 101(@patchConstantResult) 33 33
109: 6(float) Load 108
111: 110(ptr) AccessChain 107(@patchConstantOutput.fTessFactor) 33
Store 111 109
112: 34(ptr) AccessChain 101(@patchConstantResult) 33 32
113: 6(float) Load 112
114: 110(ptr) AccessChain 107(@patchConstantOutput.fTessFactor) 32
Store 114 113
115: 34(ptr) AccessChain 101(@patchConstantResult) 33 71
116: 6(float) Load 115
117: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 32
117: 110(ptr) AccessChain 107(@patchConstantOutput.fTessFactor) 71
Store 117 116
118: 34(ptr) AccessChain 104(@patchConstantResult) 33 74
119: 6(float) Load 118
120: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 74
Store 120 119
124: 34(ptr) AccessChain 104(@patchConstantResult) 32
125: 6(float) Load 124
126: 113(ptr) AccessChain 123(@patchConstantOutput.fInsideTessFactor) 33
Store 126 125
Branch 103
103: Label
121: 34(ptr) AccessChain 101(@patchConstantResult) 32
122: 6(float) Load 121
123: 110(ptr) AccessChain 120(@patchConstantOutput.fInsideTessFactor) 33
Store 123 122
Branch 100
100: Label
Return
FunctionEnd
17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];):14(HS_Output) Function None 15