HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.

This commit is contained in:
John Kessenich
2016-09-16 03:05:12 -06:00
parent f8e494c18c
commit d21baed6bc
67 changed files with 4024 additions and 2886 deletions

View File

@@ -231,10 +231,20 @@ gl_FragCoord origin is upper left
0:87 1 (const int)
0:87 Constant:
0:87 1.000000
0:89 Sequence
0:89 move second child to first child (temp 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:89 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:89 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:89 Color: direct index for structure (temp 4-component vector of float)
0:89 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:89 Constant:
0:89 0 (const int)
0:89 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:89 Depth: direct index for structure (temp float FragDepth)
0:89 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:89 Constant:
0:89 1 (const int)
0:89 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -490,10 +500,20 @@ gl_FragCoord origin is upper left
0:87 1 (const int)
0:87 Constant:
0:87 1.000000
0:89 Sequence
0:89 move second child to first child (temp 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:89 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:89 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:89 Color: direct index for structure (temp 4-component vector of float)
0:89 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:89 Constant:
0:89 0 (const int)
0:89 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:89 Depth: direct index for structure (temp float FragDepth)
0:89 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:89 Constant:
0:89 1 (const int)
0:89 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -517,13 +537,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 190
// Id's are bound by 191
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 180 187 189
EntryPoint Fragment 4 "main" 180 184
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 7 "MemberTest"
@@ -569,12 +589,11 @@ gl_FragCoord origin is upper left
MemberName 171(PS_OUTPUT) 0 "Color"
MemberName 171(PS_OUTPUT) 1 "Depth"
Name 173 "psout"
Name 180 "@entryPointOutput"
Name 183 "g_sSamp2d"
Name 184 "g_sSamp2D_b"
Name 185 "g_tTex1df4a"
Name 187 "Color"
Name 189 "Depth"
Name 180 "Color"
Name 184 "Depth"
Name 188 "g_sSamp2d"
Name 189 "g_sSamp2D_b"
Name 190 "g_tTex1df4a"
Decorate 41(g_tTex1df4) DescriptorSet 0
Decorate 41(g_tTex1df4) Binding 0
Decorate 45(g_sSamp) DescriptorSet 0
@@ -591,12 +610,12 @@ gl_FragCoord origin is upper left
Decorate 156(g_tTexcdi4) DescriptorSet 0
Decorate 165(g_tTexcdu4) DescriptorSet 0
MemberDecorate 171(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 183(g_sSamp2d) DescriptorSet 0
Decorate 184(g_sSamp2D_b) DescriptorSet 0
Decorate 185(g_tTex1df4a) DescriptorSet 0
Decorate 185(g_tTex1df4a) Binding 1
Decorate 187(Color) Location 0
Decorate 189(Depth) BuiltIn FragDepth
Decorate 180(Color) Location 0
Decorate 184(Depth) BuiltIn FragDepth
Decorate 188(g_sSamp2d) DescriptorSet 0
Decorate 189(g_sSamp2D_b) DescriptorSet 0
Decorate 190(g_tTex1df4a) DescriptorSet 0
Decorate 190(g_tTex1df4a) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@@ -696,15 +715,13 @@ gl_FragCoord origin is upper left
174: 35(float) Constant 1065353216
175: 36(fvec4) ConstantComposite 174 174 174 174
177: TypePointer Function 35(float)
179: TypePointer Output 171(PS_OUTPUT)
180(@entryPointOutput): 179(ptr) Variable Output
183(g_sSamp2d): 44(ptr) Variable UniformConstant
184(g_sSamp2D_b): 44(ptr) Variable UniformConstant
185(g_tTex1df4a): 40(ptr) Variable UniformConstant
186: TypePointer Output 36(fvec4)
187(Color): 186(ptr) Variable Output
188: TypePointer Output 35(float)
189(Depth): 188(ptr) Variable Output
179: TypePointer Output 36(fvec4)
180(Color): 179(ptr) Variable Output
183: TypePointer Output 35(float)
184(Depth): 183(ptr) Variable Output
188(g_sSamp2d): 44(ptr) Variable UniformConstant
189(g_sSamp2D_b): 44(ptr) Variable UniformConstant
190(g_tTex1df4a): 40(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(mtest): 8(ptr) Variable Function
@@ -809,7 +826,11 @@ gl_FragCoord origin is upper left
Store 176 175
178: 177(ptr) AccessChain 173(psout) 10
Store 178 174
181:171(PS_OUTPUT) Load 173(psout)
Store 180(@entryPointOutput) 181
181: 37(ptr) AccessChain 173(psout) 23
182: 36(fvec4) Load 181
Store 180(Color) 182
185: 177(ptr) AccessChain 173(psout) 10
186: 35(float) Load 185
Store 184(Depth) 186
Return
FunctionEnd