Split loop header from condition testing for for/while loops.

This commit is contained in:
Dejan Mircevski 2016-01-20 11:51:43 -05:00
parent 7349eab099
commit 213bbbe4a7
14 changed files with 1905 additions and 1828 deletions

View file

@ -10,12 +10,12 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 267
// Id's are bound by 269
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 75 225
EntryPoint Fragment 4 "main" 75 227
ExecutionMode 4 OriginLowerLeft
Source ESSL 310
Name 4 "main"
@ -33,24 +33,24 @@ Linked fragment stage:
Name 75 "x"
Name 129 "d"
Name 155 "i"
Name 174 "j"
Name 225 "color"
Name 231 "v"
Name 232 "param"
Name 175 "j"
Name 227 "color"
Name 233 "v"
Name 234 "param"
Name 236 "param"
Name 244 "param"
Name 238 "param"
Name 246 "param"
Name 248 "param"
Name 250 "param"
Decorate 60(local) RelaxedPrecision
Decorate 62(c) RelaxedPrecision
Decorate 73(f) RelaxedPrecision
Decorate 75(x) RelaxedPrecision
Decorate 129(d) RelaxedPrecision
Decorate 155(i) RelaxedPrecision
Decorate 174(j) RelaxedPrecision
Decorate 225(color) RelaxedPrecision
Decorate 231(v) RelaxedPrecision
Decorate 175(j) RelaxedPrecision
Decorate 227(color) RelaxedPrecision
Decorate 233(v) RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -71,31 +71,31 @@ Linked fragment stage:
75(x): 74(ptr) Variable Input
129(d): 61(ptr) Variable UniformConstant
156: 9(int) Constant 0
162: 9(int) Constant 10
163: TypeBool
175: 9(int) Constant 20
181: 9(int) Constant 30
186: 6(float) Constant 1120429670
206: 6(float) Constant 1079739679
224: TypePointer Output 6(float)
225(color): 224(ptr) Variable Output
230: TypePointer UniformConstant 7(fvec4)
231(v): 230(ptr) Variable UniformConstant
239: TypeInt 32 0
240: 239(int) Constant 1
251: 239(int) Constant 2
163: 9(int) Constant 10
164: TypeBool
176: 9(int) Constant 20
183: 9(int) Constant 30
188: 6(float) Constant 1120429670
208: 6(float) Constant 1079739679
226: TypePointer Output 6(float)
227(color): 226(ptr) Variable Output
232: TypePointer UniformConstant 7(fvec4)
233(v): 232(ptr) Variable UniformConstant
241: TypeInt 32 0
242: 241(int) Constant 1
253: 241(int) Constant 2
4(main): 2 Function None 3
5: Label
60(local): 10(ptr) Variable Function
73(f): 72(ptr) Variable Function
155(i): 10(ptr) Variable Function
174(j): 10(ptr) Variable Function
232(param): 8(ptr) Variable Function
175(j): 10(ptr) Variable Function
234(param): 8(ptr) Variable Function
236(param): 10(ptr) Variable Function
244(param): 8(ptr) Variable Function
236(param): 8(ptr) Variable Function
238(param): 10(ptr) Variable Function
246(param): 8(ptr) Variable Function
248(param): 10(ptr) Variable Function
248(param): 8(ptr) Variable Function
250(param): 10(ptr) Variable Function
63: 9(int) Load 62(c)
Store 60(local) 63
64: 9(int) Load 60(local)
@ -218,134 +218,138 @@ Linked fragment stage:
Store 155(i) 156
Branch 157
157: Label
161: 9(int) Load 155(i)
164: 163(bool) SLessThan 161 162
LoopMerge 159 160 None
BranchConditional 164 158 159
Branch 161
161: Label
162: 9(int) Load 155(i)
165: 164(bool) SLessThan 162 163
BranchConditional 165 158 159
158: Label
165: 9(int) Load 62(c)
SelectionMerge 169 None
Switch 165 168
case 1: 166
case 2: 167
168: Label
200: 6(float) Load 75(x)
201: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 200
202: 6(float) Load 73(f)
203: 6(float) FAdd 202 201
Store 73(f) 203
Branch 169
166: Label
170: 6(float) Load 75(x)
171: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 170
172: 6(float) Load 73(f)
173: 6(float) FAdd 172 171
Store 73(f) 173
Store 174(j) 175
Branch 176
176: Label
180: 9(int) Load 174(j)
182: 163(bool) SLessThan 180 181
LoopMerge 178 179 None
BranchConditional 182 177 178
177: Label
183: 6(float) Load 73(f)
184: 6(float) FAdd 183 48
Store 73(f) 184
185: 6(float) Load 73(f)
187: 163(bool) FOrdLessThan 185 186
SelectionMerge 189 None
BranchConditional 187 188 189
188: Label
Branch 178
189: Label
Branch 179
179: Label
191: 9(int) Load 174(j)
192: 9(int) IAdd 191 65
Store 174(j) 192
Branch 176
178: Label
Branch 169
166: 9(int) Load 62(c)
SelectionMerge 170 None
Switch 166 169
case 1: 167
case 2: 168
169: Label
202: 6(float) Load 75(x)
203: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 202
204: 6(float) Load 73(f)
205: 6(float) FAdd 204 203
Store 73(f) 205
Branch 170
167: Label
194: 6(float) Load 75(x)
195: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 194
196: 6(float) Load 73(f)
197: 6(float) FAdd 196 195
Store 73(f) 197
Branch 169
169: Label
205: 6(float) Load 73(f)
207: 163(bool) FOrdLessThan 205 206
SelectionMerge 209 None
BranchConditional 207 208 209
208: Label
171: 6(float) Load 75(x)
172: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 171
173: 6(float) Load 73(f)
174: 6(float) FAdd 173 172
Store 73(f) 174
Store 175(j) 176
Branch 177
177: Label
LoopMerge 179 180 None
Branch 181
181: Label
182: 9(int) Load 175(j)
184: 164(bool) SLessThan 182 183
BranchConditional 184 178 179
178: Label
185: 6(float) Load 73(f)
186: 6(float) FAdd 185 48
Store 73(f) 186
187: 6(float) Load 73(f)
189: 164(bool) FOrdLessThan 187 188
SelectionMerge 191 None
BranchConditional 189 190 191
190: Label
Branch 179
191: Label
Branch 180
180: Label
193: 9(int) Load 175(j)
194: 9(int) IAdd 193 65
Store 175(j) 194
Branch 177
179: Label
Branch 170
168: Label
196: 6(float) Load 75(x)
197: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 196
198: 6(float) Load 73(f)
199: 6(float) FAdd 198 197
Store 73(f) 199
Branch 170
170: Label
207: 6(float) Load 73(f)
209: 164(bool) FOrdLessThan 207 208
SelectionMerge 211 None
BranchConditional 209 210 211
210: Label
Branch 159
209: Label
211: Label
Branch 160
160: Label
211: 9(int) Load 155(i)
212: 9(int) IAdd 211 65
Store 155(i) 212
213: 9(int) Load 155(i)
214: 9(int) IAdd 213 65
Store 155(i) 214
Branch 157
159: Label
213: 9(int) Load 62(c)
SelectionMerge 216 None
Switch 213 216
case 1: 214
case 2: 215
214: Label
217: 6(float) Load 75(x)
218: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 217
219: 6(float) Load 73(f)
220: 6(float) FAdd 219 218
Store 73(f) 220
Branch 216
215: Label
Branch 216
216: Label
226: 6(float) Load 73(f)
227: 9(int) Load 60(local)
228: 6(float) ConvertSToF 227
229: 6(float) FAdd 226 228
Store 225(color) 229
233: 7(fvec4) Load 231(v)
Store 232(param) 233
235: 7(fvec4) Load 231(v)
215: 9(int) Load 62(c)
SelectionMerge 218 None
Switch 215 218
case 1: 216
case 2: 217
216: Label
219: 6(float) Load 75(x)
220: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 219
221: 6(float) Load 73(f)
222: 6(float) FAdd 221 220
Store 73(f) 222
Branch 218
217: Label
Branch 218
218: Label
228: 6(float) Load 73(f)
229: 9(int) Load 60(local)
230: 6(float) ConvertSToF 229
231: 6(float) FAdd 228 230
Store 227(color) 231
235: 7(fvec4) Load 233(v)
Store 234(param) 235
237: 9(int) Load 62(c)
237: 7(fvec4) Load 233(v)
Store 236(param) 237
238: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 232(param) 234(param) 236(param)
241: 6(float) CompositeExtract 238 1
242: 6(float) Load 225(color)
243: 6(float) FAdd 242 241
Store 225(color) 243
245: 7(fvec4) Load 231(v)
Store 244(param) 245
247: 7(fvec4) Load 231(v)
239: 9(int) Load 62(c)
Store 238(param) 239
240: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 234(param) 236(param) 238(param)
243: 6(float) CompositeExtract 240 1
244: 6(float) Load 227(color)
245: 6(float) FAdd 244 243
Store 227(color) 245
247: 7(fvec4) Load 233(v)
Store 246(param) 247
249: 9(int) Load 62(c)
249: 7(fvec4) Load 233(v)
Store 248(param) 249
250: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 244(param) 246(param) 248(param)
252: 6(float) CompositeExtract 250 2
253: 6(float) Load 225(color)
254: 6(float) FAdd 253 252
Store 225(color) 254
255: 9(int) Load 62(c)
SelectionMerge 258 None
Switch 255 257
case 0: 256
257: Label
Branch 258
256: Label
Branch 258
258: Label
262: 9(int) Load 62(c)
SelectionMerge 264 None
Switch 262 263
263: Label
Branch 264
264: Label
251: 9(int) Load 62(c)
Store 250(param) 251
252: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 246(param) 248(param) 250(param)
254: 6(float) CompositeExtract 252 2
255: 6(float) Load 227(color)
256: 6(float) FAdd 255 254
Store 227(color) 256
257: 9(int) Load 62(c)
SelectionMerge 260 None
Switch 257 259
case 0: 258
259: Label
Branch 260
258: Label
Branch 260
260: Label
264: 9(int) Load 62(c)
SelectionMerge 266 None
Switch 264 265
265: Label
Branch 266
266: Label
Return
FunctionEnd
15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11