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

@@ -215,10 +215,14 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:48 Sequence
0:48 move second child to first child (temp structure{temp 4-component vector of float Position Pos})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Position Pos})
0:48 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:? Sequence
0:? Sequence
0:48 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:48 Pos: direct index for structure (temp 4-component vector of float Position)
0:48 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:48 Constant:
0:48 0 (const int)
0:48 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -457,10 +461,14 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:48 Sequence
0:48 move second child to first child (temp structure{temp 4-component vector of float Position Pos})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Position Pos})
0:48 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:? Sequence
0:? Sequence
0:48 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:48 Pos: direct index for structure (temp 4-component vector of float Position)
0:48 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:48 Constant:
0:48 0 (const int)
0:48 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -481,13 +489,13 @@ Shader version: 450
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 162
// Id's are bound by 161
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 156 161
EntryPoint Vertex 4 "main" 156
Name 4 "main"
Name 9 "txval10"
Name 12 "g_tTex1df4"
@@ -517,9 +525,8 @@ Shader version: 450
Name 148 "VS_OUTPUT"
MemberName 148(VS_OUTPUT) 0 "Pos"
Name 150 "vsout"
Name 156 "@entryPointOutput"
Name 159 "g_tTex1df4a"
Name 161 "Pos"
Name 156 "Pos"
Name 160 "g_tTex1df4a"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -536,9 +543,9 @@ Shader version: 450
Decorate 133(g_tTexcdi4) DescriptorSet 0
Decorate 142(g_tTexcdu4) DescriptorSet 0
MemberDecorate 148(VS_OUTPUT) 0 BuiltIn Position
Decorate 159(g_tTex1df4a) DescriptorSet 0
Decorate 159(g_tTex1df4a) Binding 1
Decorate 161(Pos) BuiltIn Position
Decorate 156(Pos) BuiltIn Position
Decorate 160(g_tTex1df4a) DescriptorSet 0
Decorate 160(g_tTex1df4a) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -628,11 +635,9 @@ Shader version: 450
151: 24(int) Constant 0
152: 6(float) Constant 0
153: 7(fvec4) ConstantComposite 152 152 152 152
155: TypePointer Output 148(VS_OUTPUT)
156(@entryPointOutput): 155(ptr) Variable Output
159(g_tTex1df4a): 11(ptr) Variable UniformConstant
160: TypePointer Output 7(fvec4)
161(Pos): 160(ptr) Variable Output
155: TypePointer Output 7(fvec4)
156(Pos): 155(ptr) Variable Output
160(g_tTex1df4a): 11(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function
@@ -710,7 +715,8 @@ Shader version: 450
Store 139(txval42) 147
154: 8(ptr) AccessChain 150(vsout) 151
Store 154 153
157:148(VS_OUTPUT) Load 150(vsout)
Store 156(@entryPointOutput) 157
157: 8(ptr) AccessChain 150(vsout) 151
158: 7(fvec4) Load 157
Store 156(Pos) 158
Return
FunctionEnd