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

@@ -141,7 +141,7 @@ gl_FragCoord origin is upper left
0:73 1.000000
0:75 Sequence
0:75 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:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Branch: Return
0:? Linker Objects
@@ -175,7 +175,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:
@@ -323,7 +324,7 @@ gl_FragCoord origin is upper left
0:73 1.000000
0:75 Sequence
0:75 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:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Branch: Return
0:? Linker Objects
@@ -357,18 +358,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 165
// Id's are bound by 169
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 118
EntryPoint Fragment 4 "main" 118 166 168
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex1df4"
@@ -406,6 +408,8 @@ gl_FragCoord origin is upper left
Name 162 "o2"
Name 163 "o3"
Name 164 "o4"
Name 166 "Color"
Name 168 "Depth"
Decorate 9(g_tTex1df4) DescriptorSet 0
Decorate 9(g_tTex1df4) Binding 0
Decorate 27(g_tTex1di4) DescriptorSet 0
@@ -417,7 +421,6 @@ gl_FragCoord origin is upper left
Decorate 90(g_tTex3di4) DescriptorSet 0
Decorate 99(g_tTex3du4) DescriptorSet 0
MemberDecorate 106(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 118(@entryPointOutput) Location 0
Decorate 123(g_sSamp) DescriptorSet 0
Decorate 123(g_sSamp) Binding 0
Decorate 126(g_tTexcdf4) DescriptorSet 0
@@ -432,6 +435,8 @@ gl_FragCoord origin is upper left
Decorate 153(g_tTexcdf4a) DescriptorSet 0
Decorate 156(g_tTexcdi4a) DescriptorSet 0
Decorate 159(g_tTexcdu4a) DescriptorSet 0
Decorate 166(Color) Location 0
Decorate 168(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -534,6 +539,10 @@ gl_FragCoord origin is upper left
162(o2): 13(ptr) Variable UniformConstant
163(o3): 50(ptr) Variable UniformConstant
164(o4): 80(ptr) Variable UniformConstant
165: TypePointer Output 23(fvec4)
166(Color): 165(ptr) Variable Output
167: TypePointer Output 6(float)
168(Depth): 167(ptr) Variable Output
4(main): 2 Function None 3
5: Label
108(psout): 107(ptr) Variable Function