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

@@ -77,10 +77,14 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:45 Sequence
0:45 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:45 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:? Sequence
0:? Sequence
0:45 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:45 Pos: direct index for structure (temp 4-component vector of float Position)
0:45 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:45 Constant:
0:45 0 (const int)
0:45 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -182,10 +186,14 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:45 Sequence
0:45 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:45 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:? Sequence
0:? Sequence
0:45 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:45 Pos: direct index for structure (temp 4-component vector of float Position)
0:45 'vsout' (temp structure{temp 4-component vector of float Position Pos})
0:45 Constant:
0:45 0 (const int)
0:45 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -207,13 +215,13 @@ Shader version: 450
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 122
// Id's are bound by 121
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 97 121
EntryPoint Vertex 4 "main" 97
Name 4 "main"
Name 9 "txval20"
Name 12 "g_tTex2df4"
@@ -231,16 +239,15 @@ Shader version: 450
Name 90 "VS_OUTPUT"
MemberName 90(VS_OUTPUT) 0 "Pos"
Name 92 "vsout"
Name 97 "@entryPointOutput"
Name 100 "g_sSamp2d"
Name 103 "g_tTex1df4a"
Name 104 "g_tTex1df4"
Name 107 "g_tTex1di4"
Name 110 "g_tTex1du4"
Name 113 "g_tTex3df4"
Name 116 "g_tTex3di4"
Name 119 "g_tTex3du4"
Name 121 "Pos"
Name 97 "Pos"
Name 101 "g_sSamp2d"
Name 104 "g_tTex1df4a"
Name 105 "g_tTex1df4"
Name 108 "g_tTex1di4"
Name 111 "g_tTex1du4"
Name 114 "g_tTex3df4"
Name 117 "g_tTex3di4"
Name 120 "g_tTex3du4"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
@@ -250,17 +257,17 @@ Shader version: 450
Decorate 70(g_tTexcdi4) DescriptorSet 0
Decorate 80(g_tTexcdu4) DescriptorSet 0
MemberDecorate 90(VS_OUTPUT) 0 BuiltIn Position
Decorate 100(g_sSamp2d) DescriptorSet 0
Decorate 103(g_tTex1df4a) DescriptorSet 0
Decorate 103(g_tTex1df4a) Binding 1
Decorate 104(g_tTex1df4) DescriptorSet 0
Decorate 104(g_tTex1df4) Binding 0
Decorate 107(g_tTex1di4) DescriptorSet 0
Decorate 110(g_tTex1du4) DescriptorSet 0
Decorate 113(g_tTex3df4) DescriptorSet 0
Decorate 116(g_tTex3di4) DescriptorSet 0
Decorate 119(g_tTex3du4) DescriptorSet 0
Decorate 121(Pos) BuiltIn Position
Decorate 97(Pos) BuiltIn Position
Decorate 101(g_sSamp2d) DescriptorSet 0
Decorate 104(g_tTex1df4a) DescriptorSet 0
Decorate 104(g_tTex1df4a) Binding 1
Decorate 105(g_tTex1df4) DescriptorSet 0
Decorate 105(g_tTex1df4) Binding 0
Decorate 108(g_tTex1di4) DescriptorSet 0
Decorate 111(g_tTex1du4) DescriptorSet 0
Decorate 114(g_tTex3df4) DescriptorSet 0
Decorate 117(g_tTex3di4) DescriptorSet 0
Decorate 120(g_tTex3du4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -321,30 +328,28 @@ Shader version: 450
91: TypePointer Function 90(VS_OUTPUT)
93: 6(float) Constant 0
94: 7(fvec4) ConstantComposite 93 93 93 93
96: TypePointer Output 90(VS_OUTPUT)
97(@entryPointOutput): 96(ptr) Variable Output
100(g_sSamp2d): 15(ptr) Variable UniformConstant
101: TypeImage 6(float) 1D sampled format:Unknown
102: TypePointer UniformConstant 101
103(g_tTex1df4a): 102(ptr) Variable UniformConstant
104(g_tTex1df4): 102(ptr) Variable UniformConstant
105: TypeImage 24(int) 1D sampled format:Unknown
106: TypePointer UniformConstant 105
107(g_tTex1di4): 106(ptr) Variable UniformConstant
108: TypeImage 41(int) 1D sampled format:Unknown
109: TypePointer UniformConstant 108
110(g_tTex1du4): 109(ptr) Variable UniformConstant
111: TypeImage 6(float) 3D sampled format:Unknown
112: TypePointer UniformConstant 111
113(g_tTex3df4): 112(ptr) Variable UniformConstant
114: TypeImage 24(int) 3D sampled format:Unknown
115: TypePointer UniformConstant 114
116(g_tTex3di4): 115(ptr) Variable UniformConstant
117: TypeImage 41(int) 3D sampled format:Unknown
118: TypePointer UniformConstant 117
119(g_tTex3du4): 118(ptr) Variable UniformConstant
120: TypePointer Output 7(fvec4)
121(Pos): 120(ptr) Variable Output
96: TypePointer Output 7(fvec4)
97(Pos): 96(ptr) Variable Output
101(g_sSamp2d): 15(ptr) Variable UniformConstant
102: TypeImage 6(float) 1D sampled format:Unknown
103: TypePointer UniformConstant 102
104(g_tTex1df4a): 103(ptr) Variable UniformConstant
105(g_tTex1df4): 103(ptr) Variable UniformConstant
106: TypeImage 24(int) 1D sampled format:Unknown
107: TypePointer UniformConstant 106
108(g_tTex1di4): 107(ptr) Variable UniformConstant
109: TypeImage 41(int) 1D sampled format:Unknown
110: TypePointer UniformConstant 109
111(g_tTex1du4): 110(ptr) Variable UniformConstant
112: TypeImage 6(float) 3D sampled format:Unknown
113: TypePointer UniformConstant 112
114(g_tTex3df4): 113(ptr) Variable UniformConstant
115: TypeImage 24(int) 3D sampled format:Unknown
116: TypePointer UniformConstant 115
117(g_tTex3di4): 116(ptr) Variable UniformConstant
118: TypeImage 41(int) 3D sampled format:Unknown
119: TypePointer UniformConstant 118
120(g_tTex3du4): 119(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function
@@ -386,7 +391,8 @@ Shader version: 450
Store 77(txval42) 89
95: 8(ptr) AccessChain 92(vsout) 25
Store 95 94
98:90(VS_OUTPUT) Load 92(vsout)
Store 97(@entryPointOutput) 98
98: 8(ptr) AccessChain 92(vsout) 25
99: 7(fvec4) Load 98
Store 97(Pos) 99
Return
FunctionEnd