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

@@ -126,7 +126,7 @@ gl_FragCoord origin is upper left
0:63 1.000000
0:65 Sequence
0:65 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:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:65 Branch: Return
0:? Linker Objects
@@ -152,7 +152,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:
@@ -285,7 +286,7 @@ gl_FragCoord origin is upper left
0:63 1.000000
0:65 Sequence
0:65 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:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:65 Branch: Return
0:? Linker Objects
@@ -311,18 +312,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 152
// Id's are bound by 156
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 104
EntryPoint Fragment 4 "main" 104 153 155
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r01"
@@ -358,6 +360,8 @@ gl_FragCoord origin is upper left
Name 145 "g_tTexcdf4a"
Name 148 "g_tTexcdi4a"
Name 151 "g_tTexcdu4a"
Name 153 "Color"
Name 155 "Depth"
Decorate 11(g_tTex1df4) DescriptorSet 0
Decorate 11(g_tTex1df4) Binding 0
Decorate 15(g_sSamp) DescriptorSet 0
@@ -368,7 +372,6 @@ gl_FragCoord origin is upper left
Decorate 71(g_tTex2di4) DescriptorSet 0
Decorate 83(g_tTex2du4) DescriptorSet 0
MemberDecorate 93(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 104(@entryPointOutput) Location 0
Decorate 109(g_tTex3df4) DescriptorSet 0
Decorate 112(g_tTex3di4) DescriptorSet 0
Decorate 115(g_tTex3du4) DescriptorSet 0
@@ -384,6 +387,8 @@ gl_FragCoord origin is upper left
Decorate 145(g_tTexcdf4a) DescriptorSet 0
Decorate 148(g_tTexcdi4a) DescriptorSet 0
Decorate 151(g_tTexcdu4a) DescriptorSet 0
Decorate 153(Color) Location 0
Decorate 155(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -488,6 +493,10 @@ gl_FragCoord origin is upper left
149: TypeImage 39(int) Cube array sampled format:Unknown
150: TypePointer UniformConstant 149
151(g_tTexcdu4a): 150(ptr) Variable UniformConstant
152: TypePointer Output 92(fvec4)
153(Color): 152(ptr) Variable Output
154: TypePointer Output 6(float)
155(Depth): 154(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(r01): 7(ptr) Variable Function