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

@ -150,7 +150,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
@ -184,7 +184,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:
@ -341,7 +342,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
@ -375,11 +376,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 174
// Id's are bound by 178
Capability Shader
Capability ImageGatherExtended
@ -387,7 +389,7 @@ gl_FragCoord origin is upper left
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 130
EntryPoint Fragment 4 "main" 130 175 177
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex1df4"
@ -425,6 +427,8 @@ gl_FragCoord origin is upper left
Name 171 "g_tTexcdu4a"
Name 172 "c1"
Name 173 "o4"
Name 175 "Color"
Name 177 "Depth"
Decorate 9(g_tTex1df4) DescriptorSet 0
Decorate 9(g_tTex1df4) Binding 0
Decorate 29(g_tTex1di4) DescriptorSet 0
@ -436,7 +440,6 @@ gl_FragCoord origin is upper left
Decorate 100(g_tTex3di4) DescriptorSet 0
Decorate 110(g_tTex3du4) DescriptorSet 0
MemberDecorate 118(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 130(@entryPointOutput) Location 0
Decorate 135(g_sSamp) DescriptorSet 0
Decorate 135(g_sSamp) Binding 0
Decorate 138(g_tTexcdf4) DescriptorSet 0
@ -451,6 +454,8 @@ gl_FragCoord origin is upper left
Decorate 165(g_tTexcdf4a) DescriptorSet 0
Decorate 168(g_tTexcdi4a) DescriptorSet 0
Decorate 171(g_tTexcdu4a) DescriptorSet 0
Decorate 175(Color) Location 0
Decorate 177(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -553,6 +558,10 @@ gl_FragCoord origin is upper left
171(g_tTexcdu4a): 170(ptr) Variable UniformConstant
172(c1): 17(ptr) Variable UniformConstant
173(o4): 88(ptr) Variable UniformConstant
174: TypePointer Output 25(fvec4)
175(Color): 174(ptr) Variable Output
176: TypePointer Output 6(float)
177(Depth): 176(ptr) Variable Output
4(main): 2 Function None 3
5: Label
120(psout): 119(ptr) Variable Function