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

@@ -114,7 +114,7 @@ gl_FragCoord origin is upper left
0:66 1.000000
0:68 Sequence
0:68 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:68 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:68 Branch: Return
0:? Linker Objects
@@ -148,7 +148,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:
@@ -269,7 +270,7 @@ gl_FragCoord origin is upper left
0:66 1.000000
0:68 Sequence
0:68 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:68 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:68 Branch: Return
0:? Linker Objects
@@ -303,11 +304,12 @@ 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 151
// Id's are bound by 155
Capability Shader
Capability ImageGatherExtended
@@ -315,7 +317,7 @@ gl_FragCoord origin is upper left
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 96
EntryPoint Fragment 4 "main" 96 152 154
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex1df4a"
@@ -353,6 +355,8 @@ gl_FragCoord origin is upper left
Name 148 "c2"
Name 149 "o3"
Name 150 "o4"
Name 152 "Color"
Name 154 "Depth"
Decorate 9(g_tTex1df4a) DescriptorSet 0
Decorate 29(g_tTex1di4a) DescriptorSet 0
Decorate 40(g_tTex1du4a) DescriptorSet 0
@@ -360,7 +364,6 @@ gl_FragCoord origin is upper left
Decorate 66(g_tTex2di4a) DescriptorSet 0
Decorate 76(g_tTex2du4a) DescriptorSet 0
MemberDecorate 84(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 96(@entryPointOutput) Location 0
Decorate 101(g_sSamp) DescriptorSet 0
Decorate 101(g_sSamp) Binding 0
Decorate 104(g_tTex1df4) DescriptorSet 0
@@ -379,6 +382,8 @@ gl_FragCoord origin is upper left
Decorate 140(g_tTexcdf4a) DescriptorSet 0
Decorate 143(g_tTexcdi4a) DescriptorSet 0
Decorate 146(g_tTexcdu4a) DescriptorSet 0
Decorate 152(Color) Location 0
Decorate 154(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -479,6 +484,10 @@ gl_FragCoord origin is upper left
148(c2): 60(ptr) Variable UniformConstant
149(o3): 13(ptr) Variable UniformConstant
150(o4): 53(ptr) Variable UniformConstant
151: TypePointer Output 25(fvec4)
152(Color): 151(ptr) Variable Output
153: TypePointer Output 6(float)
154(Depth): 153(ptr) Variable Output
4(main): 2 Function None 3
5: Label
86(psout): 85(ptr) Variable Function