HLSL: Flatten a return struct from an entry point and assign locations after flattening.

Locations now get assigned in order, but skipping built-ins, which can be
done post flattening.
This commit is contained in:
John Kessenich 2016-09-16 01:44:43 -06:00
parent 7f702124ec
commit 7dc630f3da
93 changed files with 951 additions and 495 deletions

View file

@ -1062,7 +1062,7 @@ gl_FragCoord origin is upper left
0:277 1.000000
0:279 Sequence
0:279 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (layout(location=0 ) out 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:279 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:279 Branch: Return
0:? Linker Objects
@ -1094,7 +1094,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:? 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:? 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
Linked fragment stage:
@ -2163,7 +2164,7 @@ gl_FragCoord origin is upper left
0:277 1.000000
0:279 Sequence
0:279 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (layout(location=0 ) out 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:279 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:279 Branch: Return
0:? Linker Objects
@ -2195,11 +2196,12 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2dmsf4a' (uniform texture2DMSArray)
0:? 'g_tTex2dmsi4a' (uniform itexture2DMSArray)
0:? 'g_tTex2dmsu4a' (uniform utexture2DMSArray)
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 540
// Id's are bound by 544
Capability Shader
Capability Sampled1D
@ -2208,7 +2210,7 @@ gl_FragCoord origin is upper left
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 534
EntryPoint Fragment 4 "main" 534 541 543
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "sizeQueryTemp"
@ -2298,6 +2300,8 @@ gl_FragCoord origin is upper left
Name 524 "psout"
Name 534 "@entryPointOutput"
Name 539 "g_sSamp"
Name 541 "Color"
Name 543 "Depth"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 29(g_tTex1di4) DescriptorSet 0
@ -2327,9 +2331,10 @@ gl_FragCoord origin is upper left
Decorate 496(g_tTex2dmsi4a) DescriptorSet 0
Decorate 510(g_tTex2dmsu4a) DescriptorSet 0
MemberDecorate 522(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 534(@entryPointOutput) Location 0
Decorate 539(g_sSamp) DescriptorSet 0
Decorate 539(g_sSamp) Binding 0
Decorate 541(Color) Location 0
Decorate 543(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -2441,6 +2446,10 @@ gl_FragCoord origin is upper left
537: TypeSampler
538: TypePointer UniformConstant 537
539(g_sSamp): 538(ptr) Variable UniformConstant
540: TypePointer Output 521(fvec4)
541(Color): 540(ptr) Variable Output
542: TypePointer Output 9(float)
543(Depth): 542(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(sizeQueryTemp): 7(ptr) Variable Function