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

@@ -334,10 +334,20 @@ gl_FragCoord origin is upper left
0:113 1 (const int)
0:113 Constant:
0:113 1.000000
0:115 Sequence
0:115 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:115 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:115 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:115 Color: direct index for structure (temp 4-component vector of float)
0:115 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:115 Constant:
0:115 0 (const int)
0:115 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:115 Depth: direct index for structure (temp float FragDepth)
0:115 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:115 Constant:
0:115 1 (const int)
0:115 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -705,10 +715,20 @@ gl_FragCoord origin is upper left
0:113 1 (const int)
0:113 Constant:
0:113 1.000000
0:115 Sequence
0:115 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:115 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:115 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:115 Color: direct index for structure (temp 4-component vector of float)
0:115 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:115 Constant:
0:115 0 (const int)
0:115 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:115 Depth: direct index for structure (temp float FragDepth)
0:115 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:115 Constant:
0:115 1 (const int)
0:115 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -739,14 +759,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 317
// Id's are bound by 318
Capability Shader
Capability ImageGatherExtended
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 267 314 316
EntryPoint Fragment 4 "main" 267 271
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval001"
@@ -783,47 +803,46 @@ gl_FragCoord origin is upper left
MemberName 258(PS_OUTPUT) 0 "Color"
MemberName 258(PS_OUTPUT) 1 "Depth"
Name 260 "psout"
Name 267 "@entryPointOutput"
Name 270 "g_sSamp2d"
Name 273 "g_tTex1df4a"
Name 274 "g_tTex1df4"
Name 277 "g_tTex1di4"
Name 280 "g_tTex1du4"
Name 283 "g_tTex3df4"
Name 286 "g_tTex3di4"
Name 289 "g_tTex3du4"
Name 292 "g_tTexcdf4"
Name 295 "g_tTexcdi4"
Name 298 "g_tTexcdu4"
Name 300 "c1"
Name 303 "c3"
Name 305 "c4"
Name 307 "o1"
Name 310 "o3"
Name 312 "o4"
Name 314 "Color"
Name 316 "Depth"
Name 267 "Color"
Name 271 "Depth"
Name 275 "g_sSamp2d"
Name 278 "g_tTex1df4a"
Name 279 "g_tTex1df4"
Name 282 "g_tTex1di4"
Name 285 "g_tTex1du4"
Name 288 "g_tTex3df4"
Name 291 "g_tTex3di4"
Name 294 "g_tTex3du4"
Name 297 "g_tTexcdf4"
Name 300 "g_tTexcdi4"
Name 303 "g_tTexcdu4"
Name 305 "c1"
Name 308 "c3"
Name 310 "c4"
Name 312 "o1"
Name 315 "o3"
Name 317 "o4"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 36(g_tTex2di4) DescriptorSet 0
Decorate 50(g_tTex2du4) DescriptorSet 0
MemberDecorate 258(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 270(g_sSamp2d) DescriptorSet 0
Decorate 273(g_tTex1df4a) DescriptorSet 0
Decorate 273(g_tTex1df4a) Binding 1
Decorate 274(g_tTex1df4) DescriptorSet 0
Decorate 274(g_tTex1df4) Binding 0
Decorate 277(g_tTex1di4) DescriptorSet 0
Decorate 280(g_tTex1du4) DescriptorSet 0
Decorate 283(g_tTex3df4) DescriptorSet 0
Decorate 286(g_tTex3di4) DescriptorSet 0
Decorate 289(g_tTex3du4) DescriptorSet 0
Decorate 292(g_tTexcdf4) DescriptorSet 0
Decorate 295(g_tTexcdi4) DescriptorSet 0
Decorate 298(g_tTexcdu4) DescriptorSet 0
Decorate 314(Color) Location 0
Decorate 316(Depth) BuiltIn FragDepth
Decorate 267(Color) Location 0
Decorate 271(Depth) BuiltIn FragDepth
Decorate 275(g_sSamp2d) DescriptorSet 0
Decorate 278(g_tTex1df4a) DescriptorSet 0
Decorate 278(g_tTex1df4a) Binding 1
Decorate 279(g_tTex1df4) DescriptorSet 0
Decorate 279(g_tTex1df4) Binding 0
Decorate 282(g_tTex1di4) DescriptorSet 0
Decorate 285(g_tTex1du4) DescriptorSet 0
Decorate 288(g_tTex3df4) DescriptorSet 0
Decorate 291(g_tTex3di4) DescriptorSet 0
Decorate 294(g_tTex3du4) DescriptorSet 0
Decorate 297(g_tTexcdf4) DescriptorSet 0
Decorate 300(g_tTexcdi4) DescriptorSet 0
Decorate 303(g_tTexcdu4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -867,55 +886,53 @@ gl_FragCoord origin is upper left
261: 6(float) Constant 1065353216
262: 7(fvec4) ConstantComposite 261 261 261 261
264: TypePointer Function 6(float)
266: TypePointer Output 258(PS_OUTPUT)
267(@entryPointOutput): 266(ptr) Variable Output
270(g_sSamp2d): 15(ptr) Variable UniformConstant
271: TypeImage 6(float) 1D sampled format:Unknown
272: TypePointer UniformConstant 271
273(g_tTex1df4a): 272(ptr) Variable UniformConstant
274(g_tTex1df4): 272(ptr) Variable UniformConstant
275: TypeImage 24(int) 1D sampled format:Unknown
276: TypePointer UniformConstant 275
277(g_tTex1di4): 276(ptr) Variable UniformConstant
278: TypeImage 44(int) 1D sampled format:Unknown
279: TypePointer UniformConstant 278
280(g_tTex1du4): 279(ptr) Variable UniformConstant
281: TypeImage 6(float) 3D sampled format:Unknown
282: TypePointer UniformConstant 281
283(g_tTex3df4): 282(ptr) Variable UniformConstant
284: TypeImage 24(int) 3D sampled format:Unknown
285: TypePointer UniformConstant 284
286(g_tTex3di4): 285(ptr) Variable UniformConstant
287: TypeImage 44(int) 3D sampled format:Unknown
288: TypePointer UniformConstant 287
289(g_tTex3du4): 288(ptr) Variable UniformConstant
290: TypeImage 6(float) Cube sampled format:Unknown
291: TypePointer UniformConstant 290
292(g_tTexcdf4): 291(ptr) Variable UniformConstant
293: TypeImage 24(int) Cube sampled format:Unknown
294: TypePointer UniformConstant 293
295(g_tTexcdi4): 294(ptr) Variable UniformConstant
296: TypeImage 44(int) Cube sampled format:Unknown
297: TypePointer UniformConstant 296
298(g_tTexcdu4): 297(ptr) Variable UniformConstant
299: TypePointer UniformConstant 6(float)
300(c1): 299(ptr) Variable UniformConstant
301: TypeVector 6(float) 3
302: TypePointer UniformConstant 301(fvec3)
303(c3): 302(ptr) Variable UniformConstant
304: TypePointer UniformConstant 7(fvec4)
305(c4): 304(ptr) Variable UniformConstant
306: TypePointer UniformConstant 24(int)
307(o1): 306(ptr) Variable UniformConstant
308: TypeVector 24(int) 3
309: TypePointer UniformConstant 308(ivec3)
310(o3): 309(ptr) Variable UniformConstant
311: TypePointer UniformConstant 31(ivec4)
312(o4): 311(ptr) Variable UniformConstant
313: TypePointer Output 7(fvec4)
314(Color): 313(ptr) Variable Output
315: TypePointer Output 6(float)
316(Depth): 315(ptr) Variable Output
266: TypePointer Output 7(fvec4)
267(Color): 266(ptr) Variable Output
270: TypePointer Output 6(float)
271(Depth): 270(ptr) Variable Output
275(g_sSamp2d): 15(ptr) Variable UniformConstant
276: TypeImage 6(float) 1D sampled format:Unknown
277: TypePointer UniformConstant 276
278(g_tTex1df4a): 277(ptr) Variable UniformConstant
279(g_tTex1df4): 277(ptr) Variable UniformConstant
280: TypeImage 24(int) 1D sampled format:Unknown
281: TypePointer UniformConstant 280
282(g_tTex1di4): 281(ptr) Variable UniformConstant
283: TypeImage 44(int) 1D sampled format:Unknown
284: TypePointer UniformConstant 283
285(g_tTex1du4): 284(ptr) Variable UniformConstant
286: TypeImage 6(float) 3D sampled format:Unknown
287: TypePointer UniformConstant 286
288(g_tTex3df4): 287(ptr) Variable UniformConstant
289: TypeImage 24(int) 3D sampled format:Unknown
290: TypePointer UniformConstant 289
291(g_tTex3di4): 290(ptr) Variable UniformConstant
292: TypeImage 44(int) 3D sampled format:Unknown
293: TypePointer UniformConstant 292
294(g_tTex3du4): 293(ptr) Variable UniformConstant
295: TypeImage 6(float) Cube sampled format:Unknown
296: TypePointer UniformConstant 295
297(g_tTexcdf4): 296(ptr) Variable UniformConstant
298: TypeImage 24(int) Cube sampled format:Unknown
299: TypePointer UniformConstant 298
300(g_tTexcdi4): 299(ptr) Variable UniformConstant
301: TypeImage 44(int) Cube sampled format:Unknown
302: TypePointer UniformConstant 301
303(g_tTexcdu4): 302(ptr) Variable UniformConstant
304: TypePointer UniformConstant 6(float)
305(c1): 304(ptr) Variable UniformConstant
306: TypeVector 6(float) 3
307: TypePointer UniformConstant 306(fvec3)
308(c3): 307(ptr) Variable UniformConstant
309: TypePointer UniformConstant 7(fvec4)
310(c4): 309(ptr) Variable UniformConstant
311: TypePointer UniformConstant 24(int)
312(o1): 311(ptr) Variable UniformConstant
313: TypeVector 24(int) 3
314: TypePointer UniformConstant 313(ivec3)
315(o3): 314(ptr) Variable UniformConstant
316: TypePointer UniformConstant 31(ivec4)
317(o4): 316(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval001): 8(ptr) Variable Function
@@ -1163,7 +1180,11 @@ gl_FragCoord origin is upper left
Store 263 262
265: 264(ptr) AccessChain 260(psout) 99
Store 265 261
268:258(PS_OUTPUT) Load 260(psout)
Store 267(@entryPointOutput) 268
268: 8(ptr) AccessChain 260(psout) 29
269: 7(fvec4) Load 268
Store 267(Color) 269
272: 264(ptr) AccessChain 260(psout) 99
273: 6(float) Load 272
Store 271(Depth) 273
Return
FunctionEnd