HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.

This commit is contained in:
John Kessenich
2016-09-16 03:05:12 -06:00
parent f8e494c18c
commit d21baed6bc
67 changed files with 4024 additions and 2886 deletions

View File

@@ -148,10 +148,20 @@ gl_FragCoord origin is upper left
0:57 1 (const int)
0:57 Constant:
0:57 1.000000
0:59 Sequence
0:59 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:59 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:59 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:59 Color: direct index for structure (temp 4-component vector of float)
0:59 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:59 Constant:
0:59 0 (const int)
0:59 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:59 Depth: direct index for structure (temp float FragDepth)
0:59 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:59 Constant:
0:59 1 (const int)
0:59 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -332,10 +342,20 @@ gl_FragCoord origin is upper left
0:57 1 (const int)
0:57 Constant:
0:57 1.000000
0:59 Sequence
0:59 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:59 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:59 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:59 Color: direct index for structure (temp 4-component vector of float)
0:59 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:59 Constant:
0:59 0 (const int)
0:59 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:59 Depth: direct index for structure (temp float FragDepth)
0:59 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:59 Constant:
0:59 1 (const int)
0:59 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -365,14 +385,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 183
// Id's are bound by 184
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 140 180 182
EntryPoint Fragment 4 "main" 140 144
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r10"
@@ -398,21 +418,20 @@ gl_FragCoord origin is upper left
MemberName 129(PS_OUTPUT) 0 "Color"
MemberName 129(PS_OUTPUT) 1 "Depth"
Name 131 "psout"
Name 140 "@entryPointOutput"
Name 145 "g_tTex1df4"
Name 148 "g_tTex1di4"
Name 151 "g_tTex1du4"
Name 154 "g_tTex2df4"
Name 157 "g_tTex2di4"
Name 160 "g_tTex2du4"
Name 163 "g_tTex3df4"
Name 166 "g_tTex3di4"
Name 169 "g_tTex3du4"
Name 172 "g_tTexcdf4"
Name 175 "g_tTexcdi4"
Name 178 "g_tTexcdu4"
Name 180 "Color"
Name 182 "Depth"
Name 140 "Color"
Name 144 "Depth"
Name 150 "g_tTex1df4"
Name 153 "g_tTex1di4"
Name 156 "g_tTex1du4"
Name 159 "g_tTex2df4"
Name 162 "g_tTex2di4"
Name 165 "g_tTex2du4"
Name 168 "g_tTex3df4"
Name 171 "g_tTex3di4"
Name 174 "g_tTex3du4"
Name 177 "g_tTexcdf4"
Name 180 "g_tTexcdi4"
Name 183 "g_tTexcdu4"
Decorate 11(g_tTex1df4a) DescriptorSet 0
Decorate 15(g_sSamp) DescriptorSet 0
Decorate 15(g_sSamp) Binding 0
@@ -425,21 +444,21 @@ gl_FragCoord origin is upper left
Decorate 110(g_tTexcdi4a) DescriptorSet 0
Decorate 121(g_tTexcdu4a) DescriptorSet 0
MemberDecorate 129(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 145(g_tTex1df4) DescriptorSet 0
Decorate 145(g_tTex1df4) Binding 0
Decorate 148(g_tTex1di4) DescriptorSet 0
Decorate 151(g_tTex1du4) DescriptorSet 0
Decorate 154(g_tTex2df4) DescriptorSet 0
Decorate 157(g_tTex2di4) DescriptorSet 0
Decorate 160(g_tTex2du4) DescriptorSet 0
Decorate 163(g_tTex3df4) DescriptorSet 0
Decorate 166(g_tTex3di4) DescriptorSet 0
Decorate 169(g_tTex3du4) DescriptorSet 0
Decorate 172(g_tTexcdf4) DescriptorSet 0
Decorate 175(g_tTexcdi4) DescriptorSet 0
Decorate 178(g_tTexcdu4) DescriptorSet 0
Decorate 180(Color) Location 0
Decorate 182(Depth) BuiltIn FragDepth
Decorate 140(Color) Location 0
Decorate 144(Depth) BuiltIn FragDepth
Decorate 150(g_tTex1df4) DescriptorSet 0
Decorate 150(g_tTex1df4) Binding 0
Decorate 153(g_tTex1di4) DescriptorSet 0
Decorate 156(g_tTex1du4) DescriptorSet 0
Decorate 159(g_tTex2df4) DescriptorSet 0
Decorate 162(g_tTex2di4) DescriptorSet 0
Decorate 165(g_tTex2du4) DescriptorSet 0
Decorate 168(g_tTex3df4) DescriptorSet 0
Decorate 171(g_tTex3di4) DescriptorSet 0
Decorate 174(g_tTex3du4) DescriptorSet 0
Decorate 177(g_tTexcdf4) DescriptorSet 0
Decorate 180(g_tTexcdi4) DescriptorSet 0
Decorate 183(g_tTexcdu4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -512,48 +531,46 @@ gl_FragCoord origin is upper left
134: 102(fvec4) ConstantComposite 133 133 133 133
135: TypePointer Function 102(fvec4)
137: 29(int) Constant 1
139: TypePointer Output 129(PS_OUTPUT)
140(@entryPointOutput): 139(ptr) Variable Output
143: TypeImage 6(float) 1D sampled format:Unknown
144: TypePointer UniformConstant 143
145(g_tTex1df4): 144(ptr) Variable UniformConstant
146: TypeImage 29(int) 1D sampled format:Unknown
147: TypePointer UniformConstant 146
148(g_tTex1di4): 147(ptr) Variable UniformConstant
149: TypeImage 42(int) 1D sampled format:Unknown
150: TypePointer UniformConstant 149
151(g_tTex1du4): 150(ptr) Variable UniformConstant
152: TypeImage 6(float) 2D sampled format:Unknown
153: TypePointer UniformConstant 152
154(g_tTex2df4): 153(ptr) Variable UniformConstant
155: TypeImage 29(int) 2D sampled format:Unknown
156: TypePointer UniformConstant 155
157(g_tTex2di4): 156(ptr) Variable UniformConstant
158: TypeImage 42(int) 2D sampled format:Unknown
159: TypePointer UniformConstant 158
160(g_tTex2du4): 159(ptr) Variable UniformConstant
161: TypeImage 6(float) 3D sampled format:Unknown
162: TypePointer UniformConstant 161
163(g_tTex3df4): 162(ptr) Variable UniformConstant
164: TypeImage 29(int) 3D sampled format:Unknown
165: TypePointer UniformConstant 164
166(g_tTex3di4): 165(ptr) Variable UniformConstant
167: TypeImage 42(int) 3D sampled format:Unknown
168: TypePointer UniformConstant 167
169(g_tTex3du4): 168(ptr) Variable UniformConstant
170: TypeImage 6(float) Cube sampled format:Unknown
171: TypePointer UniformConstant 170
172(g_tTexcdf4): 171(ptr) Variable UniformConstant
173: TypeImage 29(int) Cube sampled format:Unknown
174: TypePointer UniformConstant 173
175(g_tTexcdi4): 174(ptr) Variable UniformConstant
176: TypeImage 42(int) Cube sampled format:Unknown
177: TypePointer UniformConstant 176
178(g_tTexcdu4): 177(ptr) Variable UniformConstant
179: TypePointer Output 102(fvec4)
180(Color): 179(ptr) Variable Output
181: TypePointer Output 6(float)
182(Depth): 181(ptr) Variable Output
139: TypePointer Output 102(fvec4)
140(Color): 139(ptr) Variable Output
143: TypePointer Output 6(float)
144(Depth): 143(ptr) Variable Output
148: TypeImage 6(float) 1D sampled format:Unknown
149: TypePointer UniformConstant 148
150(g_tTex1df4): 149(ptr) Variable UniformConstant
151: TypeImage 29(int) 1D sampled format:Unknown
152: TypePointer UniformConstant 151
153(g_tTex1di4): 152(ptr) Variable UniformConstant
154: TypeImage 42(int) 1D sampled format:Unknown
155: TypePointer UniformConstant 154
156(g_tTex1du4): 155(ptr) Variable UniformConstant
157: TypeImage 6(float) 2D sampled format:Unknown
158: TypePointer UniformConstant 157
159(g_tTex2df4): 158(ptr) Variable UniformConstant
160: TypeImage 29(int) 2D sampled format:Unknown
161: TypePointer UniformConstant 160
162(g_tTex2di4): 161(ptr) Variable UniformConstant
163: TypeImage 42(int) 2D sampled format:Unknown
164: TypePointer UniformConstant 163
165(g_tTex2du4): 164(ptr) Variable UniformConstant
166: TypeImage 6(float) 3D sampled format:Unknown
167: TypePointer UniformConstant 166
168(g_tTex3df4): 167(ptr) Variable UniformConstant
169: TypeImage 29(int) 3D sampled format:Unknown
170: TypePointer UniformConstant 169
171(g_tTex3di4): 170(ptr) Variable UniformConstant
172: TypeImage 42(int) 3D sampled format:Unknown
173: TypePointer UniformConstant 172
174(g_tTex3du4): 173(ptr) Variable UniformConstant
175: TypeImage 6(float) Cube sampled format:Unknown
176: TypePointer UniformConstant 175
177(g_tTexcdf4): 176(ptr) Variable UniformConstant
178: TypeImage 29(int) Cube sampled format:Unknown
179: TypePointer UniformConstant 178
180(g_tTexcdi4): 179(ptr) Variable UniformConstant
181: TypeImage 42(int) Cube sampled format:Unknown
182: TypePointer UniformConstant 181
183(g_tTexcdu4): 182(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
8(r10): 7(ptr) Variable Function
@@ -630,7 +647,11 @@ gl_FragCoord origin is upper left
Store 136 134
138: 7(ptr) AccessChain 131(psout) 137
Store 138 133
141:129(PS_OUTPUT) Load 131(psout)
Store 140(@entryPointOutput) 141
141: 135(ptr) AccessChain 131(psout) 132
142: 102(fvec4) Load 141
Store 140(Color) 142
145: 7(ptr) AccessChain 131(psout) 137
146: 6(float) Load 145
Store 144(Depth) 146
Return
FunctionEnd