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

@@ -195,7 +195,7 @@ gl_FragCoord origin is upper left
0:46 1.000000
0:48 Sequence
0:48 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:48 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:48 Branch: Return
0:? Linker Objects
@@ -213,7 +213,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
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:
@@ -415,7 +416,7 @@ gl_FragCoord origin is upper left
0:46 1.000000
0:48 Sequence
0:48 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:48 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:48 Branch: Return
0:? Linker Objects
@@ -433,17 +434,18 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
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 154
// Id's are bound by 158
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 141
EntryPoint Fragment 4 "main" 141 155 157
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@@ -474,6 +476,8 @@ gl_FragCoord origin is upper left
Name 147 "g_tTexcdf4"
Name 150 "g_tTexcdi4"
Name 153 "g_tTexcdu4"
Name 155 "Color"
Name 157 "Depth"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -487,12 +491,13 @@ gl_FragCoord origin is upper left
Decorate 110(g_tTex3di4) DescriptorSet 0
Decorate 121(g_tTex3du4) DescriptorSet 0
MemberDecorate 132(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 141(@entryPointOutput) Location 0
Decorate 144(g_tTex1df4a) DescriptorSet 0
Decorate 144(g_tTex1df4a) Binding 1
Decorate 147(g_tTexcdf4) DescriptorSet 0
Decorate 150(g_tTexcdi4) DescriptorSet 0
Decorate 153(g_tTexcdu4) DescriptorSet 0
Decorate 155(Color) Location 0
Decorate 157(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -593,6 +598,10 @@ gl_FragCoord origin is upper left
151: TypeImage 38(int) Cube sampled format:Unknown
152: TypePointer UniformConstant 151
153(g_tTexcdu4): 152(ptr) Variable UniformConstant
154: TypePointer Output 7(fvec4)
155(Color): 154(ptr) Variable Output
156: TypePointer Output 6(float)
157(Depth): 156(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function