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

@ -36,10 +36,14 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:26 Sequence
0:26 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:26 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:? Sequence
0:? Sequence
0:26 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:26 Pos: direct index for structure (temp 4-component vector of float Position)
0:26 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:26 Constant:
0:26 0 (const int)
0:26 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@ -87,10 +91,14 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:26 Sequence
0:26 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:26 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:? Sequence
0:? Sequence
0:26 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:26 Pos: direct index for structure (temp 4-component vector of float Position)
0:26 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:26 Constant:
0:26 0 (const int)
0:26 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@ -99,14 +107,14 @@ Shader version: 450
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 44
// Id's are bound by 43
Capability Shader
Capability Sampled1D
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 36 43
EntryPoint Vertex 4 "main" 36
Name 4 "main"
Name 8 "sizeQueryTemp"
Name 12 "g_tTex1df4"
@ -116,15 +124,14 @@ Shader version: 450
Name 27 "VS_OUTPUT"
MemberName 27(VS_OUTPUT) 0 "Pos"
Name 29 "vsout"
Name 36 "@entryPointOutput"
Name 41 "g_sSamp"
Name 43 "Pos"
Name 36 "Pos"
Name 42 "g_sSamp"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
MemberDecorate 27(VS_OUTPUT) 0 BuiltIn Position
Decorate 41(g_sSamp) DescriptorSet 0
Decorate 41(g_sSamp) Binding 0
Decorate 43(Pos) BuiltIn Position
Decorate 36(Pos) BuiltIn Position
Decorate 42(g_sSamp) DescriptorSet 0
Decorate 42(g_sSamp) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -142,13 +149,11 @@ Shader version: 450
31: 9(float) Constant 0
32: 26(fvec4) ConstantComposite 31 31 31 31
33: TypePointer Function 26(fvec4)
35: TypePointer Output 27(VS_OUTPUT)
36(@entryPointOutput): 35(ptr) Variable Output
39: TypeSampler
40: TypePointer UniformConstant 39
41(g_sSamp): 40(ptr) Variable UniformConstant
42: TypePointer Output 26(fvec4)
43(Pos): 42(ptr) Variable Output
35: TypePointer Output 26(fvec4)
36(Pos): 35(ptr) Variable Output
40: TypeSampler
41: TypePointer UniformConstant 40
42(g_sSamp): 41(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
8(sizeQueryTemp): 7(ptr) Variable Function
@ -171,7 +176,8 @@ Shader version: 450
Store 23(NumberOfLevelsU) 25
34: 33(ptr) AccessChain 29(vsout) 30
Store 34 32
37:27(VS_OUTPUT) Load 29(vsout)
Store 36(@entryPointOutput) 37
37: 33(ptr) AccessChain 29(vsout) 30
38: 26(fvec4) Load 37
Store 36(Pos) 38
Return
FunctionEnd