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

@@ -120,7 +120,7 @@ gl_FragCoord origin is upper left
0:64 1.000000
0:66 Sequence
0:66 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:66 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:66 Branch: Return
0:? Linker Objects
@@ -146,7 +146,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4a' (uniform textureCubeArray)
0:? 'g_tTexcdi4a' (uniform itextureCubeArray)
0:? 'g_tTexcdu4a' (uniform utextureCubeArray)
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:
@@ -273,7 +274,7 @@ gl_FragCoord origin is upper left
0:64 1.000000
0:66 Sequence
0:66 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:66 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:66 Branch: Return
0:? Linker Objects
@@ -299,18 +300,19 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4a' (uniform textureCubeArray)
0:? 'g_tTexcdi4a' (uniform itextureCubeArray)
0:? 'g_tTexcdu4a' (uniform utextureCubeArray)
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 157
// Id's are bound by 161
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 109
EntryPoint Fragment 4 "main" 109 158 160
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r11"
@@ -346,6 +348,8 @@ gl_FragCoord origin is upper left
Name 150 "g_tTexcdf4a"
Name 153 "g_tTexcdi4a"
Name 156 "g_tTexcdu4a"
Name 158 "Color"
Name 160 "Depth"
Decorate 11(g_tTex1df4a) DescriptorSet 0
Decorate 15(g_sSamp) DescriptorSet 0
Decorate 15(g_sSamp) Binding 0
@@ -355,7 +359,6 @@ gl_FragCoord origin is upper left
Decorate 76(g_tTex2di4a) DescriptorSet 0
Decorate 88(g_tTex2du4a) DescriptorSet 0
MemberDecorate 98(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 109(@entryPointOutput) Location 0
Decorate 114(g_tTex1df4) DescriptorSet 0
Decorate 114(g_tTex1df4) Binding 0
Decorate 117(g_tTex1di4) DescriptorSet 0
@@ -372,6 +375,8 @@ gl_FragCoord origin is upper left
Decorate 150(g_tTexcdf4a) DescriptorSet 0
Decorate 153(g_tTexcdi4a) DescriptorSet 0
Decorate 156(g_tTexcdu4a) DescriptorSet 0
Decorate 158(Color) Location 0
Decorate 160(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -478,6 +483,10 @@ gl_FragCoord origin is upper left
154: TypeImage 43(int) Cube array sampled format:Unknown
155: TypePointer UniformConstant 154
156(g_tTexcdu4a): 155(ptr) Variable UniformConstant
157: TypePointer Output 97(fvec4)
158(Color): 157(ptr) Variable Output
159: TypePointer Output 6(float)
160(Depth): 159(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(r11): 7(ptr) Variable Function