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

@@ -225,7 +225,7 @@ gl_FragCoord origin is upper left
0:48 1.000000
0:50 Sequence
0:50 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:50 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 Branch: Return
0:? Linker Objects
@@ -243,7 +243,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:
@@ -475,7 +476,7 @@ gl_FragCoord origin is upper left
0:48 1.000000
0:50 Sequence
0:50 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:50 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 Branch: Return
0:? Linker Objects
@@ -493,17 +494,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 163
// Id's are bound by 167
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 159
EntryPoint Fragment 4 "main" 159 164 166
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@@ -537,6 +539,8 @@ gl_FragCoord origin is upper left
Name 150 "psout"
Name 159 "@entryPointOutput"
Name 162 "g_tTex1df4a"
Name 164 "Color"
Name 166 "Depth"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -553,9 +557,10 @@ gl_FragCoord origin is upper left
Decorate 133(g_tTexcdi4) DescriptorSet 0
Decorate 142(g_tTexcdu4) DescriptorSet 0
MemberDecorate 148(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 159(@entryPointOutput) Location 0
Decorate 162(g_tTex1df4a) DescriptorSet 0
Decorate 162(g_tTex1df4a) Binding 1
Decorate 164(Color) Location 0
Decorate 166(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -650,6 +655,10 @@ gl_FragCoord origin is upper left
158: TypePointer Output 148(PS_OUTPUT)
159(@entryPointOutput): 158(ptr) Variable Output
162(g_tTex1df4a): 11(ptr) Variable UniformConstant
163: TypePointer Output 7(fvec4)
164(Color): 163(ptr) Variable Output
165: TypePointer Output 6(float)
166(Depth): 165(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function