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:107 1 (const int)
0:107 Constant:
0:107 1.000000
0:109 Sequence
0:109 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:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:109 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:109 Color: direct index for structure (temp 4-component vector of float)
0:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:109 Constant:
0:109 0 (const int)
0:109 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:109 Depth: direct index for structure (temp float FragDepth)
0:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:109 Constant:
0:109 1 (const int)
0:109 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -701,10 +711,20 @@ gl_FragCoord origin is upper left
0:107 1 (const int)
0:107 Constant:
0:107 1.000000
0:109 Sequence
0:109 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:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:109 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:109 Color: direct index for structure (temp 4-component vector of float)
0:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:109 Constant:
0:109 0 (const int)
0:109 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:109 Depth: direct index for structure (temp float FragDepth)
0:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:109 Constant:
0:109 1 (const int)
0:109 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -731,7 +751,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 307
// Id's are bound by 308
Capability Shader
Capability ImageGatherExtended
@@ -739,7 +759,7 @@ gl_FragCoord origin is upper left
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 267 304 306
EntryPoint Fragment 4 "main" 267 271
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval001"
@@ -776,38 +796,37 @@ 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 276 "g_tTex1di4a"
Name 279 "g_tTex1du4a"
Name 282 "g_tTexcdf4a"
Name 285 "g_tTexcdi4a"
Name 288 "g_tTexcdu4a"
Name 290 "c1"
Name 293 "c2"
Name 295 "c4"
Name 297 "o1"
Name 300 "o3"
Name 302 "o4"
Name 304 "Color"
Name 306 "Depth"
Name 267 "Color"
Name 271 "Depth"
Name 275 "g_sSamp2d"
Name 278 "g_tTex1df4a"
Name 281 "g_tTex1di4a"
Name 284 "g_tTex1du4a"
Name 287 "g_tTexcdf4a"
Name 290 "g_tTexcdi4a"
Name 293 "g_tTexcdu4a"
Name 295 "c1"
Name 298 "c2"
Name 300 "c4"
Name 302 "o1"
Name 305 "o3"
Name 307 "o4"
Decorate 12(g_tTex2df4a) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 36(g_tTex2di4a) DescriptorSet 0
Decorate 50(g_tTex2du4a) 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 0
Decorate 276(g_tTex1di4a) DescriptorSet 0
Decorate 279(g_tTex1du4a) DescriptorSet 0
Decorate 282(g_tTexcdf4a) DescriptorSet 0
Decorate 285(g_tTexcdi4a) DescriptorSet 0
Decorate 288(g_tTexcdu4a) DescriptorSet 0
Decorate 304(Color) Location 0
Decorate 306(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 0
Decorate 281(g_tTex1di4a) DescriptorSet 0
Decorate 284(g_tTex1du4a) DescriptorSet 0
Decorate 287(g_tTexcdf4a) DescriptorSet 0
Decorate 290(g_tTexcdi4a) DescriptorSet 0
Decorate 293(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -851,45 +870,43 @@ 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 array sampled format:Unknown
272: TypePointer UniformConstant 271
273(g_tTex1df4a): 272(ptr) Variable UniformConstant
274: TypeImage 24(int) 1D array sampled format:Unknown
275: TypePointer UniformConstant 274
276(g_tTex1di4a): 275(ptr) Variable UniformConstant
277: TypeImage 44(int) 1D array sampled format:Unknown
278: TypePointer UniformConstant 277
279(g_tTex1du4a): 278(ptr) Variable UniformConstant
280: TypeImage 6(float) Cube array sampled format:Unknown
281: TypePointer UniformConstant 280
282(g_tTexcdf4a): 281(ptr) Variable UniformConstant
283: TypeImage 24(int) Cube array sampled format:Unknown
284: TypePointer UniformConstant 283
285(g_tTexcdi4a): 284(ptr) Variable UniformConstant
286: TypeImage 44(int) Cube array sampled format:Unknown
287: TypePointer UniformConstant 286
288(g_tTexcdu4a): 287(ptr) Variable UniformConstant
289: TypePointer UniformConstant 6(float)
290(c1): 289(ptr) Variable UniformConstant
291: TypeVector 6(float) 2
292: TypePointer UniformConstant 291(fvec2)
293(c2): 292(ptr) Variable UniformConstant
294: TypePointer UniformConstant 7(fvec4)
295(c4): 294(ptr) Variable UniformConstant
296: TypePointer UniformConstant 24(int)
297(o1): 296(ptr) Variable UniformConstant
298: TypeVector 24(int) 3
299: TypePointer UniformConstant 298(ivec3)
300(o3): 299(ptr) Variable UniformConstant
301: TypePointer UniformConstant 31(ivec4)
302(o4): 301(ptr) Variable UniformConstant
303: TypePointer Output 7(fvec4)
304(Color): 303(ptr) Variable Output
305: TypePointer Output 6(float)
306(Depth): 305(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 array sampled format:Unknown
277: TypePointer UniformConstant 276
278(g_tTex1df4a): 277(ptr) Variable UniformConstant
279: TypeImage 24(int) 1D array sampled format:Unknown
280: TypePointer UniformConstant 279
281(g_tTex1di4a): 280(ptr) Variable UniformConstant
282: TypeImage 44(int) 1D array sampled format:Unknown
283: TypePointer UniformConstant 282
284(g_tTex1du4a): 283(ptr) Variable UniformConstant
285: TypeImage 6(float) Cube array sampled format:Unknown
286: TypePointer UniformConstant 285
287(g_tTexcdf4a): 286(ptr) Variable UniformConstant
288: TypeImage 24(int) Cube array sampled format:Unknown
289: TypePointer UniformConstant 288
290(g_tTexcdi4a): 289(ptr) Variable UniformConstant
291: TypeImage 44(int) Cube array sampled format:Unknown
292: TypePointer UniformConstant 291
293(g_tTexcdu4a): 292(ptr) Variable UniformConstant
294: TypePointer UniformConstant 6(float)
295(c1): 294(ptr) Variable UniformConstant
296: TypeVector 6(float) 2
297: TypePointer UniformConstant 296(fvec2)
298(c2): 297(ptr) Variable UniformConstant
299: TypePointer UniformConstant 7(fvec4)
300(c4): 299(ptr) Variable UniformConstant
301: TypePointer UniformConstant 24(int)
302(o1): 301(ptr) Variable UniformConstant
303: TypeVector 24(int) 3
304: TypePointer UniformConstant 303(ivec3)
305(o3): 304(ptr) Variable UniformConstant
306: TypePointer UniformConstant 31(ivec4)
307(o4): 306(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval001): 8(ptr) Variable Function
@@ -1137,7 +1154,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