• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!amber
2
3# Copyright 2020 Google LLC
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17
18# A test for a bug found by the GraphicsFuzz project.
19
20# Short description: Three shaders with diff: conditional %270 is flattened
21
22# The test renders three images using semantically equivalent shaders, and then
23# checks that the images are similar.
24# The test passes because the shaders have the same semantics and so the images
25# should be the same.
26
27SHADER vertex reference_vertex_shader PASSTHROUGH
28
29SHADER fragment reference_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
30; SPIR-V
31; Version: 1.0
32; Generator: Khronos Glslang Reference Front End; 7
33; Bound: 442
34; Schema: 0
35               OpCapability Shader
36          %1 = OpExtInstImport "GLSL.std.450"
37               OpMemoryModel Logical GLSL450
38               OpEntryPoint Fragment %4 "main" %12 %435
39               OpExecutionMode %4 OriginUpperLeft
40               OpSource ESSL 320
41               OpName %4 "main"
42               OpName %9 "pos"
43               OpName %12 "gl_FragCoord"
44               OpName %15 "buf0"
45               OpMemberName %15 0 "resolution"
46               OpName %17 ""
47               OpName %26 "ipos"
48               OpName %42 "i"
49               OpName %55 "map"
50               OpName %62 "p"
51               OpName %65 "canwalk"
52               OpName %67 "v"
53               OpName %74 "directions"
54               OpName %171 "j"
55               OpName %208 "d"
56               OpName %435 "_GLF_color"
57               OpDecorate %12 BuiltIn FragCoord
58               OpMemberDecorate %15 0 Offset 0
59               OpDecorate %15 Block
60               OpDecorate %17 DescriptorSet 0
61               OpDecorate %17 Binding 0
62               OpDecorate %435 Location 0
63          %2 = OpTypeVoid
64          %3 = OpTypeFunction %2
65          %6 = OpTypeFloat 32
66          %7 = OpTypeVector %6 2
67          %8 = OpTypePointer Function %7
68         %10 = OpTypeVector %6 4
69         %11 = OpTypePointer Input %10
70         %12 = OpVariable %11 Input
71         %15 = OpTypeStruct %7
72         %16 = OpTypePointer Uniform %15
73         %17 = OpVariable %16 Uniform
74         %18 = OpTypeInt 32 1
75         %19 = OpConstant %18 0
76         %20 = OpTypePointer Uniform %7
77         %24 = OpTypeVector %18 2
78         %25 = OpTypePointer Function %24
79         %27 = OpTypeInt 32 0
80         %28 = OpConstant %27 0
81         %29 = OpTypePointer Function %6
82         %32 = OpConstant %6 16
83         %35 = OpConstant %27 1
84         %41 = OpTypePointer Function %18
85         %49 = OpConstant %18 256
86         %50 = OpTypeBool
87         %52 = OpConstant %27 256
88         %53 = OpTypeArray %18 %52
89         %54 = OpTypePointer Private %53
90         %55 = OpVariable %54 Private
91         %57 = OpTypePointer Private %18
92         %60 = OpConstant %18 1
93         %63 = OpConstantComposite %24 %19 %19
94         %64 = OpTypePointer Function %50
95         %66 = OpConstantTrue %50
96         %82 = OpConstant %18 2
97         %86 = OpConstant %18 16
98        %119 = OpConstant %18 14
99        %162 = OpConstantFalse %50
100        %169 = OpConstant %18 8
101        %434 = OpTypePointer Output %10
102        %435 = OpVariable %434 Output
103        %436 = OpConstant %6 1
104        %437 = OpConstantComposite %10 %436 %436 %436 %436
105        %440 = OpConstant %6 0
106        %441 = OpConstantComposite %10 %440 %440 %440 %436
107          %4 = OpFunction %2 None %3
108          %5 = OpLabel
109          %9 = OpVariable %8 Function
110         %26 = OpVariable %25 Function
111         %42 = OpVariable %41 Function
112         %62 = OpVariable %25 Function
113         %65 = OpVariable %64 Function
114         %67 = OpVariable %41 Function
115         %74 = OpVariable %41 Function
116        %171 = OpVariable %41 Function
117        %208 = OpVariable %41 Function
118         %13 = OpLoad %10 %12
119         %14 = OpVectorShuffle %7 %13 %13 0 1
120         %21 = OpAccessChain %20 %17 %19
121         %22 = OpLoad %7 %21
122         %23 = OpFDiv %7 %14 %22
123               OpStore %9 %23
124         %30 = OpAccessChain %29 %9 %28
125         %31 = OpLoad %6 %30
126         %33 = OpFMul %6 %31 %32
127         %34 = OpConvertFToS %18 %33
128         %36 = OpAccessChain %29 %9 %35
129         %37 = OpLoad %6 %36
130         %38 = OpFMul %6 %37 %32
131         %39 = OpConvertFToS %18 %38
132         %40 = OpCompositeConstruct %24 %34 %39
133               OpStore %26 %40
134               OpStore %42 %19
135               OpBranch %43
136         %43 = OpLabel
137               OpLoopMerge %45 %46 None
138               OpBranch %47
139         %47 = OpLabel
140         %48 = OpLoad %18 %42
141         %51 = OpSLessThan %50 %48 %49
142               OpBranchConditional %51 %44 %45
143         %44 = OpLabel
144         %56 = OpLoad %18 %42
145         %58 = OpAccessChain %57 %55 %56
146               OpStore %58 %19
147               OpBranch %46
148         %46 = OpLabel
149         %59 = OpLoad %18 %42
150         %61 = OpIAdd %18 %59 %60
151               OpStore %42 %61
152               OpBranch %43
153         %45 = OpLabel
154               OpStore %62 %63
155               OpStore %65 %66
156               OpStore %67 %19
157               OpBranch %68
158         %68 = OpLabel
159               OpLoopMerge %70 %71 None
160               OpBranch %69
161         %69 = OpLabel
162         %72 = OpLoad %18 %67
163         %73 = OpIAdd %18 %72 %60
164               OpStore %67 %73
165               OpStore %74 %19
166         %75 = OpAccessChain %41 %62 %28
167         %76 = OpLoad %18 %75
168         %77 = OpSGreaterThan %50 %76 %19
169               OpSelectionMerge %79 None
170               OpBranchConditional %77 %78 %79
171         %78 = OpLabel
172         %80 = OpAccessChain %41 %62 %28
173         %81 = OpLoad %18 %80
174         %83 = OpISub %18 %81 %82
175         %84 = OpAccessChain %41 %62 %35
176         %85 = OpLoad %18 %84
177         %87 = OpIMul %18 %85 %86
178         %88 = OpIAdd %18 %83 %87
179         %89 = OpAccessChain %57 %55 %88
180         %90 = OpLoad %18 %89
181         %91 = OpIEqual %50 %90 %19
182               OpBranch %79
183         %79 = OpLabel
184         %92 = OpPhi %50 %77 %69 %91 %78
185               OpSelectionMerge %94 None
186               OpBranchConditional %92 %93 %94
187         %93 = OpLabel
188         %95 = OpLoad %18 %74
189         %96 = OpIAdd %18 %95 %60
190               OpStore %74 %96
191               OpBranch %94
192         %94 = OpLabel
193         %97 = OpAccessChain %41 %62 %35
194         %98 = OpLoad %18 %97
195         %99 = OpSGreaterThan %50 %98 %19
196               OpSelectionMerge %101 None
197               OpBranchConditional %99 %100 %101
198        %100 = OpLabel
199        %102 = OpAccessChain %41 %62 %28
200        %103 = OpLoad %18 %102
201        %104 = OpAccessChain %41 %62 %35
202        %105 = OpLoad %18 %104
203        %106 = OpISub %18 %105 %82
204        %107 = OpIMul %18 %106 %86
205        %108 = OpIAdd %18 %103 %107
206        %109 = OpAccessChain %57 %55 %108
207        %110 = OpLoad %18 %109
208        %111 = OpIEqual %50 %110 %19
209               OpBranch %101
210        %101 = OpLabel
211        %112 = OpPhi %50 %99 %94 %111 %100
212               OpSelectionMerge %114 None
213               OpBranchConditional %112 %113 %114
214        %113 = OpLabel
215        %115 = OpLoad %18 %74
216        %116 = OpIAdd %18 %115 %60
217               OpStore %74 %116
218               OpBranch %114
219        %114 = OpLabel
220        %117 = OpAccessChain %41 %62 %28
221        %118 = OpLoad %18 %117
222        %120 = OpSLessThan %50 %118 %119
223               OpSelectionMerge %122 None
224               OpBranchConditional %120 %121 %122
225        %121 = OpLabel
226        %123 = OpAccessChain %41 %62 %28
227        %124 = OpLoad %18 %123
228        %125 = OpIAdd %18 %124 %82
229        %126 = OpAccessChain %41 %62 %35
230        %127 = OpLoad %18 %126
231        %128 = OpIMul %18 %127 %86
232        %129 = OpIAdd %18 %125 %128
233        %130 = OpAccessChain %57 %55 %129
234        %131 = OpLoad %18 %130
235        %132 = OpIEqual %50 %131 %19
236               OpBranch %122
237        %122 = OpLabel
238        %133 = OpPhi %50 %120 %114 %132 %121
239               OpSelectionMerge %135 None
240               OpBranchConditional %133 %134 %135
241        %134 = OpLabel
242        %136 = OpLoad %18 %74
243        %137 = OpIAdd %18 %136 %60
244               OpStore %74 %137
245               OpBranch %135
246        %135 = OpLabel
247        %138 = OpAccessChain %41 %62 %35
248        %139 = OpLoad %18 %138
249        %140 = OpSLessThan %50 %139 %119
250               OpSelectionMerge %142 None
251               OpBranchConditional %140 %141 %142
252        %141 = OpLabel
253        %143 = OpAccessChain %41 %62 %28
254        %144 = OpLoad %18 %143
255        %145 = OpAccessChain %41 %62 %35
256        %146 = OpLoad %18 %145
257        %147 = OpIAdd %18 %146 %82
258        %148 = OpIMul %18 %147 %86
259        %149 = OpIAdd %18 %144 %148
260        %150 = OpAccessChain %57 %55 %149
261        %151 = OpLoad %18 %150
262        %152 = OpIEqual %50 %151 %19
263               OpBranch %142
264        %142 = OpLabel
265        %153 = OpPhi %50 %140 %135 %152 %141
266               OpSelectionMerge %155 None
267               OpBranchConditional %153 %154 %155
268        %154 = OpLabel
269        %156 = OpLoad %18 %74
270        %157 = OpIAdd %18 %156 %60
271               OpStore %74 %157
272               OpBranch %155
273        %155 = OpLabel
274        %158 = OpLoad %18 %74
275        %159 = OpIEqual %50 %158 %19
276               OpSelectionMerge %161 None
277               OpBranchConditional %159 %160 %207
278        %160 = OpLabel
279               OpStore %65 %162
280               OpStore %42 %19
281               OpBranch %163
282        %163 = OpLabel
283               OpLoopMerge %165 %166 None
284               OpBranch %167
285        %167 = OpLabel
286        %168 = OpLoad %18 %42
287        %170 = OpSLessThan %50 %168 %169
288               OpBranchConditional %170 %164 %165
289        %164 = OpLabel
290               OpStore %171 %19
291               OpBranch %172
292        %172 = OpLabel
293               OpLoopMerge %174 %175 None
294               OpBranch %176
295        %176 = OpLabel
296        %177 = OpLoad %18 %171
297        %178 = OpSLessThan %50 %177 %169
298               OpBranchConditional %178 %173 %174
299        %173 = OpLabel
300        %179 = OpLoad %18 %171
301        %180 = OpIMul %18 %179 %82
302        %181 = OpLoad %18 %42
303        %182 = OpIMul %18 %181 %82
304        %183 = OpIMul %18 %182 %86
305        %184 = OpIAdd %18 %180 %183
306        %185 = OpAccessChain %57 %55 %184
307        %186 = OpLoad %18 %185
308        %187 = OpIEqual %50 %186 %19
309               OpSelectionMerge %189 None
310               OpBranchConditional %187 %188 %189
311        %188 = OpLabel
312        %190 = OpLoad %18 %171
313        %191 = OpIMul %18 %190 %82
314        %192 = OpAccessChain %41 %62 %28
315               OpStore %192 %191
316        %193 = OpLoad %18 %42
317        %194 = OpIMul %18 %193 %82
318        %195 = OpAccessChain %41 %62 %35
319               OpStore %195 %194
320               OpStore %65 %66
321               OpBranch %189
322        %189 = OpLabel
323               OpBranch %175
324        %175 = OpLabel
325        %196 = OpLoad %18 %171
326        %197 = OpIAdd %18 %196 %60
327               OpStore %171 %197
328               OpBranch %172
329        %174 = OpLabel
330               OpBranch %166
331        %166 = OpLabel
332        %198 = OpLoad %18 %42
333        %199 = OpIAdd %18 %198 %60
334               OpStore %42 %199
335               OpBranch %163
336        %165 = OpLabel
337        %200 = OpAccessChain %41 %62 %28
338        %201 = OpLoad %18 %200
339        %202 = OpAccessChain %41 %62 %35
340        %203 = OpLoad %18 %202
341        %204 = OpIMul %18 %203 %86
342        %205 = OpIAdd %18 %201 %204
343        %206 = OpAccessChain %57 %55 %205
344               OpStore %206 %60
345               OpBranch %161
346        %207 = OpLabel
347        %209 = OpLoad %18 %67
348        %210 = OpLoad %18 %74
349        %211 = OpSMod %18 %209 %210
350               OpStore %208 %211
351        %212 = OpLoad %18 %74
352        %213 = OpLoad %18 %67
353        %214 = OpIAdd %18 %213 %212
354               OpStore %67 %214
355        %215 = OpLoad %18 %208
356        %216 = OpSGreaterThanEqual %50 %215 %19
357               OpSelectionMerge %218 None
358               OpBranchConditional %216 %217 %218
359        %217 = OpLabel
360        %219 = OpAccessChain %41 %62 %28
361        %220 = OpLoad %18 %219
362        %221 = OpSGreaterThan %50 %220 %19
363               OpBranch %218
364        %218 = OpLabel
365        %222 = OpPhi %50 %216 %207 %221 %217
366               OpSelectionMerge %224 None
367               OpBranchConditional %222 %223 %224
368        %223 = OpLabel
369        %225 = OpAccessChain %41 %62 %28
370        %226 = OpLoad %18 %225
371        %227 = OpISub %18 %226 %82
372        %228 = OpAccessChain %41 %62 %35
373        %229 = OpLoad %18 %228
374        %230 = OpIMul %18 %229 %86
375        %231 = OpIAdd %18 %227 %230
376        %232 = OpAccessChain %57 %55 %231
377        %233 = OpLoad %18 %232
378        %234 = OpIEqual %50 %233 %19
379               OpBranch %224
380        %224 = OpLabel
381        %235 = OpPhi %50 %222 %218 %234 %223
382               OpSelectionMerge %237 None
383               OpBranchConditional %235 %236 %237
384        %236 = OpLabel
385        %238 = OpLoad %18 %208
386        %239 = OpISub %18 %238 %60
387               OpStore %208 %239
388        %240 = OpAccessChain %41 %62 %28
389        %241 = OpLoad %18 %240
390        %242 = OpAccessChain %41 %62 %35
391        %243 = OpLoad %18 %242
392        %244 = OpIMul %18 %243 %86
393        %245 = OpIAdd %18 %241 %244
394        %246 = OpAccessChain %57 %55 %245
395               OpStore %246 %60
396        %247 = OpAccessChain %41 %62 %28
397        %248 = OpLoad %18 %247
398        %249 = OpISub %18 %248 %60
399        %250 = OpAccessChain %41 %62 %35
400        %251 = OpLoad %18 %250
401        %252 = OpIMul %18 %251 %86
402        %253 = OpIAdd %18 %249 %252
403        %254 = OpAccessChain %57 %55 %253
404               OpStore %254 %60
405        %255 = OpAccessChain %41 %62 %28
406        %256 = OpLoad %18 %255
407        %257 = OpISub %18 %256 %82
408        %258 = OpAccessChain %41 %62 %35
409        %259 = OpLoad %18 %258
410        %260 = OpIMul %18 %259 %86
411        %261 = OpIAdd %18 %257 %260
412        %262 = OpAccessChain %57 %55 %261
413               OpStore %262 %60
414        %263 = OpAccessChain %41 %62 %28
415        %264 = OpLoad %18 %263
416        %265 = OpISub %18 %264 %82
417        %266 = OpAccessChain %41 %62 %28
418               OpStore %266 %265
419               OpBranch %237
420        %237 = OpLabel
421        %267 = OpLoad %18 %208
422        %268 = OpSGreaterThanEqual %50 %267 %19
423               OpSelectionMerge %270 None
424               OpBranchConditional %268 %269 %270
425        %269 = OpLabel
426        %271 = OpAccessChain %41 %62 %35
427        %272 = OpLoad %18 %271
428        %273 = OpSGreaterThan %50 %272 %19
429               OpBranch %270
430        %270 = OpLabel
431        %274 = OpPhi %50 %268 %237 %273 %269
432               OpSelectionMerge %276 None
433               OpBranchConditional %274 %275 %276
434        %275 = OpLabel
435        %277 = OpAccessChain %41 %62 %28
436        %278 = OpLoad %18 %277
437        %279 = OpAccessChain %41 %62 %35
438        %280 = OpLoad %18 %279
439        %281 = OpISub %18 %280 %82
440        %282 = OpIMul %18 %281 %86
441        %283 = OpIAdd %18 %278 %282
442        %284 = OpAccessChain %57 %55 %283
443        %285 = OpLoad %18 %284
444        %286 = OpIEqual %50 %285 %19
445               OpBranch %276
446        %276 = OpLabel
447        %287 = OpPhi %50 %274 %270 %286 %275
448               OpSelectionMerge %289 None
449               OpBranchConditional %287 %288 %289
450        %288 = OpLabel
451        %290 = OpLoad %18 %208
452        %291 = OpISub %18 %290 %60
453               OpStore %208 %291
454        %292 = OpAccessChain %41 %62 %28
455        %293 = OpLoad %18 %292
456        %294 = OpAccessChain %41 %62 %35
457        %295 = OpLoad %18 %294
458        %296 = OpIMul %18 %295 %86
459        %297 = OpIAdd %18 %293 %296
460        %298 = OpAccessChain %57 %55 %297
461               OpStore %298 %60
462        %299 = OpAccessChain %41 %62 %28
463        %300 = OpLoad %18 %299
464        %301 = OpAccessChain %41 %62 %35
465        %302 = OpLoad %18 %301
466        %303 = OpISub %18 %302 %60
467        %304 = OpIMul %18 %303 %86
468        %305 = OpIAdd %18 %300 %304
469        %306 = OpAccessChain %57 %55 %305
470               OpStore %306 %60
471        %307 = OpAccessChain %41 %62 %28
472        %308 = OpLoad %18 %307
473        %309 = OpAccessChain %41 %62 %35
474        %310 = OpLoad %18 %309
475        %311 = OpISub %18 %310 %82
476        %312 = OpIMul %18 %311 %86
477        %313 = OpIAdd %18 %308 %312
478        %314 = OpAccessChain %57 %55 %313
479               OpStore %314 %60
480        %315 = OpAccessChain %41 %62 %35
481        %316 = OpLoad %18 %315
482        %317 = OpISub %18 %316 %82
483        %318 = OpAccessChain %41 %62 %35
484               OpStore %318 %317
485               OpBranch %289
486        %289 = OpLabel
487        %319 = OpLoad %18 %208
488        %320 = OpSGreaterThanEqual %50 %319 %19
489               OpSelectionMerge %322 None
490               OpBranchConditional %320 %321 %322
491        %321 = OpLabel
492        %323 = OpAccessChain %41 %62 %28
493        %324 = OpLoad %18 %323
494        %325 = OpSLessThan %50 %324 %119
495               OpBranch %322
496        %322 = OpLabel
497        %326 = OpPhi %50 %320 %289 %325 %321
498               OpSelectionMerge %328 None
499               OpBranchConditional %326 %327 %328
500        %327 = OpLabel
501        %329 = OpAccessChain %41 %62 %28
502        %330 = OpLoad %18 %329
503        %331 = OpIAdd %18 %330 %82
504        %332 = OpAccessChain %41 %62 %35
505        %333 = OpLoad %18 %332
506        %334 = OpIMul %18 %333 %86
507        %335 = OpIAdd %18 %331 %334
508        %336 = OpAccessChain %57 %55 %335
509        %337 = OpLoad %18 %336
510        %338 = OpIEqual %50 %337 %19
511               OpBranch %328
512        %328 = OpLabel
513        %339 = OpPhi %50 %326 %322 %338 %327
514               OpSelectionMerge %341 None
515               OpBranchConditional %339 %340 %341
516        %340 = OpLabel
517        %342 = OpLoad %18 %208
518        %343 = OpISub %18 %342 %60
519               OpStore %208 %343
520        %344 = OpAccessChain %41 %62 %28
521        %345 = OpLoad %18 %344
522        %346 = OpAccessChain %41 %62 %35
523        %347 = OpLoad %18 %346
524        %348 = OpIMul %18 %347 %86
525        %349 = OpIAdd %18 %345 %348
526        %350 = OpAccessChain %57 %55 %349
527               OpStore %350 %60
528        %351 = OpAccessChain %41 %62 %28
529        %352 = OpLoad %18 %351
530        %353 = OpIAdd %18 %352 %60
531        %354 = OpAccessChain %41 %62 %35
532        %355 = OpLoad %18 %354
533        %356 = OpIMul %18 %355 %86
534        %357 = OpIAdd %18 %353 %356
535        %358 = OpAccessChain %57 %55 %357
536               OpStore %358 %60
537        %359 = OpAccessChain %41 %62 %28
538        %360 = OpLoad %18 %359
539        %361 = OpIAdd %18 %360 %82
540        %362 = OpAccessChain %41 %62 %35
541        %363 = OpLoad %18 %362
542        %364 = OpIMul %18 %363 %86
543        %365 = OpIAdd %18 %361 %364
544        %366 = OpAccessChain %57 %55 %365
545               OpStore %366 %60
546        %367 = OpAccessChain %41 %62 %28
547        %368 = OpLoad %18 %367
548        %369 = OpIAdd %18 %368 %82
549        %370 = OpAccessChain %41 %62 %28
550               OpStore %370 %369
551               OpBranch %341
552        %341 = OpLabel
553        %371 = OpLoad %18 %208
554        %372 = OpSGreaterThanEqual %50 %371 %19
555               OpSelectionMerge %374 None
556               OpBranchConditional %372 %373 %374
557        %373 = OpLabel
558        %375 = OpAccessChain %41 %62 %35
559        %376 = OpLoad %18 %375
560        %377 = OpSLessThan %50 %376 %119
561               OpBranch %374
562        %374 = OpLabel
563        %378 = OpPhi %50 %372 %341 %377 %373
564               OpSelectionMerge %380 None
565               OpBranchConditional %378 %379 %380
566        %379 = OpLabel
567        %381 = OpAccessChain %41 %62 %28
568        %382 = OpLoad %18 %381
569        %383 = OpAccessChain %41 %62 %35
570        %384 = OpLoad %18 %383
571        %385 = OpIAdd %18 %384 %82
572        %386 = OpIMul %18 %385 %86
573        %387 = OpIAdd %18 %382 %386
574        %388 = OpAccessChain %57 %55 %387
575        %389 = OpLoad %18 %388
576        %390 = OpIEqual %50 %389 %19
577               OpBranch %380
578        %380 = OpLabel
579        %391 = OpPhi %50 %378 %374 %390 %379
580               OpSelectionMerge %393 None
581               OpBranchConditional %391 %392 %393
582        %392 = OpLabel
583        %394 = OpLoad %18 %208
584        %395 = OpISub %18 %394 %60
585               OpStore %208 %395
586        %396 = OpAccessChain %41 %62 %28
587        %397 = OpLoad %18 %396
588        %398 = OpAccessChain %41 %62 %35
589        %399 = OpLoad %18 %398
590        %400 = OpIMul %18 %399 %86
591        %401 = OpIAdd %18 %397 %400
592        %402 = OpAccessChain %57 %55 %401
593               OpStore %402 %60
594        %403 = OpAccessChain %41 %62 %28
595        %404 = OpLoad %18 %403
596        %405 = OpAccessChain %41 %62 %35
597        %406 = OpLoad %18 %405
598        %407 = OpIAdd %18 %406 %60
599        %408 = OpIMul %18 %407 %86
600        %409 = OpIAdd %18 %404 %408
601        %410 = OpAccessChain %57 %55 %409
602               OpStore %410 %60
603        %411 = OpAccessChain %41 %62 %28
604        %412 = OpLoad %18 %411
605        %413 = OpAccessChain %41 %62 %35
606        %414 = OpLoad %18 %413
607        %415 = OpIAdd %18 %414 %82
608        %416 = OpIMul %18 %415 %86
609        %417 = OpIAdd %18 %412 %416
610        %418 = OpAccessChain %57 %55 %417
611               OpStore %418 %60
612        %419 = OpAccessChain %41 %62 %35
613        %420 = OpLoad %18 %419
614        %421 = OpIAdd %18 %420 %82
615        %422 = OpAccessChain %41 %62 %35
616               OpStore %422 %421
617               OpBranch %393
618        %393 = OpLabel
619               OpBranch %161
620        %161 = OpLabel
621        %423 = OpAccessChain %41 %26 %35
622        %424 = OpLoad %18 %423
623        %425 = OpIMul %18 %424 %86
624        %426 = OpAccessChain %41 %26 %28
625        %427 = OpLoad %18 %426
626        %428 = OpIAdd %18 %425 %427
627        %429 = OpAccessChain %57 %55 %428
628        %430 = OpLoad %18 %429
629        %431 = OpIEqual %50 %430 %60
630               OpSelectionMerge %433 None
631               OpBranchConditional %431 %432 %433
632        %432 = OpLabel
633               OpStore %435 %437
634               OpReturn
635        %433 = OpLabel
636               OpBranch %71
637         %71 = OpLabel
638        %439 = OpLoad %50 %65
639               OpBranchConditional %439 %68 %70
640         %70 = OpLabel
641               OpStore %435 %441
642               OpReturn
643               OpFunctionEnd
644END
645
646# uniforms for reference
647
648# resolution
649BUFFER reference_resolution DATA_TYPE vec2<float> STD140 DATA
650 32.0 32.0
651END
652
653BUFFER reference_framebuffer FORMAT B8G8R8A8_UNORM
654
655PIPELINE graphics reference_pipeline
656  ATTACH reference_vertex_shader
657  ATTACH reference_fragment_shader
658  FRAMEBUFFER_SIZE 32 32
659  BIND BUFFER reference_framebuffer AS color LOCATION 0
660  BIND BUFFER reference_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
661END
662CLEAR_COLOR reference_pipeline 0 0 0 255
663
664CLEAR reference_pipeline
665RUN reference_pipeline DRAW_RECT POS 0 0 SIZE 32 32
666
667
668SHADER vertex variant_vertex_shader PASSTHROUGH
669
670SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
671; SPIR-V
672; Version: 1.0
673; Generator: Khronos Glslang Reference Front End; 7
674; Bound: 1443
675; Schema: 0
676               OpCapability Shader
677          %1 = OpExtInstImport "GLSL.std.450"
678               OpMemoryModel Logical GLSL450
679               OpEntryPoint Fragment %4 "main" %12 %435
680               OpExecutionMode %4 OriginUpperLeft
681               OpSource ESSL 320
682               OpName %4 "main"
683               OpName %9 "pos"
684               OpName %12 "gl_FragCoord"
685               OpName %15 "buf0"
686               OpMemberName %15 0 "resolution"
687               OpName %17 ""
688               OpName %26 "ipos"
689               OpName %42 "i"
690               OpName %55 "map"
691               OpName %62 "p"
692               OpName %65 "canwalk"
693               OpName %67 "v"
694               OpName %74 "directions"
695               OpName %171 "j"
696               OpName %208 "d"
697               OpName %435 "_GLF_color"
698               OpDecorate %12 BuiltIn FragCoord
699               OpMemberDecorate %15 0 Offset 0
700               OpDecorate %15 Block
701               OpDecorate %17 DescriptorSet 0
702               OpDecorate %17 Binding 0
703               OpDecorate %435 Location 0
704          %2 = OpTypeVoid
705          %3 = OpTypeFunction %2
706          %6 = OpTypeFloat 32
707          %7 = OpTypeVector %6 2
708          %8 = OpTypePointer Function %7
709         %10 = OpTypeVector %6 4
710         %11 = OpTypePointer Input %10
711         %12 = OpVariable %11 Input
712         %15 = OpTypeStruct %7
713         %16 = OpTypePointer Uniform %15
714         %17 = OpVariable %16 Uniform
715         %18 = OpTypeInt 32 1
716         %19 = OpConstant %18 0
717         %20 = OpTypePointer Uniform %7
718         %24 = OpTypeVector %18 2
719         %25 = OpTypePointer Function %24
720         %27 = OpTypeInt 32 0
721         %28 = OpConstant %27 0
722         %29 = OpTypePointer Function %6
723         %32 = OpConstant %6 16
724         %35 = OpConstant %27 1
725         %41 = OpTypePointer Function %18
726         %49 = OpConstant %18 256
727         %50 = OpTypeBool
728         %52 = OpConstant %27 256
729         %53 = OpTypeArray %18 %52
730         %54 = OpTypePointer Private %53
731         %55 = OpVariable %54 Private
732         %57 = OpTypePointer Private %18
733         %60 = OpConstant %18 1
734         %63 = OpConstantComposite %24 %19 %19
735         %64 = OpTypePointer Function %50
736         %66 = OpConstantTrue %50
737         %82 = OpConstant %18 2
738         %86 = OpConstant %18 16
739        %119 = OpConstant %18 14
740        %162 = OpConstantFalse %50
741        %169 = OpConstant %18 8
742        %434 = OpTypePointer Output %10
743        %435 = OpVariable %434 Output
744        %436 = OpConstant %6 1
745        %437 = OpConstantComposite %10 %436 %436 %436 %436
746        %440 = OpConstant %6 0
747        %441 = OpConstantComposite %10 %440 %440 %440 %436
748        %542 = OpConstant %18 0
749        %566 = OpConstantComposite %53 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542
750          %4 = OpFunction %2 None %3
751          %5 = OpLabel
752          %9 = OpVariable %8 Function
753         %26 = OpVariable %25 Function
754         %42 = OpVariable %41 Function
755         %62 = OpVariable %25 Function
756         %65 = OpVariable %64 Function
757         %67 = OpVariable %41 Function
758         %74 = OpVariable %41 Function
759        %171 = OpVariable %41 Function
760        %208 = OpVariable %41 Function
761         %13 = OpLoad %10 %12
762         %14 = OpVectorShuffle %7 %13 %13 0 1
763         %21 = OpAccessChain %20 %17 %19
764         %22 = OpLoad %7 %21
765         %23 = OpFDiv %7 %14 %22
766               OpStore %9 %23
767         %30 = OpAccessChain %29 %9 %28
768         %31 = OpLoad %6 %30
769         %33 = OpFMul %6 %31 %32
770         %34 = OpConvertFToS %18 %33
771         %36 = OpAccessChain %29 %9 %35
772         %37 = OpLoad %6 %36
773         %38 = OpFMul %6 %37 %32
774         %39 = OpConvertFToS %18 %38
775         %40 = OpCompositeConstruct %24 %34 %39
776               OpStore %26 %40
777               OpStore %42 %19
778               OpBranch %43
779         %43 = OpLabel
780               OpLoopMerge %45 %46 None
781               OpBranch %47
782         %47 = OpLabel
783         %48 = OpLoad %18 %42
784         %51 = OpSLessThan %50 %48 %49
785               OpBranchConditional %51 %44 %45
786         %44 = OpLabel
787         %56 = OpLoad %18 %42
788         %58 = OpAccessChain %57 %55 %56
789               OpStore %58 %19
790               OpBranch %46
791         %46 = OpLabel
792         %59 = OpLoad %18 %42
793         %61 = OpIAdd %18 %59 %60
794               OpStore %42 %61
795               OpBranch %43
796         %45 = OpLabel
797               OpStore %62 %63
798               OpStore %65 %66
799               OpStore %67 %19
800               OpBranch %68
801         %68 = OpLabel
802               OpLoopMerge %70 %71 None
803               OpBranch %69
804         %69 = OpLabel
805         %72 = OpLoad %18 %67
806         %73 = OpIAdd %18 %72 %60
807               OpStore %67 %73
808               OpStore %74 %19
809         %75 = OpAccessChain %41 %62 %28
810         %76 = OpLoad %18 %75
811         %77 = OpSGreaterThan %50 %76 %19
812               OpSelectionMerge %79 None
813               OpBranchConditional %77 %78 %79
814         %78 = OpLabel
815         %80 = OpAccessChain %41 %62 %28
816         %81 = OpLoad %18 %80
817         %83 = OpISub %18 %81 %82
818         %84 = OpAccessChain %41 %62 %35
819         %85 = OpLoad %18 %84
820         %87 = OpIMul %18 %85 %86
821         %88 = OpIAdd %18 %83 %87
822         %89 = OpAccessChain %57 %55 %88
823         %90 = OpLoad %18 %89
824         %91 = OpIEqual %50 %90 %19
825               OpBranch %79
826         %79 = OpLabel
827         %92 = OpPhi %50 %77 %69 %91 %78
828               OpSelectionMerge %94 None
829               OpBranchConditional %92 %93 %94
830         %93 = OpLabel
831         %95 = OpLoad %18 %74
832         %96 = OpIAdd %18 %95 %60
833               OpStore %74 %96
834               OpBranch %94
835         %94 = OpLabel
836         %97 = OpAccessChain %41 %62 %35
837         %98 = OpLoad %18 %97
838         %99 = OpSGreaterThan %50 %98 %19
839               OpSelectionMerge %101 None
840               OpBranchConditional %99 %100 %101
841        %100 = OpLabel
842        %102 = OpAccessChain %41 %62 %28
843        %103 = OpLoad %18 %102
844        %104 = OpAccessChain %41 %62 %35
845        %105 = OpLoad %18 %104
846        %106 = OpISub %18 %105 %82
847        %107 = OpIMul %18 %106 %86
848        %108 = OpIAdd %18 %103 %107
849        %109 = OpAccessChain %57 %55 %108
850        %110 = OpLoad %18 %109
851        %111 = OpIEqual %50 %110 %19
852               OpBranch %101
853        %101 = OpLabel
854        %112 = OpPhi %50 %99 %94 %111 %100
855               OpSelectionMerge %114 None
856               OpBranchConditional %112 %113 %114
857        %113 = OpLabel
858        %115 = OpLoad %18 %74
859        %116 = OpIAdd %18 %115 %60
860               OpStore %74 %116
861               OpBranch %114
862        %114 = OpLabel
863        %117 = OpAccessChain %41 %62 %28
864        %118 = OpLoad %18 %117
865        %120 = OpSLessThan %50 %118 %119
866               OpSelectionMerge %122 None
867               OpBranchConditional %120 %121 %122
868        %121 = OpLabel
869        %123 = OpAccessChain %41 %62 %28
870        %124 = OpLoad %18 %123
871        %125 = OpIAdd %18 %124 %82
872        %126 = OpAccessChain %41 %62 %35
873        %127 = OpLoad %18 %126
874        %128 = OpIMul %18 %127 %86
875        %129 = OpIAdd %18 %125 %128
876        %130 = OpAccessChain %57 %55 %129
877        %131 = OpLoad %18 %130
878        %132 = OpIEqual %50 %131 %19
879               OpBranch %122
880        %122 = OpLabel
881        %133 = OpPhi %50 %120 %114 %132 %121
882               OpSelectionMerge %135 None
883               OpBranchConditional %133 %134 %135
884        %134 = OpLabel
885        %136 = OpLoad %18 %74
886        %137 = OpIAdd %18 %136 %60
887               OpStore %74 %137
888               OpBranch %135
889        %135 = OpLabel
890        %138 = OpAccessChain %41 %62 %35
891        %139 = OpLoad %18 %138
892        %140 = OpSLessThan %50 %139 %119
893               OpSelectionMerge %142 None
894               OpBranchConditional %140 %141 %142
895        %141 = OpLabel
896        %143 = OpAccessChain %41 %62 %28
897        %144 = OpLoad %18 %143
898        %145 = OpAccessChain %41 %62 %35
899        %146 = OpLoad %18 %145
900        %147 = OpIAdd %18 %146 %82
901        %148 = OpIMul %18 %147 %86
902        %149 = OpIAdd %18 %144 %148
903        %150 = OpAccessChain %57 %55 %149
904        %151 = OpLoad %18 %150
905        %152 = OpIEqual %50 %151 %19
906               OpBranch %142
907        %142 = OpLabel
908        %153 = OpPhi %50 %140 %135 %152 %141
909               OpSelectionMerge %155 None
910               OpBranchConditional %153 %154 %155
911        %154 = OpLabel
912        %156 = OpLoad %18 %74
913        %157 = OpIAdd %18 %156 %60
914               OpStore %74 %157
915               OpBranch %155
916        %155 = OpLabel
917        %158 = OpLoad %18 %74
918        %159 = OpIEqual %50 %158 %19
919               OpSelectionMerge %161 None
920               OpBranchConditional %159 %160 %207
921        %160 = OpLabel
922               OpStore %65 %162
923               OpStore %42 %19
924               OpBranch %163
925        %163 = OpLabel
926               OpLoopMerge %165 %166 None
927               OpBranch %167
928        %167 = OpLabel
929        %168 = OpLoad %18 %42
930        %170 = OpSLessThan %50 %168 %169
931               OpBranchConditional %170 %164 %165
932        %164 = OpLabel
933               OpStore %171 %19
934               OpBranch %172
935        %172 = OpLabel
936               OpLoopMerge %174 %175 None
937               OpBranch %176
938        %176 = OpLabel
939        %177 = OpLoad %18 %171
940        %178 = OpSLessThan %50 %177 %169
941               OpBranchConditional %178 %173 %174
942        %173 = OpLabel
943        %179 = OpLoad %18 %171
944        %180 = OpIMul %18 %179 %82
945        %181 = OpLoad %18 %42
946        %182 = OpIMul %18 %181 %82
947        %183 = OpIMul %18 %182 %86
948        %184 = OpIAdd %18 %180 %183
949        %185 = OpAccessChain %57 %55 %184
950        %186 = OpLoad %18 %185
951        %187 = OpIEqual %50 %186 %19
952               OpSelectionMerge %189 None
953               OpBranchConditional %187 %188 %189
954        %188 = OpLabel
955        %190 = OpLoad %18 %171
956        %191 = OpIMul %18 %190 %82
957        %192 = OpAccessChain %41 %62 %28
958               OpStore %192 %191
959        %193 = OpLoad %18 %42
960        %194 = OpIMul %18 %193 %82
961        %195 = OpAccessChain %41 %62 %35
962               OpStore %195 %194
963               OpStore %65 %66
964               OpBranch %189
965        %189 = OpLabel
966               OpBranch %175
967        %175 = OpLabel
968        %196 = OpLoad %18 %171
969        %197 = OpIAdd %18 %196 %60
970               OpStore %171 %197
971               OpBranch %172
972        %174 = OpLabel
973               OpBranch %166
974        %166 = OpLabel
975        %198 = OpLoad %18 %42
976        %199 = OpIAdd %18 %198 %60
977               OpStore %42 %199
978               OpBranch %163
979        %165 = OpLabel
980        %200 = OpAccessChain %41 %62 %28
981        %201 = OpLoad %18 %200
982        %202 = OpAccessChain %41 %62 %35
983        %203 = OpLoad %18 %202
984        %204 = OpIMul %18 %203 %86
985        %205 = OpIAdd %18 %201 %204
986        %206 = OpAccessChain %57 %55 %205
987               OpStore %206 %60
988               OpBranch %161
989        %207 = OpLabel
990        %209 = OpLoad %18 %67
991        %210 = OpLoad %18 %74
992        %211 = OpSMod %18 %209 %210
993               OpStore %208 %211
994        %212 = OpLoad %18 %74
995        %213 = OpLoad %18 %67
996        %214 = OpIAdd %18 %213 %212
997               OpStore %67 %214
998        %215 = OpLoad %18 %208
999        %216 = OpSGreaterThanEqual %50 %215 %19
1000               OpSelectionMerge %218 None
1001               OpBranchConditional %216 %217 %218
1002        %217 = OpLabel
1003        %219 = OpAccessChain %41 %62 %28
1004        %220 = OpLoad %18 %219
1005        %221 = OpSGreaterThan %50 %220 %19
1006               OpBranch %218
1007        %218 = OpLabel
1008        %222 = OpPhi %50 %216 %207 %221 %217
1009               OpSelectionMerge %224 None
1010               OpBranchConditional %222 %223 %224
1011        %223 = OpLabel
1012        %225 = OpAccessChain %41 %62 %28
1013        %226 = OpLoad %18 %225
1014        %227 = OpISub %18 %226 %82
1015        %228 = OpAccessChain %41 %62 %35
1016        %229 = OpLoad %18 %228
1017        %230 = OpIMul %18 %229 %86
1018        %231 = OpIAdd %18 %227 %230
1019        %232 = OpAccessChain %57 %55 %231
1020        %233 = OpLoad %18 %232
1021        %234 = OpIEqual %50 %233 %19
1022               OpBranch %224
1023        %224 = OpLabel
1024        %235 = OpPhi %50 %222 %218 %234 %223
1025               OpSelectionMerge %237 None
1026               OpBranchConditional %235 %236 %237
1027        %236 = OpLabel
1028        %238 = OpLoad %18 %208
1029        %239 = OpISub %18 %238 %60
1030               OpStore %208 %239
1031        %240 = OpAccessChain %41 %62 %28
1032        %241 = OpLoad %18 %240
1033        %242 = OpAccessChain %41 %62 %35
1034        %243 = OpLoad %18 %242
1035        %244 = OpIMul %18 %243 %86
1036        %245 = OpIAdd %18 %241 %244
1037        %246 = OpAccessChain %57 %55 %245
1038               OpStore %246 %60
1039        %247 = OpAccessChain %41 %62 %28
1040        %248 = OpLoad %18 %247
1041        %249 = OpISub %18 %248 %60
1042        %250 = OpAccessChain %41 %62 %35
1043        %251 = OpLoad %18 %250
1044        %252 = OpIMul %18 %251 %86
1045        %253 = OpIAdd %18 %249 %252
1046        %254 = OpAccessChain %57 %55 %253
1047               OpStore %254 %60
1048        %255 = OpAccessChain %41 %62 %28
1049        %256 = OpLoad %18 %255
1050        %257 = OpISub %18 %256 %82
1051        %258 = OpAccessChain %41 %62 %35
1052        %259 = OpLoad %18 %258
1053        %260 = OpIMul %18 %259 %86
1054        %261 = OpIAdd %18 %257 %260
1055        %262 = OpAccessChain %57 %55 %261
1056               OpStore %262 %60
1057        %263 = OpAccessChain %41 %62 %28
1058        %264 = OpLoad %18 %263
1059        %265 = OpISub %18 %264 %82
1060        %266 = OpAccessChain %41 %62 %28
1061               OpStore %266 %265
1062               OpBranch %237
1063        %237 = OpLabel
1064        %267 = OpLoad %18 %208
1065        %268 = OpSGreaterThanEqual %50 %267 %19
1066               OpSelectionMerge %270 None
1067               OpBranchConditional %268 %269 %270
1068        %269 = OpLabel
1069        %271 = OpAccessChain %41 %62 %35
1070        %272 = OpLoad %18 %271
1071        %273 = OpSGreaterThan %50 %272 %19
1072               OpBranch %270
1073        %270 = OpLabel
1074        %274 = OpPhi %50 %268 %237 %273 %269
1075               OpBranch %275
1076        %275 = OpLabel
1077        %277 = OpAccessChain %41 %62 %28
1078               OpSelectionMerge %1419 None
1079               OpBranchConditional %274 %1420 %1422
1080       %1420 = OpLabel
1081       %1421 = OpLoad %18 %277
1082               OpBranch %1419
1083       %1422 = OpLabel
1084       %1423 = OpCopyObject %18 %542
1085               OpBranch %1419
1086       %1419 = OpLabel
1087        %278 = OpPhi %18 %1421 %1420 %1423 %1422
1088        %279 = OpAccessChain %41 %62 %35
1089               OpSelectionMerge %1424 None
1090               OpBranchConditional %274 %1425 %1427
1091       %1425 = OpLabel
1092       %1426 = OpLoad %18 %279
1093               OpBranch %1424
1094       %1427 = OpLabel
1095       %1428 = OpCopyObject %18 %542
1096               OpBranch %1424
1097       %1424 = OpLabel
1098        %280 = OpPhi %18 %1426 %1425 %1428 %1427
1099        %281 = OpISub %18 %280 %82
1100        %282 = OpIMul %18 %281 %86
1101               OpSelectionMerge %1434 None
1102               OpBranchConditional %274 %1435 %1437
1103       %1435 = OpLabel
1104       %1436 = OpLoad %53 %55
1105               OpBranch %1434
1106       %1437 = OpLabel
1107       %1438 = OpCopyObject %53 %566
1108               OpBranch %1434
1109       %1434 = OpLabel
1110        %773 = OpPhi %53 %1436 %1435 %1438 %1437
1111               OpSelectionMerge %1439 None
1112               OpBranchConditional %274 %1440 %1439
1113       %1440 = OpLabel
1114               OpStore %55 %566
1115               OpBranch %1439
1116       %1439 = OpLabel
1117               OpSelectionMerge %1441 None
1118               OpBranchConditional %274 %1442 %1441
1119       %1442 = OpLabel
1120               OpStore %55 %773
1121               OpBranch %1441
1122       %1441 = OpLabel
1123        %283 = OpIAdd %18 %278 %282
1124        %284 = OpAccessChain %57 %55 %283
1125               OpSelectionMerge %1429 None
1126               OpBranchConditional %274 %1430 %1432
1127       %1430 = OpLabel
1128       %1431 = OpLoad %18 %284
1129               OpBranch %1429
1130       %1432 = OpLabel
1131       %1433 = OpCopyObject %18 %542
1132               OpBranch %1429
1133       %1429 = OpLabel
1134        %285 = OpPhi %18 %1431 %1430 %1433 %1432
1135        %286 = OpIEqual %50 %285 %19
1136               OpBranch %276
1137        %276 = OpLabel
1138        %287 = OpSelect %50 %274 %286 %274
1139               OpSelectionMerge %289 None
1140               OpBranchConditional %287 %288 %289
1141        %288 = OpLabel
1142        %290 = OpLoad %18 %208
1143        %291 = OpISub %18 %290 %60
1144               OpStore %208 %291
1145        %292 = OpAccessChain %41 %62 %28
1146        %293 = OpLoad %18 %292
1147        %294 = OpAccessChain %41 %62 %35
1148        %295 = OpLoad %18 %294
1149        %296 = OpIMul %18 %295 %86
1150        %297 = OpIAdd %18 %293 %296
1151        %298 = OpAccessChain %57 %55 %297
1152               OpStore %298 %60
1153        %299 = OpAccessChain %41 %62 %28
1154        %300 = OpLoad %18 %299
1155        %301 = OpAccessChain %41 %62 %35
1156        %302 = OpLoad %18 %301
1157        %303 = OpISub %18 %302 %60
1158        %304 = OpIMul %18 %303 %86
1159        %305 = OpIAdd %18 %300 %304
1160        %306 = OpAccessChain %57 %55 %305
1161               OpStore %306 %60
1162        %307 = OpAccessChain %41 %62 %28
1163        %308 = OpLoad %18 %307
1164        %309 = OpAccessChain %41 %62 %35
1165        %310 = OpLoad %18 %309
1166        %311 = OpISub %18 %310 %82
1167        %800 = OpLoad %53 %55
1168               OpStore %55 %566
1169               OpStore %55 %800
1170        %312 = OpIMul %18 %311 %86
1171        %313 = OpIAdd %18 %308 %312
1172        %314 = OpAccessChain %57 %55 %313
1173               OpStore %314 %60
1174        %315 = OpAccessChain %41 %62 %35
1175        %316 = OpLoad %18 %315
1176        %317 = OpISub %18 %316 %82
1177        %318 = OpAccessChain %41 %62 %35
1178               OpStore %318 %317
1179               OpBranch %289
1180        %289 = OpLabel
1181        %319 = OpLoad %18 %208
1182        %320 = OpSGreaterThanEqual %50 %319 %19
1183               OpSelectionMerge %322 None
1184               OpBranchConditional %320 %321 %322
1185        %321 = OpLabel
1186        %323 = OpAccessChain %41 %62 %28
1187        %324 = OpLoad %18 %323
1188        %325 = OpSLessThan %50 %324 %119
1189               OpBranch %322
1190        %322 = OpLabel
1191        %326 = OpPhi %50 %320 %289 %325 %321
1192               OpSelectionMerge %328 None
1193               OpBranchConditional %326 %327 %328
1194        %327 = OpLabel
1195        %329 = OpAccessChain %41 %62 %28
1196        %330 = OpLoad %18 %329
1197        %331 = OpIAdd %18 %330 %82
1198        %332 = OpAccessChain %41 %62 %35
1199        %333 = OpLoad %18 %332
1200        %334 = OpIMul %18 %333 %86
1201        %335 = OpIAdd %18 %331 %334
1202        %336 = OpAccessChain %57 %55 %335
1203        %337 = OpLoad %18 %336
1204        %338 = OpIEqual %50 %337 %19
1205               OpBranch %328
1206        %328 = OpLabel
1207        %339 = OpPhi %50 %326 %322 %338 %327
1208               OpSelectionMerge %341 None
1209               OpBranchConditional %339 %340 %341
1210        %340 = OpLabel
1211        %342 = OpLoad %18 %208
1212        %343 = OpISub %18 %342 %60
1213               OpStore %208 %343
1214        %344 = OpAccessChain %41 %62 %28
1215        %345 = OpLoad %18 %344
1216        %346 = OpAccessChain %41 %62 %35
1217        %347 = OpLoad %18 %346
1218        %348 = OpIMul %18 %347 %86
1219        %349 = OpIAdd %18 %345 %348
1220        %350 = OpAccessChain %57 %55 %349
1221               OpStore %350 %60
1222        %351 = OpAccessChain %41 %62 %28
1223        %352 = OpLoad %18 %351
1224        %353 = OpIAdd %18 %352 %60
1225        %354 = OpAccessChain %41 %62 %35
1226        %355 = OpLoad %18 %354
1227        %356 = OpIMul %18 %355 %86
1228        %357 = OpIAdd %18 %353 %356
1229        %358 = OpAccessChain %57 %55 %357
1230               OpStore %358 %60
1231        %359 = OpAccessChain %41 %62 %28
1232        %360 = OpLoad %18 %359
1233        %361 = OpIAdd %18 %360 %82
1234        %362 = OpAccessChain %41 %62 %35
1235        %363 = OpLoad %18 %362
1236        %364 = OpIMul %18 %363 %86
1237        %365 = OpIAdd %18 %361 %364
1238        %366 = OpAccessChain %57 %55 %365
1239               OpStore %366 %60
1240        %367 = OpAccessChain %41 %62 %28
1241        %368 = OpLoad %18 %367
1242        %369 = OpIAdd %18 %368 %82
1243        %370 = OpAccessChain %41 %62 %28
1244               OpStore %370 %369
1245               OpBranch %341
1246        %341 = OpLabel
1247        %371 = OpLoad %18 %208
1248        %372 = OpSGreaterThanEqual %50 %371 %19
1249               OpSelectionMerge %374 None
1250               OpBranchConditional %372 %373 %374
1251        %373 = OpLabel
1252        %375 = OpAccessChain %41 %62 %35
1253        %376 = OpLoad %18 %375
1254        %377 = OpSLessThan %50 %376 %119
1255               OpBranch %374
1256        %374 = OpLabel
1257        %378 = OpPhi %50 %372 %341 %377 %373
1258               OpSelectionMerge %380 None
1259               OpBranchConditional %378 %379 %380
1260        %379 = OpLabel
1261        %381 = OpAccessChain %41 %62 %28
1262        %382 = OpLoad %18 %381
1263        %383 = OpAccessChain %41 %62 %35
1264        %384 = OpLoad %18 %383
1265        %385 = OpIAdd %18 %384 %82
1266        %386 = OpIMul %18 %385 %86
1267        %387 = OpIAdd %18 %382 %386
1268        %388 = OpAccessChain %57 %55 %387
1269        %389 = OpLoad %18 %388
1270        %390 = OpIEqual %50 %389 %19
1271               OpBranch %380
1272        %380 = OpLabel
1273        %391 = OpPhi %50 %378 %374 %390 %379
1274               OpSelectionMerge %393 None
1275               OpBranchConditional %391 %392 %393
1276        %392 = OpLabel
1277        %394 = OpLoad %18 %208
1278        %395 = OpISub %18 %394 %60
1279               OpStore %208 %395
1280        %396 = OpAccessChain %41 %62 %28
1281        %397 = OpLoad %18 %396
1282        %398 = OpAccessChain %41 %62 %35
1283        %399 = OpLoad %18 %398
1284        %400 = OpIMul %18 %399 %86
1285        %401 = OpIAdd %18 %397 %400
1286        %402 = OpAccessChain %57 %55 %401
1287               OpStore %402 %60
1288        %403 = OpAccessChain %41 %62 %28
1289        %404 = OpLoad %18 %403
1290        %405 = OpAccessChain %41 %62 %35
1291        %406 = OpLoad %18 %405
1292        %407 = OpIAdd %18 %406 %60
1293        %408 = OpIMul %18 %407 %86
1294        %409 = OpIAdd %18 %404 %408
1295        %410 = OpAccessChain %57 %55 %409
1296               OpStore %410 %60
1297        %411 = OpAccessChain %41 %62 %28
1298        %412 = OpLoad %18 %411
1299        %413 = OpAccessChain %41 %62 %35
1300        %414 = OpLoad %18 %413
1301        %415 = OpIAdd %18 %414 %82
1302        %416 = OpIMul %18 %415 %86
1303        %417 = OpIAdd %18 %412 %416
1304        %418 = OpAccessChain %57 %55 %417
1305               OpStore %418 %60
1306        %419 = OpAccessChain %41 %62 %35
1307        %420 = OpLoad %18 %419
1308        %421 = OpIAdd %18 %420 %82
1309        %422 = OpAccessChain %41 %62 %35
1310               OpStore %422 %421
1311               OpBranch %393
1312        %393 = OpLabel
1313               OpBranch %161
1314        %161 = OpLabel
1315        %423 = OpAccessChain %41 %26 %35
1316        %424 = OpLoad %18 %423
1317        %425 = OpIMul %18 %424 %86
1318        %426 = OpAccessChain %41 %26 %28
1319        %427 = OpLoad %18 %426
1320        %428 = OpIAdd %18 %425 %427
1321        %429 = OpAccessChain %57 %55 %428
1322        %430 = OpLoad %18 %429
1323        %431 = OpIEqual %50 %430 %60
1324               OpSelectionMerge %433 None
1325               OpBranchConditional %431 %432 %433
1326        %432 = OpLabel
1327               OpStore %435 %437
1328               OpReturn
1329        %433 = OpLabel
1330               OpBranch %71
1331         %71 = OpLabel
1332        %439 = OpLoad %50 %65
1333               OpBranchConditional %439 %68 %70
1334         %70 = OpLabel
1335               OpStore %435 %441
1336               OpReturn
1337               OpFunctionEnd
1338END
1339
1340# uniforms for variant
1341
1342# resolution
1343BUFFER variant_resolution DATA_TYPE vec2<float> STD140 DATA
1344 32.0 32.0
1345END
1346
1347BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
1348
1349PIPELINE graphics variant_pipeline
1350  ATTACH variant_vertex_shader
1351  ATTACH variant_fragment_shader
1352  FRAMEBUFFER_SIZE 32 32
1353  BIND BUFFER variant_framebuffer AS color LOCATION 0
1354  BIND BUFFER variant_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
1355END
1356CLEAR_COLOR variant_pipeline 0 0 0 255
1357
1358CLEAR variant_pipeline
1359RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
1360
1361
1362SHADER vertex variant_2_vertex_shader PASSTHROUGH
1363
1364SHADER fragment variant_2_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
1365; SPIR-V
1366; Version: 1.0
1367; Generator: Khronos Glslang Reference Front End; 7
1368; Bound: 801
1369; Schema: 0
1370               OpCapability Shader
1371          %1 = OpExtInstImport "GLSL.std.450"
1372               OpMemoryModel Logical GLSL450
1373               OpEntryPoint Fragment %4 "main" %12 %435
1374               OpExecutionMode %4 OriginUpperLeft
1375               OpSource ESSL 320
1376               OpName %4 "main"
1377               OpName %9 "pos"
1378               OpName %12 "gl_FragCoord"
1379               OpName %15 "buf0"
1380               OpMemberName %15 0 "resolution"
1381               OpName %17 ""
1382               OpName %26 "ipos"
1383               OpName %42 "i"
1384               OpName %55 "map"
1385               OpName %62 "p"
1386               OpName %65 "canwalk"
1387               OpName %67 "v"
1388               OpName %74 "directions"
1389               OpName %171 "j"
1390               OpName %208 "d"
1391               OpName %435 "_GLF_color"
1392               OpDecorate %12 BuiltIn FragCoord
1393               OpMemberDecorate %15 0 Offset 0
1394               OpDecorate %15 Block
1395               OpDecorate %17 DescriptorSet 0
1396               OpDecorate %17 Binding 0
1397               OpDecorate %435 Location 0
1398          %2 = OpTypeVoid
1399          %3 = OpTypeFunction %2
1400          %6 = OpTypeFloat 32
1401          %7 = OpTypeVector %6 2
1402          %8 = OpTypePointer Function %7
1403         %10 = OpTypeVector %6 4
1404         %11 = OpTypePointer Input %10
1405         %12 = OpVariable %11 Input
1406         %15 = OpTypeStruct %7
1407         %16 = OpTypePointer Uniform %15
1408         %17 = OpVariable %16 Uniform
1409         %18 = OpTypeInt 32 1
1410         %19 = OpConstant %18 0
1411         %20 = OpTypePointer Uniform %7
1412         %24 = OpTypeVector %18 2
1413         %25 = OpTypePointer Function %24
1414         %27 = OpTypeInt 32 0
1415         %28 = OpConstant %27 0
1416         %29 = OpTypePointer Function %6
1417         %32 = OpConstant %6 16
1418         %35 = OpConstant %27 1
1419         %41 = OpTypePointer Function %18
1420         %49 = OpConstant %18 256
1421         %50 = OpTypeBool
1422         %52 = OpConstant %27 256
1423         %53 = OpTypeArray %18 %52
1424         %54 = OpTypePointer Private %53
1425         %55 = OpVariable %54 Private
1426         %57 = OpTypePointer Private %18
1427         %60 = OpConstant %18 1
1428         %63 = OpConstantComposite %24 %19 %19
1429         %64 = OpTypePointer Function %50
1430         %66 = OpConstantTrue %50
1431         %82 = OpConstant %18 2
1432         %86 = OpConstant %18 16
1433        %119 = OpConstant %18 14
1434        %162 = OpConstantFalse %50
1435        %169 = OpConstant %18 8
1436        %434 = OpTypePointer Output %10
1437        %435 = OpVariable %434 Output
1438        %436 = OpConstant %6 1
1439        %437 = OpConstantComposite %10 %436 %436 %436 %436
1440        %440 = OpConstant %6 0
1441        %441 = OpConstantComposite %10 %440 %440 %440 %436
1442        %542 = OpConstant %18 0
1443        %566 = OpConstantComposite %53 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542 %542
1444          %4 = OpFunction %2 None %3
1445          %5 = OpLabel
1446          %9 = OpVariable %8 Function
1447         %26 = OpVariable %25 Function
1448         %42 = OpVariable %41 Function
1449         %62 = OpVariable %25 Function
1450         %65 = OpVariable %64 Function
1451         %67 = OpVariable %41 Function
1452         %74 = OpVariable %41 Function
1453        %171 = OpVariable %41 Function
1454        %208 = OpVariable %41 Function
1455         %13 = OpLoad %10 %12
1456         %14 = OpVectorShuffle %7 %13 %13 0 1
1457         %21 = OpAccessChain %20 %17 %19
1458         %22 = OpLoad %7 %21
1459         %23 = OpFDiv %7 %14 %22
1460               OpStore %9 %23
1461         %30 = OpAccessChain %29 %9 %28
1462         %31 = OpLoad %6 %30
1463         %33 = OpFMul %6 %31 %32
1464         %34 = OpConvertFToS %18 %33
1465         %36 = OpAccessChain %29 %9 %35
1466         %37 = OpLoad %6 %36
1467         %38 = OpFMul %6 %37 %32
1468         %39 = OpConvertFToS %18 %38
1469         %40 = OpCompositeConstruct %24 %34 %39
1470               OpStore %26 %40
1471               OpStore %42 %19
1472               OpBranch %43
1473         %43 = OpLabel
1474               OpLoopMerge %45 %46 None
1475               OpBranch %47
1476         %47 = OpLabel
1477         %48 = OpLoad %18 %42
1478         %51 = OpSLessThan %50 %48 %49
1479               OpBranchConditional %51 %44 %45
1480         %44 = OpLabel
1481         %56 = OpLoad %18 %42
1482         %58 = OpAccessChain %57 %55 %56
1483               OpStore %58 %19
1484               OpBranch %46
1485         %46 = OpLabel
1486         %59 = OpLoad %18 %42
1487         %61 = OpIAdd %18 %59 %60
1488               OpStore %42 %61
1489               OpBranch %43
1490         %45 = OpLabel
1491               OpStore %62 %63
1492               OpStore %65 %66
1493               OpStore %67 %19
1494               OpBranch %68
1495         %68 = OpLabel
1496               OpLoopMerge %70 %71 None
1497               OpBranch %69
1498         %69 = OpLabel
1499         %72 = OpLoad %18 %67
1500         %73 = OpIAdd %18 %72 %60
1501               OpStore %67 %73
1502               OpStore %74 %19
1503         %75 = OpAccessChain %41 %62 %28
1504         %76 = OpLoad %18 %75
1505         %77 = OpSGreaterThan %50 %76 %19
1506               OpSelectionMerge %79 None
1507               OpBranchConditional %77 %78 %79
1508         %78 = OpLabel
1509         %80 = OpAccessChain %41 %62 %28
1510         %81 = OpLoad %18 %80
1511         %83 = OpISub %18 %81 %82
1512         %84 = OpAccessChain %41 %62 %35
1513         %85 = OpLoad %18 %84
1514         %87 = OpIMul %18 %85 %86
1515         %88 = OpIAdd %18 %83 %87
1516         %89 = OpAccessChain %57 %55 %88
1517         %90 = OpLoad %18 %89
1518         %91 = OpIEqual %50 %90 %19
1519               OpBranch %79
1520         %79 = OpLabel
1521         %92 = OpPhi %50 %77 %69 %91 %78
1522               OpSelectionMerge %94 None
1523               OpBranchConditional %92 %93 %94
1524         %93 = OpLabel
1525         %95 = OpLoad %18 %74
1526         %96 = OpIAdd %18 %95 %60
1527               OpStore %74 %96
1528               OpBranch %94
1529         %94 = OpLabel
1530         %97 = OpAccessChain %41 %62 %35
1531         %98 = OpLoad %18 %97
1532         %99 = OpSGreaterThan %50 %98 %19
1533               OpSelectionMerge %101 None
1534               OpBranchConditional %99 %100 %101
1535        %100 = OpLabel
1536        %102 = OpAccessChain %41 %62 %28
1537        %103 = OpLoad %18 %102
1538        %104 = OpAccessChain %41 %62 %35
1539        %105 = OpLoad %18 %104
1540        %106 = OpISub %18 %105 %82
1541        %107 = OpIMul %18 %106 %86
1542        %108 = OpIAdd %18 %103 %107
1543        %109 = OpAccessChain %57 %55 %108
1544        %110 = OpLoad %18 %109
1545        %111 = OpIEqual %50 %110 %19
1546               OpBranch %101
1547        %101 = OpLabel
1548        %112 = OpPhi %50 %99 %94 %111 %100
1549               OpSelectionMerge %114 None
1550               OpBranchConditional %112 %113 %114
1551        %113 = OpLabel
1552        %115 = OpLoad %18 %74
1553        %116 = OpIAdd %18 %115 %60
1554               OpStore %74 %116
1555               OpBranch %114
1556        %114 = OpLabel
1557        %117 = OpAccessChain %41 %62 %28
1558        %118 = OpLoad %18 %117
1559        %120 = OpSLessThan %50 %118 %119
1560               OpSelectionMerge %122 None
1561               OpBranchConditional %120 %121 %122
1562        %121 = OpLabel
1563        %123 = OpAccessChain %41 %62 %28
1564        %124 = OpLoad %18 %123
1565        %125 = OpIAdd %18 %124 %82
1566        %126 = OpAccessChain %41 %62 %35
1567        %127 = OpLoad %18 %126
1568        %128 = OpIMul %18 %127 %86
1569        %129 = OpIAdd %18 %125 %128
1570        %130 = OpAccessChain %57 %55 %129
1571        %131 = OpLoad %18 %130
1572        %132 = OpIEqual %50 %131 %19
1573               OpBranch %122
1574        %122 = OpLabel
1575        %133 = OpPhi %50 %120 %114 %132 %121
1576               OpSelectionMerge %135 None
1577               OpBranchConditional %133 %134 %135
1578        %134 = OpLabel
1579        %136 = OpLoad %18 %74
1580        %137 = OpIAdd %18 %136 %60
1581               OpStore %74 %137
1582               OpBranch %135
1583        %135 = OpLabel
1584        %138 = OpAccessChain %41 %62 %35
1585        %139 = OpLoad %18 %138
1586        %140 = OpSLessThan %50 %139 %119
1587               OpSelectionMerge %142 None
1588               OpBranchConditional %140 %141 %142
1589        %141 = OpLabel
1590        %143 = OpAccessChain %41 %62 %28
1591        %144 = OpLoad %18 %143
1592        %145 = OpAccessChain %41 %62 %35
1593        %146 = OpLoad %18 %145
1594        %147 = OpIAdd %18 %146 %82
1595        %148 = OpIMul %18 %147 %86
1596        %149 = OpIAdd %18 %144 %148
1597        %150 = OpAccessChain %57 %55 %149
1598        %151 = OpLoad %18 %150
1599        %152 = OpIEqual %50 %151 %19
1600               OpBranch %142
1601        %142 = OpLabel
1602        %153 = OpPhi %50 %140 %135 %152 %141
1603               OpSelectionMerge %155 None
1604               OpBranchConditional %153 %154 %155
1605        %154 = OpLabel
1606        %156 = OpLoad %18 %74
1607        %157 = OpIAdd %18 %156 %60
1608               OpStore %74 %157
1609               OpBranch %155
1610        %155 = OpLabel
1611        %158 = OpLoad %18 %74
1612        %159 = OpIEqual %50 %158 %19
1613               OpSelectionMerge %161 None
1614               OpBranchConditional %159 %160 %207
1615        %160 = OpLabel
1616               OpStore %65 %162
1617               OpStore %42 %19
1618               OpBranch %163
1619        %163 = OpLabel
1620               OpLoopMerge %165 %166 None
1621               OpBranch %167
1622        %167 = OpLabel
1623        %168 = OpLoad %18 %42
1624        %170 = OpSLessThan %50 %168 %169
1625               OpBranchConditional %170 %164 %165
1626        %164 = OpLabel
1627               OpStore %171 %19
1628               OpBranch %172
1629        %172 = OpLabel
1630               OpLoopMerge %174 %175 None
1631               OpBranch %176
1632        %176 = OpLabel
1633        %177 = OpLoad %18 %171
1634        %178 = OpSLessThan %50 %177 %169
1635               OpBranchConditional %178 %173 %174
1636        %173 = OpLabel
1637        %179 = OpLoad %18 %171
1638        %180 = OpIMul %18 %179 %82
1639        %181 = OpLoad %18 %42
1640        %182 = OpIMul %18 %181 %82
1641        %183 = OpIMul %18 %182 %86
1642        %184 = OpIAdd %18 %180 %183
1643        %185 = OpAccessChain %57 %55 %184
1644        %186 = OpLoad %18 %185
1645        %187 = OpIEqual %50 %186 %19
1646               OpSelectionMerge %189 None
1647               OpBranchConditional %187 %188 %189
1648        %188 = OpLabel
1649        %190 = OpLoad %18 %171
1650        %191 = OpIMul %18 %190 %82
1651        %192 = OpAccessChain %41 %62 %28
1652               OpStore %192 %191
1653        %193 = OpLoad %18 %42
1654        %194 = OpIMul %18 %193 %82
1655        %195 = OpAccessChain %41 %62 %35
1656               OpStore %195 %194
1657               OpStore %65 %66
1658               OpBranch %189
1659        %189 = OpLabel
1660               OpBranch %175
1661        %175 = OpLabel
1662        %196 = OpLoad %18 %171
1663        %197 = OpIAdd %18 %196 %60
1664               OpStore %171 %197
1665               OpBranch %172
1666        %174 = OpLabel
1667               OpBranch %166
1668        %166 = OpLabel
1669        %198 = OpLoad %18 %42
1670        %199 = OpIAdd %18 %198 %60
1671               OpStore %42 %199
1672               OpBranch %163
1673        %165 = OpLabel
1674        %200 = OpAccessChain %41 %62 %28
1675        %201 = OpLoad %18 %200
1676        %202 = OpAccessChain %41 %62 %35
1677        %203 = OpLoad %18 %202
1678        %204 = OpIMul %18 %203 %86
1679        %205 = OpIAdd %18 %201 %204
1680        %206 = OpAccessChain %57 %55 %205
1681               OpStore %206 %60
1682               OpBranch %161
1683        %207 = OpLabel
1684        %209 = OpLoad %18 %67
1685        %210 = OpLoad %18 %74
1686        %211 = OpSMod %18 %209 %210
1687               OpStore %208 %211
1688        %212 = OpLoad %18 %74
1689        %213 = OpLoad %18 %67
1690        %214 = OpIAdd %18 %213 %212
1691               OpStore %67 %214
1692        %215 = OpLoad %18 %208
1693        %216 = OpSGreaterThanEqual %50 %215 %19
1694               OpSelectionMerge %218 None
1695               OpBranchConditional %216 %217 %218
1696        %217 = OpLabel
1697        %219 = OpAccessChain %41 %62 %28
1698        %220 = OpLoad %18 %219
1699        %221 = OpSGreaterThan %50 %220 %19
1700               OpBranch %218
1701        %218 = OpLabel
1702        %222 = OpPhi %50 %216 %207 %221 %217
1703               OpSelectionMerge %224 None
1704               OpBranchConditional %222 %223 %224
1705        %223 = OpLabel
1706        %225 = OpAccessChain %41 %62 %28
1707        %226 = OpLoad %18 %225
1708        %227 = OpISub %18 %226 %82
1709        %228 = OpAccessChain %41 %62 %35
1710        %229 = OpLoad %18 %228
1711        %230 = OpIMul %18 %229 %86
1712        %231 = OpIAdd %18 %227 %230
1713        %232 = OpAccessChain %57 %55 %231
1714        %233 = OpLoad %18 %232
1715        %234 = OpIEqual %50 %233 %19
1716               OpBranch %224
1717        %224 = OpLabel
1718        %235 = OpPhi %50 %222 %218 %234 %223
1719               OpSelectionMerge %237 None
1720               OpBranchConditional %235 %236 %237
1721        %236 = OpLabel
1722        %238 = OpLoad %18 %208
1723        %239 = OpISub %18 %238 %60
1724               OpStore %208 %239
1725        %240 = OpAccessChain %41 %62 %28
1726        %241 = OpLoad %18 %240
1727        %242 = OpAccessChain %41 %62 %35
1728        %243 = OpLoad %18 %242
1729        %244 = OpIMul %18 %243 %86
1730        %245 = OpIAdd %18 %241 %244
1731        %246 = OpAccessChain %57 %55 %245
1732               OpStore %246 %60
1733        %247 = OpAccessChain %41 %62 %28
1734        %248 = OpLoad %18 %247
1735        %249 = OpISub %18 %248 %60
1736        %250 = OpAccessChain %41 %62 %35
1737        %251 = OpLoad %18 %250
1738        %252 = OpIMul %18 %251 %86
1739        %253 = OpIAdd %18 %249 %252
1740        %254 = OpAccessChain %57 %55 %253
1741               OpStore %254 %60
1742        %255 = OpAccessChain %41 %62 %28
1743        %256 = OpLoad %18 %255
1744        %257 = OpISub %18 %256 %82
1745        %258 = OpAccessChain %41 %62 %35
1746        %259 = OpLoad %18 %258
1747        %260 = OpIMul %18 %259 %86
1748        %261 = OpIAdd %18 %257 %260
1749        %262 = OpAccessChain %57 %55 %261
1750               OpStore %262 %60
1751        %263 = OpAccessChain %41 %62 %28
1752        %264 = OpLoad %18 %263
1753        %265 = OpISub %18 %264 %82
1754        %266 = OpAccessChain %41 %62 %28
1755               OpStore %266 %265
1756               OpBranch %237
1757        %237 = OpLabel
1758        %267 = OpLoad %18 %208
1759        %268 = OpSGreaterThanEqual %50 %267 %19
1760               OpSelectionMerge %270 None
1761               OpBranchConditional %268 %269 %270
1762        %269 = OpLabel
1763        %271 = OpAccessChain %41 %62 %35
1764        %272 = OpLoad %18 %271
1765        %273 = OpSGreaterThan %50 %272 %19
1766               OpBranch %270
1767        %270 = OpLabel
1768        %274 = OpPhi %50 %268 %237 %273 %269
1769               OpSelectionMerge %276 None
1770               OpBranchConditional %274 %275 %276
1771        %275 = OpLabel
1772        %277 = OpAccessChain %41 %62 %28
1773        %278 = OpLoad %18 %277
1774        %279 = OpAccessChain %41 %62 %35
1775        %280 = OpLoad %18 %279
1776        %281 = OpISub %18 %280 %82
1777        %282 = OpIMul %18 %281 %86
1778        %773 = OpLoad %53 %55
1779               OpStore %55 %566
1780               OpStore %55 %773
1781        %283 = OpIAdd %18 %278 %282
1782        %284 = OpAccessChain %57 %55 %283
1783        %285 = OpLoad %18 %284
1784        %286 = OpIEqual %50 %285 %19
1785               OpBranch %276
1786        %276 = OpLabel
1787        %287 = OpPhi %50 %274 %270 %286 %275
1788               OpSelectionMerge %289 None
1789               OpBranchConditional %287 %288 %289
1790        %288 = OpLabel
1791        %290 = OpLoad %18 %208
1792        %291 = OpISub %18 %290 %60
1793               OpStore %208 %291
1794        %292 = OpAccessChain %41 %62 %28
1795        %293 = OpLoad %18 %292
1796        %294 = OpAccessChain %41 %62 %35
1797        %295 = OpLoad %18 %294
1798        %296 = OpIMul %18 %295 %86
1799        %297 = OpIAdd %18 %293 %296
1800        %298 = OpAccessChain %57 %55 %297
1801               OpStore %298 %60
1802        %299 = OpAccessChain %41 %62 %28
1803        %300 = OpLoad %18 %299
1804        %301 = OpAccessChain %41 %62 %35
1805        %302 = OpLoad %18 %301
1806        %303 = OpISub %18 %302 %60
1807        %304 = OpIMul %18 %303 %86
1808        %305 = OpIAdd %18 %300 %304
1809        %306 = OpAccessChain %57 %55 %305
1810               OpStore %306 %60
1811        %307 = OpAccessChain %41 %62 %28
1812        %308 = OpLoad %18 %307
1813        %309 = OpAccessChain %41 %62 %35
1814        %310 = OpLoad %18 %309
1815        %311 = OpISub %18 %310 %82
1816        %800 = OpLoad %53 %55
1817               OpStore %55 %566
1818               OpStore %55 %800
1819        %312 = OpIMul %18 %311 %86
1820        %313 = OpIAdd %18 %308 %312
1821        %314 = OpAccessChain %57 %55 %313
1822               OpStore %314 %60
1823        %315 = OpAccessChain %41 %62 %35
1824        %316 = OpLoad %18 %315
1825        %317 = OpISub %18 %316 %82
1826        %318 = OpAccessChain %41 %62 %35
1827               OpStore %318 %317
1828               OpBranch %289
1829        %289 = OpLabel
1830        %319 = OpLoad %18 %208
1831        %320 = OpSGreaterThanEqual %50 %319 %19
1832               OpSelectionMerge %322 None
1833               OpBranchConditional %320 %321 %322
1834        %321 = OpLabel
1835        %323 = OpAccessChain %41 %62 %28
1836        %324 = OpLoad %18 %323
1837        %325 = OpSLessThan %50 %324 %119
1838               OpBranch %322
1839        %322 = OpLabel
1840        %326 = OpPhi %50 %320 %289 %325 %321
1841               OpSelectionMerge %328 None
1842               OpBranchConditional %326 %327 %328
1843        %327 = OpLabel
1844        %329 = OpAccessChain %41 %62 %28
1845        %330 = OpLoad %18 %329
1846        %331 = OpIAdd %18 %330 %82
1847        %332 = OpAccessChain %41 %62 %35
1848        %333 = OpLoad %18 %332
1849        %334 = OpIMul %18 %333 %86
1850        %335 = OpIAdd %18 %331 %334
1851        %336 = OpAccessChain %57 %55 %335
1852        %337 = OpLoad %18 %336
1853        %338 = OpIEqual %50 %337 %19
1854               OpBranch %328
1855        %328 = OpLabel
1856        %339 = OpPhi %50 %326 %322 %338 %327
1857               OpSelectionMerge %341 None
1858               OpBranchConditional %339 %340 %341
1859        %340 = OpLabel
1860        %342 = OpLoad %18 %208
1861        %343 = OpISub %18 %342 %60
1862               OpStore %208 %343
1863        %344 = OpAccessChain %41 %62 %28
1864        %345 = OpLoad %18 %344
1865        %346 = OpAccessChain %41 %62 %35
1866        %347 = OpLoad %18 %346
1867        %348 = OpIMul %18 %347 %86
1868        %349 = OpIAdd %18 %345 %348
1869        %350 = OpAccessChain %57 %55 %349
1870               OpStore %350 %60
1871        %351 = OpAccessChain %41 %62 %28
1872        %352 = OpLoad %18 %351
1873        %353 = OpIAdd %18 %352 %60
1874        %354 = OpAccessChain %41 %62 %35
1875        %355 = OpLoad %18 %354
1876        %356 = OpIMul %18 %355 %86
1877        %357 = OpIAdd %18 %353 %356
1878        %358 = OpAccessChain %57 %55 %357
1879               OpStore %358 %60
1880        %359 = OpAccessChain %41 %62 %28
1881        %360 = OpLoad %18 %359
1882        %361 = OpIAdd %18 %360 %82
1883        %362 = OpAccessChain %41 %62 %35
1884        %363 = OpLoad %18 %362
1885        %364 = OpIMul %18 %363 %86
1886        %365 = OpIAdd %18 %361 %364
1887        %366 = OpAccessChain %57 %55 %365
1888               OpStore %366 %60
1889        %367 = OpAccessChain %41 %62 %28
1890        %368 = OpLoad %18 %367
1891        %369 = OpIAdd %18 %368 %82
1892        %370 = OpAccessChain %41 %62 %28
1893               OpStore %370 %369
1894               OpBranch %341
1895        %341 = OpLabel
1896        %371 = OpLoad %18 %208
1897        %372 = OpSGreaterThanEqual %50 %371 %19
1898               OpSelectionMerge %374 None
1899               OpBranchConditional %372 %373 %374
1900        %373 = OpLabel
1901        %375 = OpAccessChain %41 %62 %35
1902        %376 = OpLoad %18 %375
1903        %377 = OpSLessThan %50 %376 %119
1904               OpBranch %374
1905        %374 = OpLabel
1906        %378 = OpPhi %50 %372 %341 %377 %373
1907               OpSelectionMerge %380 None
1908               OpBranchConditional %378 %379 %380
1909        %379 = OpLabel
1910        %381 = OpAccessChain %41 %62 %28
1911        %382 = OpLoad %18 %381
1912        %383 = OpAccessChain %41 %62 %35
1913        %384 = OpLoad %18 %383
1914        %385 = OpIAdd %18 %384 %82
1915        %386 = OpIMul %18 %385 %86
1916        %387 = OpIAdd %18 %382 %386
1917        %388 = OpAccessChain %57 %55 %387
1918        %389 = OpLoad %18 %388
1919        %390 = OpIEqual %50 %389 %19
1920               OpBranch %380
1921        %380 = OpLabel
1922        %391 = OpPhi %50 %378 %374 %390 %379
1923               OpSelectionMerge %393 None
1924               OpBranchConditional %391 %392 %393
1925        %392 = OpLabel
1926        %394 = OpLoad %18 %208
1927        %395 = OpISub %18 %394 %60
1928               OpStore %208 %395
1929        %396 = OpAccessChain %41 %62 %28
1930        %397 = OpLoad %18 %396
1931        %398 = OpAccessChain %41 %62 %35
1932        %399 = OpLoad %18 %398
1933        %400 = OpIMul %18 %399 %86
1934        %401 = OpIAdd %18 %397 %400
1935        %402 = OpAccessChain %57 %55 %401
1936               OpStore %402 %60
1937        %403 = OpAccessChain %41 %62 %28
1938        %404 = OpLoad %18 %403
1939        %405 = OpAccessChain %41 %62 %35
1940        %406 = OpLoad %18 %405
1941        %407 = OpIAdd %18 %406 %60
1942        %408 = OpIMul %18 %407 %86
1943        %409 = OpIAdd %18 %404 %408
1944        %410 = OpAccessChain %57 %55 %409
1945               OpStore %410 %60
1946        %411 = OpAccessChain %41 %62 %28
1947        %412 = OpLoad %18 %411
1948        %413 = OpAccessChain %41 %62 %35
1949        %414 = OpLoad %18 %413
1950        %415 = OpIAdd %18 %414 %82
1951        %416 = OpIMul %18 %415 %86
1952        %417 = OpIAdd %18 %412 %416
1953        %418 = OpAccessChain %57 %55 %417
1954               OpStore %418 %60
1955        %419 = OpAccessChain %41 %62 %35
1956        %420 = OpLoad %18 %419
1957        %421 = OpIAdd %18 %420 %82
1958        %422 = OpAccessChain %41 %62 %35
1959               OpStore %422 %421
1960               OpBranch %393
1961        %393 = OpLabel
1962               OpBranch %161
1963        %161 = OpLabel
1964        %423 = OpAccessChain %41 %26 %35
1965        %424 = OpLoad %18 %423
1966        %425 = OpIMul %18 %424 %86
1967        %426 = OpAccessChain %41 %26 %28
1968        %427 = OpLoad %18 %426
1969        %428 = OpIAdd %18 %425 %427
1970        %429 = OpAccessChain %57 %55 %428
1971        %430 = OpLoad %18 %429
1972        %431 = OpIEqual %50 %430 %60
1973               OpSelectionMerge %433 None
1974               OpBranchConditional %431 %432 %433
1975        %432 = OpLabel
1976               OpStore %435 %437
1977               OpReturn
1978        %433 = OpLabel
1979               OpBranch %71
1980         %71 = OpLabel
1981        %439 = OpLoad %50 %65
1982               OpBranchConditional %439 %68 %70
1983         %70 = OpLabel
1984               OpStore %435 %441
1985               OpReturn
1986               OpFunctionEnd
1987END
1988
1989# uniforms for variant_2
1990
1991# resolution
1992BUFFER variant_2_resolution DATA_TYPE vec2<float> STD140 DATA
1993 32.0 32.0
1994END
1995
1996BUFFER variant_2_framebuffer FORMAT B8G8R8A8_UNORM
1997
1998PIPELINE graphics variant_2_pipeline
1999  ATTACH variant_2_vertex_shader
2000  ATTACH variant_2_fragment_shader
2001  FRAMEBUFFER_SIZE 32 32
2002  BIND BUFFER variant_2_framebuffer AS color LOCATION 0
2003  BIND BUFFER variant_2_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
2004END
2005CLEAR_COLOR variant_2_pipeline 0 0 0 255
2006
2007CLEAR variant_2_pipeline
2008RUN variant_2_pipeline DRAW_RECT POS 0 0 SIZE 32 32
2009
2010EXPECT reference_framebuffer EQ_HISTOGRAM_EMD_BUFFER variant_framebuffer TOLERANCE 0.005
2011EXPECT reference_framebuffer EQ_HISTOGRAM_EMD_BUFFER variant_2_framebuffer TOLERANCE 0.005
2012