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

@ -105,9 +105,79 @@ triangle order = none
0:25 Constant:
0:25 2 (const int)
0:? 'pcf_data.foo' (layout( location=2) patch in float)
0:25 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Sequence
0:25 move second child to first child ( temp 4-component vector of float)
0:25 pos: direct index for structure ( temp 4-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 0 (const int)
0:25 Constant:
0:25 0 (const int)
0:25 direct index (layout( location=0) in 4-component vector of float)
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:25 Constant:
0:25 0 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:25 norm: direct index for structure ( temp 3-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 0 (const int)
0:25 Constant:
0:25 1 (const int)
0:25 direct index (layout( location=1) in 3-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:25 Constant:
0:25 0 (const int)
0:25 move second child to first child ( temp 4-component vector of float)
0:25 pos: direct index for structure ( temp 4-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 1 (const int)
0:25 Constant:
0:25 0 (const int)
0:25 direct index (layout( location=0) in 4-component vector of float)
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:25 Constant:
0:25 1 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:25 norm: direct index for structure ( temp 3-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 1 (const int)
0:25 Constant:
0:25 1 (const int)
0:25 direct index (layout( location=1) in 3-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:25 Constant:
0:25 1 (const int)
0:25 move second child to first child ( temp 4-component vector of float)
0:25 pos: direct index for structure ( temp 4-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 2 (const int)
0:25 Constant:
0:25 0 (const int)
0:25 direct index (layout( location=0) in 4-component vector of float)
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:25 Constant:
0:25 2 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:25 norm: direct index for structure ( temp 3-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 2 (const int)
0:25 Constant:
0:25 1 (const int)
0:25 direct index (layout( location=1) in 3-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:25 Constant:
0:25 2 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:? 'tesscoord' ( temp 3-component vector of float)
0:? 'tesscoord' ( patch in 3-component vector of float TessCoord)
@ -133,7 +203,8 @@ triangle order = none
0:? Linker Objects
0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float)
0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float)
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:? 'tesscoord' ( patch in 3-component vector of float TessCoord)
0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter)
0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
@ -249,9 +320,79 @@ triangle order = none
0:25 Constant:
0:25 2 (const int)
0:? 'pcf_data.foo' (layout( location=2) patch in float)
0:25 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Sequence
0:25 move second child to first child ( temp 4-component vector of float)
0:25 pos: direct index for structure ( temp 4-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 0 (const int)
0:25 Constant:
0:25 0 (const int)
0:25 direct index (layout( location=0) in 4-component vector of float)
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:25 Constant:
0:25 0 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:25 norm: direct index for structure ( temp 3-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 0 (const int)
0:25 Constant:
0:25 1 (const int)
0:25 direct index (layout( location=1) in 3-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:25 Constant:
0:25 0 (const int)
0:25 move second child to first child ( temp 4-component vector of float)
0:25 pos: direct index for structure ( temp 4-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 1 (const int)
0:25 Constant:
0:25 0 (const int)
0:25 direct index (layout( location=0) in 4-component vector of float)
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:25 Constant:
0:25 1 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:25 norm: direct index for structure ( temp 3-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 1 (const int)
0:25 Constant:
0:25 1 (const int)
0:25 direct index (layout( location=1) in 3-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:25 Constant:
0:25 1 (const int)
0:25 move second child to first child ( temp 4-component vector of float)
0:25 pos: direct index for structure ( temp 4-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 2 (const int)
0:25 Constant:
0:25 0 (const int)
0:25 direct index (layout( location=0) in 4-component vector of float)
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:25 Constant:
0:25 2 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:25 norm: direct index for structure ( temp 3-component vector of float)
0:25 direct index ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:25 Constant:
0:25 2 (const int)
0:25 Constant:
0:25 1 (const int)
0:25 direct index (layout( location=1) in 3-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:25 Constant:
0:25 2 (const int)
0:25 move second child to first child ( temp 3-component vector of float)
0:? 'tesscoord' ( temp 3-component vector of float)
0:? 'tesscoord' ( patch in 3-component vector of float TessCoord)
@ -277,7 +418,8 @@ triangle order = none
0:? Linker Objects
0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float)
0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float)
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm})
0:? 'i.pos' (layout( location=0) in 3-element array of 4-component vector of float)
0:? 'i.norm' (layout( location=1) in 3-element array of 3-component vector of float)
0:? 'tesscoord' ( patch in 3-component vector of float TessCoord)
0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter)
0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
@ -285,12 +427,12 @@ triangle order = none
// Module Version 10000
// Generated by (magic number): 80008
// Id's are bound by 98
// Id's are bound by 120
Capability Tessellation
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationEvaluation 4 "main" 52 67 71 77 81 91 95
EntryPoint TessellationEvaluation 4 "main" 52 67 71 78 85 103 113 117
ExecutionMode 4 Triangles
Source HLSL 500
Name 4 "main"
@ -314,25 +456,27 @@ triangle order = none
Name 67 "pcf_data.flInsideTessFactor"
Name 71 "pcf_data.foo"
Name 75 "i"
Name 77 "i"
Name 79 "tesscoord"
Name 81 "tesscoord"
Name 83 "flattenTemp"
Name 85 "param"
Name 87 "param"
Name 91 "@entryPointOutput.pos"
Name 95 "@entryPointOutput.norm"
Name 78 "i.pos"
Name 85 "i.norm"
Name 102 "tesscoord"
Name 103 "tesscoord"
Name 105 "flattenTemp"
Name 107 "param"
Name 109 "param"
Name 113 "@entryPointOutput.pos"
Name 117 "@entryPointOutput.norm"
Decorate 52(pcf_data.flTessFactor) Patch
Decorate 52(pcf_data.flTessFactor) BuiltIn TessLevelOuter
Decorate 67(pcf_data.flInsideTessFactor) Patch
Decorate 67(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner
Decorate 71(pcf_data.foo) Patch
Decorate 71(pcf_data.foo) Location 2
Decorate 77(i) Location 0
Decorate 81(tesscoord) Patch
Decorate 81(tesscoord) BuiltIn TessCoord
Decorate 91(@entryPointOutput.pos) Location 0
Decorate 95(@entryPointOutput.norm) Location 1
Decorate 78(i.pos) Location 0
Decorate 85(i.norm) Location 1
Decorate 103(tesscoord) Patch
Decorate 103(tesscoord) BuiltIn TessCoord
Decorate 113(@entryPointOutput.pos) Location 0
Decorate 117(@entryPointOutput.norm) Location 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -368,22 +512,27 @@ triangle order = none
67(pcf_data.flInsideTessFactor): 66(ptr) Variable Input
71(pcf_data.foo): 53(ptr) Variable Input
74: TypePointer Function 15
76: TypePointer Input 15
77(i): 76(ptr) Variable Input
80: TypePointer Input 13(fvec3)
81(tesscoord): 80(ptr) Variable Input
90: TypePointer Output 12(fvec4)
91(@entryPointOutput.pos): 90(ptr) Variable Output
94: TypePointer Output 13(fvec3)
95(@entryPointOutput.norm): 94(ptr) Variable Output
76: TypeArray 12(fvec4) 8
77: TypePointer Input 76
78(i.pos): 77(ptr) Variable Input
79: TypePointer Input 12(fvec4)
83: TypeArray 13(fvec3) 8
84: TypePointer Input 83
85(i.norm): 84(ptr) Variable Input
86: TypePointer Input 13(fvec3)
103(tesscoord): 86(ptr) Variable Input
112: TypePointer Output 12(fvec4)
113(@entryPointOutput.pos): 112(ptr) Variable Output
116: TypePointer Output 13(fvec3)
117(@entryPointOutput.norm): 116(ptr) Variable Output
4(main): 2 Function None 3
5: Label
48(pcf_data): 11(ptr) Variable Function
75(i): 74(ptr) Variable Function
79(tesscoord): 16(ptr) Variable Function
83(flattenTemp): 24(ptr) Variable Function
85(param): 11(ptr) Variable Function
87(param): 16(ptr) Variable Function
102(tesscoord): 16(ptr) Variable Function
105(flattenTemp): 24(ptr) Variable Function
107(param): 11(ptr) Variable Function
109(param): 16(ptr) Variable Function
54: 53(ptr) AccessChain 52(pcf_data.flTessFactor) 27
55: 6(float) Load 54
56: 30(ptr) AccessChain 48(pcf_data) 27 27
@ -403,23 +552,45 @@ triangle order = none
72: 6(float) Load 71(pcf_data.foo)
73: 30(ptr) AccessChain 48(pcf_data) 60
Store 73 72
78: 15 Load 77(i)
Store 75(i) 78
82: 13(fvec3) Load 81(tesscoord)
Store 79(tesscoord) 82
84: 15 Load 75(i)
86:10(pcf_in_t) Load 48(pcf_data)
Store 85(param) 86
88: 13(fvec3) Load 79(tesscoord)
Store 87(param) 88
89: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 85(param) 84 87(param)
Store 83(flattenTemp) 89
92: 35(ptr) AccessChain 83(flattenTemp) 27
93: 12(fvec4) Load 92
Store 91(@entryPointOutput.pos) 93
96: 16(ptr) AccessChain 83(flattenTemp) 37
97: 13(fvec3) Load 96
Store 95(@entryPointOutput.norm) 97
80: 79(ptr) AccessChain 78(i.pos) 27
81: 12(fvec4) Load 80
82: 35(ptr) AccessChain 75(i) 27 27
Store 82 81
87: 86(ptr) AccessChain 85(i.norm) 27
88: 13(fvec3) Load 87
89: 16(ptr) AccessChain 75(i) 27 37
Store 89 88
90: 79(ptr) AccessChain 78(i.pos) 37
91: 12(fvec4) Load 90
92: 35(ptr) AccessChain 75(i) 37 27
Store 92 91
93: 86(ptr) AccessChain 85(i.norm) 37
94: 13(fvec3) Load 93
95: 16(ptr) AccessChain 75(i) 37 37
Store 95 94
96: 79(ptr) AccessChain 78(i.pos) 60
97: 12(fvec4) Load 96
98: 35(ptr) AccessChain 75(i) 60 27
Store 98 97
99: 86(ptr) AccessChain 85(i.norm) 60
100: 13(fvec3) Load 99
101: 16(ptr) AccessChain 75(i) 60 37
Store 101 100
104: 13(fvec3) Load 103(tesscoord)
Store 102(tesscoord) 104
106: 15 Load 75(i)
108:10(pcf_in_t) Load 48(pcf_data)
Store 107(param) 108
110: 13(fvec3) Load 102(tesscoord)
Store 109(param) 110
111: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 107(param) 106 109(param)
Store 105(flattenTemp) 111
114: 35(ptr) AccessChain 105(flattenTemp) 27
115: 12(fvec4) Load 114
Store 113(@entryPointOutput.pos) 115
118: 16(ptr) AccessChain 105(flattenTemp) 37
119: 13(fvec3) Load 118
Store 117(@entryPointOutput.norm) 119
Return
FunctionEnd
22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;): 17(gs_in_t) Function None 18