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

@@ -114,7 +114,7 @@ gl_FragCoord origin is upper left
0:34 1.000000
0:36 Sequence
0:36 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:36 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:36 Branch: Return
0:? Linker Objects
@@ -126,7 +126,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:
@@ -247,7 +248,7 @@ gl_FragCoord origin is upper left
0:34 1.000000
0:36 Sequence
0:36 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:36 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:36 Branch: Return
0:? Linker Objects
@@ -259,17 +260,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 106
// Id's are bound by 110
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 102
EntryPoint Fragment 4 "main" 102 107 109
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@@ -291,6 +293,8 @@ gl_FragCoord origin is upper left
Name 95 "psout"
Name 102 "@entryPointOutput"
Name 105 "g_tTex1df4a"
Name 107 "Color"
Name 109 "Depth"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -301,9 +305,10 @@ gl_FragCoord origin is upper left
Decorate 73(g_tTex2di4) DescriptorSet 0
Decorate 83(g_tTex2du4) DescriptorSet 0
MemberDecorate 93(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 102(@entryPointOutput) Location 0
Decorate 105(g_tTex1df4a) DescriptorSet 0
Decorate 105(g_tTex1df4a) Binding 1
Decorate 107(Color) Location 0
Decorate 109(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -371,6 +376,10 @@ gl_FragCoord origin is upper left
101: TypePointer Output 93(PS_OUTPUT)
102(@entryPointOutput): 101(ptr) Variable Output
105(g_tTex1df4a): 11(ptr) Variable UniformConstant
106: TypePointer Output 7(fvec4)
107(Color): 106(ptr) Variable Output
108: TypePointer Output 6(float)
109(Depth): 108(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function