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

@@ -148,10 +148,20 @@ gl_FragCoord origin is upper left
0:73 1 (const int)
0:73 Constant:
0:73 1.000000
0:75 Sequence
0:75 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:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:75 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:75 Color: direct index for structure (temp 4-component vector of float)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 0 (const int)
0:75 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:75 Depth: direct index for structure (temp float FragDepth)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 1 (const int)
0:75 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -340,10 +350,20 @@ gl_FragCoord origin is upper left
0:73 1 (const int)
0:73 Constant:
0:73 1.000000
0:75 Sequence
0:75 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:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:75 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:75 Color: direct index for structure (temp 4-component vector of float)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 0 (const int)
0:75 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:75 Depth: direct index for structure (temp float FragDepth)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 1 (const int)
0:75 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -381,7 +401,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 178
// Id's are bound by 179
Capability Shader
Capability ImageGatherExtended
@@ -389,7 +409,7 @@ gl_FragCoord origin is upper left
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 130 175 177
EntryPoint Fragment 4 "main" 130 134
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex1df4"
@@ -411,24 +431,23 @@ gl_FragCoord origin is upper left
MemberName 118(PS_OUTPUT) 0 "Color"
MemberName 118(PS_OUTPUT) 1 "Depth"
Name 120 "psout"
Name 130 "@entryPointOutput"
Name 135 "g_sSamp"
Name 138 "g_tTexcdf4"
Name 141 "g_tTexcdi4"
Name 144 "g_tTexcdu4"
Name 147 "g_tTex1df4a"
Name 150 "g_tTex1di4a"
Name 153 "g_tTex1du4a"
Name 156 "g_tTex2df4a"
Name 159 "g_tTex2di4a"
Name 162 "g_tTex2du4a"
Name 165 "g_tTexcdf4a"
Name 168 "g_tTexcdi4a"
Name 171 "g_tTexcdu4a"
Name 172 "c1"
Name 173 "o4"
Name 175 "Color"
Name 177 "Depth"
Name 130 "Color"
Name 134 "Depth"
Name 140 "g_sSamp"
Name 143 "g_tTexcdf4"
Name 146 "g_tTexcdi4"
Name 149 "g_tTexcdu4"
Name 152 "g_tTex1df4a"
Name 155 "g_tTex1di4a"
Name 158 "g_tTex1du4a"
Name 161 "g_tTex2df4a"
Name 164 "g_tTex2di4a"
Name 167 "g_tTex2du4a"
Name 170 "g_tTexcdf4a"
Name 173 "g_tTexcdi4a"
Name 176 "g_tTexcdu4a"
Name 177 "c1"
Name 178 "o4"
Decorate 9(g_tTex1df4) DescriptorSet 0
Decorate 9(g_tTex1df4) Binding 0
Decorate 29(g_tTex1di4) DescriptorSet 0
@@ -440,22 +459,22 @@ gl_FragCoord origin is upper left
Decorate 100(g_tTex3di4) DescriptorSet 0
Decorate 110(g_tTex3du4) DescriptorSet 0
MemberDecorate 118(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 135(g_sSamp) DescriptorSet 0
Decorate 135(g_sSamp) Binding 0
Decorate 138(g_tTexcdf4) DescriptorSet 0
Decorate 141(g_tTexcdi4) DescriptorSet 0
Decorate 144(g_tTexcdu4) DescriptorSet 0
Decorate 147(g_tTex1df4a) DescriptorSet 0
Decorate 150(g_tTex1di4a) DescriptorSet 0
Decorate 153(g_tTex1du4a) DescriptorSet 0
Decorate 156(g_tTex2df4a) DescriptorSet 0
Decorate 159(g_tTex2di4a) DescriptorSet 0
Decorate 162(g_tTex2du4a) DescriptorSet 0
Decorate 165(g_tTexcdf4a) DescriptorSet 0
Decorate 168(g_tTexcdi4a) DescriptorSet 0
Decorate 171(g_tTexcdu4a) DescriptorSet 0
Decorate 175(Color) Location 0
Decorate 177(Depth) BuiltIn FragDepth
Decorate 130(Color) Location 0
Decorate 134(Depth) BuiltIn FragDepth
Decorate 140(g_sSamp) DescriptorSet 0
Decorate 140(g_sSamp) Binding 0
Decorate 143(g_tTexcdf4) DescriptorSet 0
Decorate 146(g_tTexcdi4) DescriptorSet 0
Decorate 149(g_tTexcdu4) DescriptorSet 0
Decorate 152(g_tTex1df4a) DescriptorSet 0
Decorate 155(g_tTex1di4a) DescriptorSet 0
Decorate 158(g_tTex1du4a) DescriptorSet 0
Decorate 161(g_tTex2df4a) DescriptorSet 0
Decorate 164(g_tTex2di4a) DescriptorSet 0
Decorate 167(g_tTex2du4a) DescriptorSet 0
Decorate 170(g_tTexcdf4a) DescriptorSet 0
Decorate 173(g_tTexcdi4a) DescriptorSet 0
Decorate 176(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -515,53 +534,51 @@ gl_FragCoord origin is upper left
124: TypePointer Function 25(fvec4)
126: 11(int) Constant 1
127: TypePointer Function 6(float)
129: TypePointer Output 118(PS_OUTPUT)
130(@entryPointOutput): 129(ptr) Variable Output
133: TypeSampler
134: TypePointer UniformConstant 133
135(g_sSamp): 134(ptr) Variable UniformConstant
136: TypeImage 6(float) Cube sampled format:Unknown
137: TypePointer UniformConstant 136
138(g_tTexcdf4): 137(ptr) Variable UniformConstant
139: TypeImage 11(int) Cube sampled format:Unknown
140: TypePointer UniformConstant 139
141(g_tTexcdi4): 140(ptr) Variable UniformConstant
142: TypeImage 15(int) Cube sampled format:Unknown
143: TypePointer UniformConstant 142
144(g_tTexcdu4): 143(ptr) Variable UniformConstant
145: TypeImage 6(float) 1D array sampled format:Unknown
146: TypePointer UniformConstant 145
147(g_tTex1df4a): 146(ptr) Variable UniformConstant
148: TypeImage 11(int) 1D array sampled format:Unknown
149: TypePointer UniformConstant 148
150(g_tTex1di4a): 149(ptr) Variable UniformConstant
151: TypeImage 15(int) 1D array sampled format:Unknown
152: TypePointer UniformConstant 151
153(g_tTex1du4a): 152(ptr) Variable UniformConstant
154: TypeImage 6(float) 2D array sampled format:Unknown
155: TypePointer UniformConstant 154
156(g_tTex2df4a): 155(ptr) Variable UniformConstant
157: TypeImage 11(int) 2D array sampled format:Unknown
158: TypePointer UniformConstant 157
159(g_tTex2di4a): 158(ptr) Variable UniformConstant
160: TypeImage 15(int) 2D array sampled format:Unknown
161: TypePointer UniformConstant 160
162(g_tTex2du4a): 161(ptr) Variable UniformConstant
163: TypeImage 6(float) Cube array sampled format:Unknown
164: TypePointer UniformConstant 163
165(g_tTexcdf4a): 164(ptr) Variable UniformConstant
166: TypeImage 11(int) Cube array sampled format:Unknown
167: TypePointer UniformConstant 166
168(g_tTexcdi4a): 167(ptr) Variable UniformConstant
169: TypeImage 15(int) Cube array sampled format:Unknown
170: TypePointer UniformConstant 169
171(g_tTexcdu4a): 170(ptr) Variable UniformConstant
172(c1): 17(ptr) Variable UniformConstant
173(o4): 88(ptr) Variable UniformConstant
174: TypePointer Output 25(fvec4)
175(Color): 174(ptr) Variable Output
176: TypePointer Output 6(float)
177(Depth): 176(ptr) Variable Output
129: TypePointer Output 25(fvec4)
130(Color): 129(ptr) Variable Output
133: TypePointer Output 6(float)
134(Depth): 133(ptr) Variable Output
138: TypeSampler
139: TypePointer UniformConstant 138
140(g_sSamp): 139(ptr) Variable UniformConstant
141: TypeImage 6(float) Cube sampled format:Unknown
142: TypePointer UniformConstant 141
143(g_tTexcdf4): 142(ptr) Variable UniformConstant
144: TypeImage 11(int) Cube sampled format:Unknown
145: TypePointer UniformConstant 144
146(g_tTexcdi4): 145(ptr) Variable UniformConstant
147: TypeImage 15(int) Cube sampled format:Unknown
148: TypePointer UniformConstant 147
149(g_tTexcdu4): 148(ptr) Variable UniformConstant
150: TypeImage 6(float) 1D array sampled format:Unknown
151: TypePointer UniformConstant 150
152(g_tTex1df4a): 151(ptr) Variable UniformConstant
153: TypeImage 11(int) 1D array sampled format:Unknown
154: TypePointer UniformConstant 153
155(g_tTex1di4a): 154(ptr) Variable UniformConstant
156: TypeImage 15(int) 1D array sampled format:Unknown
157: TypePointer UniformConstant 156
158(g_tTex1du4a): 157(ptr) Variable UniformConstant
159: TypeImage 6(float) 2D array sampled format:Unknown
160: TypePointer UniformConstant 159
161(g_tTex2df4a): 160(ptr) Variable UniformConstant
162: TypeImage 11(int) 2D array sampled format:Unknown
163: TypePointer UniformConstant 162
164(g_tTex2di4a): 163(ptr) Variable UniformConstant
165: TypeImage 15(int) 2D array sampled format:Unknown
166: TypePointer UniformConstant 165
167(g_tTex2du4a): 166(ptr) Variable UniformConstant
168: TypeImage 6(float) Cube array sampled format:Unknown
169: TypePointer UniformConstant 168
170(g_tTexcdf4a): 169(ptr) Variable UniformConstant
171: TypeImage 11(int) Cube array sampled format:Unknown
172: TypePointer UniformConstant 171
173(g_tTexcdi4a): 172(ptr) Variable UniformConstant
174: TypeImage 15(int) Cube array sampled format:Unknown
175: TypePointer UniformConstant 174
176(g_tTexcdu4a): 175(ptr) Variable UniformConstant
177(c1): 17(ptr) Variable UniformConstant
178(o4): 88(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
120(psout): 119(ptr) Variable Function
@@ -632,7 +649,11 @@ gl_FragCoord origin is upper left
Store 125 123
128: 127(ptr) AccessChain 120(psout) 126
Store 128 122
131:118(PS_OUTPUT) Load 120(psout)
Store 130(@entryPointOutput) 131
131: 124(ptr) AccessChain 120(psout) 121
132: 25(fvec4) Load 131
Store 130(Color) 132
135: 127(ptr) AccessChain 120(psout) 126
136: 6(float) Load 135
Store 134(Depth) 136
Return
FunctionEnd