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

@@ -63,7 +63,7 @@ gl_FragCoord origin is upper left
0:41 1.000000
0:43 Sequence
0:43 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:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:43 Branch: Return
0:? Linker Objects
@@ -81,7 +81,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:
@@ -151,7 +152,7 @@ gl_FragCoord origin is upper left
0:41 1.000000
0:43 Sequence
0:43 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:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:43 Branch: Return
0:? Linker Objects
@@ -169,17 +170,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 102
// Id's are bound by 106
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 71
EntryPoint Fragment 4 "main" 71 103 105
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
@@ -204,13 +206,14 @@ gl_FragCoord origin is upper left
Name 95 "g_tTexcdf4"
Name 98 "g_tTexcdi4"
Name 101 "g_tTexcdu4"
Name 103 "Color"
Name 105 "Depth"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 35(g_tTex2di4) DescriptorSet 0
Decorate 51(g_tTex2du4) DescriptorSet 0
MemberDecorate 62(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 71(@entryPointOutput) Location 0
Decorate 76(g_tTex1df4a) DescriptorSet 0
Decorate 76(g_tTex1df4a) Binding 1
Decorate 77(g_tTex1df4) DescriptorSet 0
@@ -223,6 +226,8 @@ gl_FragCoord origin is upper left
Decorate 95(g_tTexcdf4) DescriptorSet 0
Decorate 98(g_tTexcdi4) DescriptorSet 0
Decorate 101(g_tTexcdu4) DescriptorSet 0
Decorate 103(Color) Location 0
Decorate 105(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -301,6 +306,10 @@ gl_FragCoord origin is upper left
99: TypeImage 45(int) Cube sampled format:Unknown
100: TypePointer UniformConstant 99
101(g_tTexcdu4): 100(ptr) Variable UniformConstant
102: TypePointer Output 7(fvec4)
103(Color): 102(ptr) Variable Output
104: TypePointer Output 6(float)
105(Depth): 104(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function