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

@@ -90,7 +90,7 @@ gl_FragCoord origin is upper left
0:52 1.000000
0:54 Sequence
0:54 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:54 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:54 Branch: Return
0:? Linker Objects
@@ -109,7 +109,8 @@ gl_FragCoord origin is upper left
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
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:
@@ -206,7 +207,7 @@ gl_FragCoord origin is upper left
0:52 1.000000
0:54 Sequence
0:54 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:54 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:54 Branch: Return
0:? Linker Objects
@@ -225,18 +226,19 @@ gl_FragCoord origin is upper left
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
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 105
// Id's are bound by 109
Capability Shader
Capability ImageGatherExtended
Capability ImageMSArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 92
EntryPoint Fragment 4 "main" 92 106 108
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex2dmsf4"
@@ -259,6 +261,8 @@ gl_FragCoord origin is upper left
Name 102 "o1"
Name 103 "o3"
Name 104 "o4"
Name 106 "Color"
Name 108 "Depth"
Decorate 9(g_tTex2dmsf4) DescriptorSet 0
Decorate 21(g_tTex2dmsi4) DescriptorSet 0
Decorate 29(g_tTex2dmsu4) DescriptorSet 0
@@ -266,9 +270,10 @@ gl_FragCoord origin is upper left
Decorate 58(g_tTex2dmsi4a) DescriptorSet 0
Decorate 64(g_tTex2dmsu4a) DescriptorSet 0
MemberDecorate 80(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 92(@entryPointOutput) Location 0
Decorate 97(g_sSamp) DescriptorSet 0
Decorate 97(g_sSamp) Binding 0
Decorate 106(Color) Location 0
Decorate 108(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -323,6 +328,10 @@ gl_FragCoord origin is upper left
102(o1): 98(ptr) Variable UniformConstant
103(o3): 52(ptr) Variable UniformConstant
104(o4): 100(ptr) Variable UniformConstant
105: TypePointer Output 17(fvec4)
106(Color): 105(ptr) Variable Output
107: TypePointer Output 6(float)
108(Depth): 107(ptr) Variable Output
4(main): 2 Function None 3
5: Label
82(psout): 81(ptr) Variable Function