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

@@ -132,7 +132,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
@@ -158,7 +158,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:
@@ -297,7 +298,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
@@ -323,18 +324,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 158
// Id's are bound by 162
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 110
EntryPoint Fragment 4 "main" 110 159 161
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r11"
@@ -370,6 +372,8 @@ gl_FragCoord origin is upper left
Name 151 "g_tTexcdf4a"
Name 154 "g_tTexcdi4a"
Name 157 "g_tTexcdu4a"
Name 159 "Color"
Name 161 "Depth"
Decorate 11(g_tTex1df4a) DescriptorSet 0
Decorate 15(g_sSamp) DescriptorSet 0
Decorate 15(g_sSamp) Binding 0
@@ -379,7 +383,6 @@ gl_FragCoord origin is upper left
Decorate 77(g_tTex2di4a) DescriptorSet 0
Decorate 89(g_tTex2du4a) DescriptorSet 0
MemberDecorate 99(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 110(@entryPointOutput) Location 0
Decorate 115(g_tTex1df4) DescriptorSet 0
Decorate 115(g_tTex1df4) Binding 0
Decorate 118(g_tTex1di4) DescriptorSet 0
@@ -396,6 +399,8 @@ gl_FragCoord origin is upper left
Decorate 151(g_tTexcdf4a) DescriptorSet 0
Decorate 154(g_tTexcdi4a) DescriptorSet 0
Decorate 157(g_tTexcdu4a) DescriptorSet 0
Decorate 159(Color) Location 0
Decorate 161(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -503,6 +508,10 @@ gl_FragCoord origin is upper left
155: TypeImage 44(int) Cube array sampled format:Unknown
156: TypePointer UniformConstant 155
157(g_tTexcdu4a): 156(ptr) Variable UniformConstant
158: TypePointer Output 98(fvec4)
159(Color): 158(ptr) Variable Output
160: TypePointer Output 6(float)
161(Depth): 160(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(r11): 7(ptr) Variable Function