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

@@ -87,7 +87,7 @@ gl_FragCoord origin is upper left
0:45 1.000000
0:47 Sequence
0:47 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:47 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:47 Branch: Return
0:? Linker Objects
@@ -106,7 +106,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:
@@ -200,7 +201,7 @@ gl_FragCoord origin is upper left
0:45 1.000000
0:47 Sequence
0:47 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:47 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:47 Branch: Return
0:? Linker Objects
@@ -219,17 +220,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 123
// Id's are bound by 127
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 100
EntryPoint Fragment 4 "main" 100 124 126
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
@@ -258,6 +260,8 @@ gl_FragCoord origin is upper left
Name 116 "g_tTex3df4"
Name 119 "g_tTex3di4"
Name 122 "g_tTex3du4"
Name 124 "Color"
Name 126 "Depth"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
@@ -267,7 +271,6 @@ gl_FragCoord origin is upper left
Decorate 70(g_tTexcdi4) DescriptorSet 0
Decorate 80(g_tTexcdu4) DescriptorSet 0
MemberDecorate 90(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 100(@entryPointOutput) Location 0
Decorate 103(g_sSamp2d) DescriptorSet 0
Decorate 106(g_tTex1df4a) DescriptorSet 0
Decorate 106(g_tTex1df4a) Binding 1
@@ -278,6 +281,8 @@ gl_FragCoord origin is upper left
Decorate 116(g_tTex3df4) DescriptorSet 0
Decorate 119(g_tTex3di4) DescriptorSet 0
Decorate 122(g_tTex3du4) DescriptorSet 0
Decorate 124(Color) Location 0
Decorate 126(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -362,6 +367,10 @@ gl_FragCoord origin is upper left
120: TypeImage 41(int) 3D sampled format:Unknown
121: TypePointer UniformConstant 120
122(g_tTex3du4): 121(ptr) Variable UniformConstant
123: TypePointer Output 7(fvec4)
124(Color): 123(ptr) Variable Output
125: TypePointer Output 6(float)
126(Depth): 125(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function