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

@@ -336,7 +336,7 @@ gl_FragCoord origin is upper left
0:107 1.000000
0:109 Sequence
0:109 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:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:109 Branch: Return
0:? Linker Objects
@@ -359,7 +359,8 @@ gl_FragCoord origin is upper left
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
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:
@@ -702,7 +703,7 @@ gl_FragCoord origin is upper left
0:107 1.000000
0:109 Sequence
0:109 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:109 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:109 Branch: Return
0:? Linker Objects
@@ -725,11 +726,12 @@ gl_FragCoord origin is upper left
0:? 'o2' (uniform 2-component vector of int)
0:? 'o3' (uniform 3-component vector of int)
0:? 'o4' (uniform 4-component vector of int)
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 303
// Id's are bound by 307
Capability Shader
Capability ImageGatherExtended
@@ -737,7 +739,7 @@ gl_FragCoord origin is upper left
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 267
EntryPoint Fragment 4 "main" 267 304 306
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval001"
@@ -788,13 +790,14 @@ gl_FragCoord origin is upper left
Name 297 "o1"
Name 300 "o3"
Name 302 "o4"
Name 304 "Color"
Name 306 "Depth"
Decorate 12(g_tTex2df4a) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 36(g_tTex2di4a) DescriptorSet 0
Decorate 50(g_tTex2du4a) DescriptorSet 0
MemberDecorate 258(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 267(@entryPointOutput) Location 0
Decorate 270(g_sSamp2d) DescriptorSet 0
Decorate 273(g_tTex1df4a) DescriptorSet 0
Decorate 273(g_tTex1df4a) Binding 0
@@ -803,6 +806,8 @@ gl_FragCoord origin is upper left
Decorate 282(g_tTexcdf4a) DescriptorSet 0
Decorate 285(g_tTexcdi4a) DescriptorSet 0
Decorate 288(g_tTexcdu4a) DescriptorSet 0
Decorate 304(Color) Location 0
Decorate 306(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -881,6 +886,10 @@ gl_FragCoord origin is upper left
300(o3): 299(ptr) Variable UniformConstant
301: TypePointer UniformConstant 31(ivec4)
302(o4): 301(ptr) Variable UniformConstant
303: TypePointer Output 7(fvec4)
304(Color): 303(ptr) Variable Output
305: TypePointer Output 6(float)
306(Depth): 305(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval001): 8(ptr) Variable Function