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

@@ -66,7 +66,7 @@ gl_FragCoord origin is upper left
0:33 1.000000
0:35 Sequence
0:35 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:35 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:35 Branch: Return
0:? Linker Objects
@@ -78,7 +78,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2df4' (uniform texture2DArray)
0:? 'g_tTex2di4' (uniform itexture2DArray)
0:? 'g_tTex2du4' (uniform utexture2DArray)
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:33 1.000000
0:35 Sequence
0:35 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:35 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:35 Branch: Return
0:? Linker Objects
@@ -163,17 +164,18 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2df4' (uniform texture2DArray)
0:? 'g_tTex2di4' (uniform itexture2DArray)
0:? 'g_tTex2du4' (uniform utexture2DArray)
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 85
// Id's are bound by 89
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 72
EntryPoint Fragment 4 "main" 72 86 88
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
@@ -192,19 +194,22 @@ gl_FragCoord origin is upper left
Name 78 "g_tTex1df4"
Name 81 "g_tTex1di4"
Name 84 "g_tTex1du4"
Name 86 "Color"
Name 88 "Depth"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 36(g_tTex2di4) DescriptorSet 0
Decorate 51(g_tTex2du4) DescriptorSet 0
MemberDecorate 63(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 72(@entryPointOutput) Location 0
Decorate 77(g_tTex1df4a) DescriptorSet 0
Decorate 77(g_tTex1df4a) Binding 1
Decorate 78(g_tTex1df4) DescriptorSet 0
Decorate 78(g_tTex1df4) Binding 0
Decorate 81(g_tTex1di4) DescriptorSet 0
Decorate 84(g_tTex1du4) DescriptorSet 0
Decorate 86(Color) Location 0
Decorate 88(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -266,6 +271,10 @@ gl_FragCoord origin is upper left
82: TypeImage 45(int) 1D array sampled format:Unknown
83: TypePointer UniformConstant 82
84(g_tTex1du4): 83(ptr) Variable UniformConstant
85: TypePointer Output 7(fvec4)
86(Color): 85(ptr) Variable Output
87: TypePointer Output 6(float)
88(Depth): 87(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function