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

@@ -159,7 +159,7 @@ gl_FragCoord origin is upper left
0:58 1.000000
0:60 Sequence
0:60 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:60 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:60 Branch: Return
0:? Linker Objects
@@ -185,7 +185,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:
@@ -351,7 +352,7 @@ gl_FragCoord origin is upper left
0:58 1.000000
0:60 Sequence
0:60 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:60 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:60 Branch: Return
0:? Linker Objects
@@ -377,18 +378,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 178
// Id's are bound by 182
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 139
EntryPoint Fragment 4 "main" 139 179 181
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r00"
@@ -427,6 +429,8 @@ gl_FragCoord origin is upper left
Name 171 "g_tTexcdf4a"
Name 174 "g_tTexcdi4a"
Name 177 "g_tTexcdu4a"
Name 179 "Color"
Name 181 "Depth"
Decorate 11(g_tTex1df4) DescriptorSet 0
Decorate 11(g_tTex1df4) Binding 0
Decorate 15(g_sSamp) DescriptorSet 0
@@ -440,7 +444,6 @@ gl_FragCoord origin is upper left
Decorate 106(g_tTexcdi4) DescriptorSet 0
Decorate 118(g_tTexcdu4) DescriptorSet 0
MemberDecorate 128(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 139(@entryPointOutput) Location 0
Decorate 144(g_tTex3df4) DescriptorSet 0
Decorate 147(g_tTex3di4) DescriptorSet 0
Decorate 150(g_tTex3du4) DescriptorSet 0
@@ -453,6 +456,8 @@ gl_FragCoord origin is upper left
Decorate 171(g_tTexcdf4a) DescriptorSet 0
Decorate 174(g_tTexcdi4a) DescriptorSet 0
Decorate 177(g_tTexcdu4a) DescriptorSet 0
Decorate 179(Color) Location 0
Decorate 181(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -562,6 +567,10 @@ gl_FragCoord origin is upper left
175: TypeImage 38(int) Cube array sampled format:Unknown
176: TypePointer UniformConstant 175
177(g_tTexcdu4a): 176(ptr) Variable UniformConstant
178: TypePointer Output 127(fvec4)
179(Color): 178(ptr) Variable Output
180: TypePointer Output 6(float)
181(Depth): 180(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(r00): 7(ptr) Variable Function