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

@@ -264,7 +264,7 @@ gl_FragCoord origin is upper left
0:74 1.000000
0:76 Sequence
0:76 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:76 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:76 Branch: Return
0:? Linker Objects
@@ -287,7 +287,8 @@ gl_FragCoord origin is upper left
0:? 'c2' (uniform 2-component vector of float)
0:? 'c3' (uniform 3-component vector of float)
0:? 'c4' (uniform 4-component vector of float)
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:
@@ -558,7 +559,7 @@ gl_FragCoord origin is upper left
0:74 1.000000
0:76 Sequence
0:76 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:76 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:76 Branch: Return
0:? Linker Objects
@@ -581,17 +582,18 @@ gl_FragCoord origin is upper left
0:? 'c2' (uniform 2-component vector of float)
0:? 'c3' (uniform 3-component vector of float)
0:? 'c4' (uniform 4-component vector of float)
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 232
// Id's are bound by 236
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 205
EntryPoint Fragment 4 "main" 205 233 235
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval00"
@@ -642,6 +644,8 @@ gl_FragCoord origin is upper left
Name 227 "g_tTex3du4"
Name 229 "c1"
Name 231 "c4"
Name 233 "Color"
Name 235 "Depth"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
@@ -651,7 +655,6 @@ gl_FragCoord origin is upper left
Decorate 125(g_tTexcdi4) DescriptorSet 0
Decorate 135(g_tTexcdu4) DescriptorSet 0
MemberDecorate 196(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 205(@entryPointOutput) Location 0
Decorate 208(g_sSamp2d) DescriptorSet 0
Decorate 211(g_tTex1df4a) DescriptorSet 0
Decorate 211(g_tTex1df4a) Binding 1
@@ -662,6 +665,8 @@ gl_FragCoord origin is upper left
Decorate 221(g_tTex3df4) DescriptorSet 0
Decorate 224(g_tTex3di4) DescriptorSet 0
Decorate 227(g_tTex3du4) DescriptorSet 0
Decorate 233(Color) Location 0
Decorate 235(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -741,6 +746,10 @@ gl_FragCoord origin is upper left
229(c1): 228(ptr) Variable UniformConstant
230: TypePointer UniformConstant 7(fvec4)
231(c4): 230(ptr) Variable UniformConstant
232: TypePointer Output 7(fvec4)
233(Color): 232(ptr) Variable Output
234: TypePointer Output 6(float)
235(Depth): 234(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval00): 8(ptr) Variable Function