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:36 1.000000
0:38 Sequence
0:38 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:38 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:38 Branch: Return
0:? Linker Objects
@@ -147,7 +147,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4' (uniform textureCubeArray)
0:? 'g_tTexcdi4' (uniform itextureCubeArray)
0:? 'g_tTexcdu4' (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:
@@ -286,7 +287,7 @@ gl_FragCoord origin is upper left
0:36 1.000000
0:38 Sequence
0:38 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:38 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:38 Branch: Return
0:? Linker Objects
@@ -301,18 +302,19 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4' (uniform textureCubeArray)
0:? 'g_tTexcdi4' (uniform itextureCubeArray)
0:? 'g_tTexcdu4' (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 108
// Id's are bound by 112
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 95
EntryPoint Fragment 4 "main" 95 109 111
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@@ -337,6 +339,8 @@ gl_FragCoord origin is upper left
Name 101 "g_tTexcdf4"
Name 104 "g_tTexcdi4"
Name 107 "g_tTexcdu4"
Name 109 "Color"
Name 111 "Depth"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -347,12 +351,13 @@ gl_FragCoord origin is upper left
Decorate 71(g_tTex2di4) DescriptorSet 0
Decorate 80(g_tTex2du4) DescriptorSet 0
MemberDecorate 86(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 95(@entryPointOutput) Location 0
Decorate 98(g_tTex1df4a) DescriptorSet 0
Decorate 98(g_tTex1df4a) Binding 1
Decorate 101(g_tTexcdf4) DescriptorSet 0
Decorate 104(g_tTexcdi4) DescriptorSet 0
Decorate 107(g_tTexcdu4) DescriptorSet 0
Decorate 109(Color) Location 0
Decorate 111(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -422,6 +427,10 @@ gl_FragCoord origin is upper left
105: TypeImage 40(int) Cube array sampled format:Unknown
106: TypePointer UniformConstant 105
107(g_tTexcdu4): 106(ptr) Variable UniformConstant
108: TypePointer Output 7(fvec4)
109(Color): 108(ptr) Variable Output
110: TypePointer Output 6(float)
111(Depth): 110(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function