3 # Copyright 2020 Google LLC
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # A test for a bug found by the GraphicsFuzz project.
20 # Short description: Three shaders diff: new variable used and mutated
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
27 SHADER vertex reference_vertex_shader PASSTHROUGH
29 SHADER fragment reference_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
32 ; Generator: Khronos Glslang Reference Front End; 7
36 %1 = OpExtInstImport "GLSL.std.450"
37 OpMemoryModel Logical GLSL450
38 OpEntryPoint Fragment %4 "main" %165 %180
39 OpExecutionMode %4 OriginUpperLeft
42 OpName %165 "gl_FragCoord"
44 OpMemberName %168 0 "resolution"
46 OpName %180 "_GLF_color"
47 OpDecorate %165 BuiltIn FragCoord
48 OpMemberDecorate %168 0 Offset 0
50 OpDecorate %170 DescriptorSet 0
51 OpDecorate %170 Binding 0
52 OpDecorate %180 Location 0
54 %3 = OpTypeFunction %2
56 %7 = OpTypeVector %6 2
57 %9 = OpTypeVector %6 4
58 %10 = OpTypePointer Function %9
61 %22 = OpConstant %21 0
62 %23 = OpTypePointer Function %6
63 %31 = OpConstantFalse %11
64 %33 = OpConstant %21 1
65 %66 = OpConstantTrue %11
66 %70 = OpConstant %6 0.5
68 %72 = OpConstantComposite %9 %70 %70 %71 %71
70 %76 = OpConstant %73 0
71 %83 = OpConstant %73 8
72 %85 = OpConstant %21 8
73 %86 = OpTypeArray %9 %85
75 %88 = OpConstant %6 20
76 %89 = OpConstantComposite %9 %87 %87 %88 %87
77 %90 = OpConstantComposite %9 %87 %87 %87 %88
78 %91 = OpConstantComposite %9 %87 %88 %88 %87
80 %93 = OpConstantComposite %9 %88 %87 %87 %92
83 %96 = OpConstantComposite %9 %92 %94 %87 %95
84 %97 = OpConstant %6 12
85 %98 = OpConstantComposite %9 %95 %97 %95 %87
86 %99 = OpConstant %6 16
87 %100 = OpConstantComposite %9 %99 %95 %87 %87
88 %101 = OpConstant %6 22
89 %102 = OpConstantComposite %9 %97 %101 %87 %87
90 %103 = OpConstantComposite %86 %89 %90 %91 %93 %96 %98 %100 %102
91 %108 = OpTypePointer Function %86
92 %115 = OpConstant %21 16
93 %116 = OpTypeArray %9 %115
94 %117 = OpConstant %6 0
95 %118 = OpConstantComposite %9 %117 %117 %117 %71
96 %119 = OpConstantComposite %9 %70 %117 %117 %71
97 %120 = OpConstantComposite %9 %117 %70 %117 %71
98 %121 = OpConstantComposite %9 %70 %70 %117 %71
99 %122 = OpConstantComposite %9 %117 %117 %70 %71
100 %123 = OpConstantComposite %9 %70 %117 %70 %71
101 %124 = OpConstantComposite %9 %117 %70 %70 %71
102 %125 = OpConstantComposite %9 %70 %70 %70 %71
103 %126 = OpConstantComposite %9 %71 %117 %117 %71
104 %127 = OpConstantComposite %9 %117 %71 %117 %71
105 %128 = OpConstantComposite %9 %71 %71 %117 %71
106 %129 = OpConstantComposite %9 %117 %117 %71 %71
107 %130 = OpConstantComposite %9 %71 %117 %71 %71
108 %131 = OpConstantComposite %9 %117 %71 %71 %71
109 %132 = OpConstantComposite %9 %71 %71 %71 %71
110 %133 = OpConstantComposite %116 %118 %119 %120 %121 %122 %123 %124 %125 %118 %126 %127 %128 %129 %130 %131 %132
111 %146 = OpConstant %73 9
112 %149 = OpConstant %73 11
113 %151 = OpConstant %73 16
114 %153 = OpTypePointer Function %116
115 %158 = OpConstant %73 1
116 %164 = OpTypePointer Input %9
117 %165 = OpVariable %164 Input
118 %168 = OpTypeStruct %7
119 %169 = OpTypePointer Uniform %168
120 %170 = OpVariable %169 Uniform
121 %171 = OpTypePointer Uniform %7
122 %176 = OpConstant %6 32
123 %179 = OpTypePointer Output %9
124 %180 = OpVariable %179 Output
125 %4 = OpFunction %2 None %3
127 %199 = OpVariable %108 Function
128 %200 = OpVariable %108 Function
129 %201 = OpVariable %108 Function
130 %202 = OpVariable %153 Function
131 %166 = OpLoad %9 %165
132 %167 = OpVectorShuffle %7 %166 %166 0 1
133 %172 = OpAccessChain %171 %170 %76
134 %173 = OpLoad %7 %172
135 %174 = OpFDiv %7 %167 %173
136 %177 = OpVectorTimesScalar %7 %174 %176
137 %178 = OpExtInst %7 %1 Floor %177
140 %280 = OpPhi %9 %72 %5 %285 %233
141 %279 = OpPhi %73 %76 %5 %235 %233
142 %208 = OpSLessThan %11 %279 %83
143 OpLoopMerge %236 %233 None
144 OpBranchConditional %208 %209 %236
147 %212 = OpAccessChain %10 %199 %279
148 %213 = OpLoad %9 %212
149 OpSelectionMerge %277 None
152 %244 = OpCompositeExtract %6 %178 0
153 %246 = OpCompositeExtract %6 %213 0
154 %247 = OpFOrdLessThan %11 %244 %246
155 OpSelectionMerge %249 None
156 OpBranchConditional %247 %248 %249
160 %251 = OpCompositeExtract %6 %178 1
161 %253 = OpCompositeExtract %6 %213 1
162 %254 = OpFOrdLessThan %11 %251 %253
163 OpSelectionMerge %256 None
164 OpBranchConditional %254 %255 %256
168 %262 = OpCompositeExtract %6 %213 2
169 %263 = OpFAdd %6 %246 %262
170 %264 = OpFOrdGreaterThan %11 %244 %263
171 OpSelectionMerge %266 None
172 OpBranchConditional %264 %265 %266
176 %272 = OpCompositeExtract %6 %213 3
177 %273 = OpFAdd %6 %253 %272
178 %274 = OpFOrdGreaterThan %11 %251 %273
179 OpSelectionMerge %276 None
180 OpBranchConditional %274 %275 %276
186 %282 = OpPhi %11 %31 %248 %31 %255 %31 %265 %31 %275 %66 %276
187 OpSelectionMerge %232 None
188 OpBranchConditional %282 %215 %232
191 %217 = OpAccessChain %23 %200 %279 %22
192 %218 = OpLoad %6 %217
193 %219 = OpConvertFToS %73 %218
195 %221 = OpAccessChain %23 %201 %279 %33
196 %222 = OpLoad %6 %221
197 %223 = OpConvertFToS %73 %222
198 %224 = OpIMul %73 %219 %223
199 %226 = OpIMul %73 %279 %146
200 %227 = OpIAdd %73 %224 %226
201 %228 = OpIAdd %73 %227 %149
202 %229 = OpSMod %73 %228 %151
204 %230 = OpAccessChain %10 %202 %229
205 %231 = OpLoad %9 %230
208 %285 = OpPhi %9 %280 %277 %231 %215
211 %235 = OpIAdd %73 %279 %158
219 # uniforms for reference
222 BUFFER reference_resolution DATA_TYPE vec2<float> STD140 DATA
226 BUFFER reference_framebuffer FORMAT B8G8R8A8_UNORM
228 PIPELINE graphics reference_pipeline
229 ATTACH reference_vertex_shader
230 ATTACH reference_fragment_shader
231 FRAMEBUFFER_SIZE 256 256
232 BIND BUFFER reference_framebuffer AS color LOCATION 0
233 BIND BUFFER reference_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
235 CLEAR_COLOR reference_pipeline 0 0 0 255
237 CLEAR reference_pipeline
238 RUN reference_pipeline DRAW_RECT POS 0 0 SIZE 256 256
241 SHADER vertex variant_vertex_shader PASSTHROUGH
243 SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
246 ; Generator: Khronos Glslang Reference Front End; 7
250 %1 = OpExtInstImport "GLSL.std.450"
251 OpMemoryModel Logical GLSL450
252 OpEntryPoint Fragment %4 "main" %165 %180
253 OpExecutionMode %4 OriginUpperLeft
256 OpName %165 "gl_FragCoord"
258 OpMemberName %168 0 "resolution"
260 OpName %180 "_GLF_color"
261 OpDecorate %165 BuiltIn FragCoord
262 OpMemberDecorate %168 0 Offset 0
263 OpDecorate %168 Block
264 OpDecorate %170 DescriptorSet 0
265 OpDecorate %170 Binding 0
266 OpDecorate %180 Location 0
268 %3 = OpTypeFunction %2
270 %7 = OpTypeVector %6 2
271 %9 = OpTypeVector %6 4
272 %10 = OpTypePointer Function %9
275 %22 = OpConstant %21 0
276 %23 = OpTypePointer Function %6
277 %31 = OpConstantFalse %11
278 %33 = OpConstant %21 1
279 %66 = OpConstantTrue %11
280 %70 = OpConstant %6 0.5
281 %71 = OpConstant %6 1
282 %72 = OpConstantComposite %9 %70 %70 %71 %71
284 %76 = OpConstant %73 0
285 %83 = OpConstant %73 8
286 %85 = OpConstant %21 8
287 %86 = OpTypeArray %9 %85
288 %87 = OpConstant %6 4
289 %88 = OpConstant %6 20
290 %89 = OpConstantComposite %9 %87 %87 %88 %87
291 %90 = OpConstantComposite %9 %87 %87 %87 %88
292 %91 = OpConstantComposite %9 %87 %88 %88 %87
293 %92 = OpConstant %6 8
294 %93 = OpConstantComposite %9 %88 %87 %87 %92
295 %94 = OpConstant %6 6
296 %95 = OpConstant %6 2
297 %96 = OpConstantComposite %9 %92 %94 %87 %95
298 %97 = OpConstant %6 12
299 %98 = OpConstantComposite %9 %95 %97 %95 %87
300 %99 = OpConstant %6 16
301 %100 = OpConstantComposite %9 %99 %95 %87 %87
302 %101 = OpConstant %6 22
303 %102 = OpConstantComposite %9 %97 %101 %87 %87
304 %103 = OpConstantComposite %86 %89 %90 %91 %93 %96 %98 %100 %102
305 %108 = OpTypePointer Function %86
306 %115 = OpConstant %21 16
307 %116 = OpTypeArray %9 %115
308 %117 = OpConstant %6 0
309 %118 = OpConstantComposite %9 %117 %117 %117 %71
310 %119 = OpConstantComposite %9 %70 %117 %117 %71
311 %120 = OpConstantComposite %9 %117 %70 %117 %71
312 %121 = OpConstantComposite %9 %70 %70 %117 %71
313 %122 = OpConstantComposite %9 %117 %117 %70 %71
314 %123 = OpConstantComposite %9 %70 %117 %70 %71
315 %124 = OpConstantComposite %9 %117 %70 %70 %71
316 %125 = OpConstantComposite %9 %70 %70 %70 %71
317 %126 = OpConstantComposite %9 %71 %117 %117 %71
318 %127 = OpConstantComposite %9 %117 %71 %117 %71
319 %128 = OpConstantComposite %9 %71 %71 %117 %71
320 %129 = OpConstantComposite %9 %117 %117 %71 %71
321 %130 = OpConstantComposite %9 %71 %117 %71 %71
322 %131 = OpConstantComposite %9 %117 %71 %71 %71
323 %132 = OpConstantComposite %9 %71 %71 %71 %71
324 %133 = OpConstantComposite %116 %118 %119 %120 %121 %122 %123 %124 %125 %118 %126 %127 %128 %129 %130 %131 %132
325 %146 = OpConstant %73 9
326 %149 = OpConstant %73 11
327 %151 = OpConstant %73 16
328 %153 = OpTypePointer Function %116
329 %158 = OpConstant %73 1
330 %164 = OpTypePointer Input %9
331 %165 = OpVariable %164 Input
332 %168 = OpTypeStruct %7
333 %169 = OpTypePointer Uniform %168
334 %170 = OpVariable %169 Uniform
335 %171 = OpTypePointer Uniform %7
336 %176 = OpConstant %6 32
337 %179 = OpTypePointer Output %9
338 %180 = OpVariable %179 Output
339 %386 = OpConstantComposite %9 %117 %117 %117 %117
340 %387 = OpConstantComposite %86 %386 %386 %386 %386 %386 %386 %386 %386
341 %498 = OpConstant %6 0
342 %499 = OpConstantComposite %9 %498 %498 %498 %498
343 %503 = OpConstantComposite %86 %499 %499 %499 %499 %499 %499 %499 %499
344 %4 = OpFunction %2 None %3
346 %389 = OpVariable %108 Function %387
347 %199 = OpVariable %108 Function
348 %200 = OpVariable %108 Function
349 %201 = OpVariable %108 Function
350 %202 = OpVariable %153 Function
352 %388 = OpLoad %86 %389
353 %166 = OpLoad %9 %165
354 %167 = OpVectorShuffle %7 %166 %166 0 1
355 %172 = OpAccessChain %171 %170 %76
356 %173 = OpLoad %7 %172
357 %174 = OpFDiv %7 %167 %173
358 %177 = OpVectorTimesScalar %7 %174 %176
359 %178 = OpExtInst %7 %1 Floor %177
362 %280 = OpPhi %9 %72 %5 %285 %233
363 %279 = OpPhi %73 %76 %5 %235 %233
364 %208 = OpSLessThan %11 %279 %83
365 OpLoopMerge %236 %233 None
366 OpBranchConditional %208 %209 %236
369 %212 = OpAccessChain %10 %199 %279
370 %213 = OpLoad %9 %212
371 OpSelectionMerge %277 None
374 %244 = OpCompositeExtract %6 %178 0
375 %246 = OpCompositeExtract %6 %213 0
376 %247 = OpFOrdLessThan %11 %244 %246
377 OpSelectionMerge %249 None
378 OpBranchConditional %247 %248 %249
382 %251 = OpCompositeExtract %6 %178 1
383 %253 = OpCompositeExtract %6 %213 1
384 %254 = OpFOrdLessThan %11 %251 %253
385 OpSelectionMerge %256 None
386 OpBranchConditional %254 %255 %256
390 %262 = OpCompositeExtract %6 %213 2
391 %263 = OpFAdd %6 %246 %262
392 %264 = OpFOrdGreaterThan %11 %244 %263
393 OpSelectionMerge %266 None
394 OpBranchConditional %264 %265 %266
398 %272 = OpCompositeExtract %6 %213 3
399 %273 = OpFAdd %6 %253 %272
400 %274 = OpFOrdGreaterThan %11 %251 %273
401 OpSelectionMerge %276 None
402 OpBranchConditional %274 %275 %276
408 %282 = OpPhi %11 %31 %248 %31 %255 %31 %265 %31 %275 %66 %276
409 OpSelectionMerge %232 None
410 OpBranchConditional %282 %215 %232
413 %217 = OpAccessChain %23 %200 %279 %22
414 %218 = OpLoad %6 %217
415 %219 = OpConvertFToS %73 %218
417 %221 = OpAccessChain %23 %201 %279 %33
418 %222 = OpLoad %6 %221
419 %516 = OpLoad %86 %389
422 %223 = OpConvertFToS %73 %222
423 %224 = OpIMul %73 %219 %223
424 %226 = OpIMul %73 %279 %146
425 %227 = OpIAdd %73 %224 %226
426 %228 = OpIAdd %73 %227 %149
427 %229 = OpSMod %73 %228 %151
429 %230 = OpAccessChain %10 %202 %229
430 %231 = OpLoad %9 %230
433 %285 = OpPhi %9 %280 %277 %231 %215
436 %235 = OpIAdd %73 %279 %158
444 # uniforms for variant
447 BUFFER variant_resolution DATA_TYPE vec2<float> STD140 DATA
451 BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
453 PIPELINE graphics variant_pipeline
454 ATTACH variant_vertex_shader
455 ATTACH variant_fragment_shader
456 FRAMEBUFFER_SIZE 256 256
457 BIND BUFFER variant_framebuffer AS color LOCATION 0
458 BIND BUFFER variant_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
460 CLEAR_COLOR variant_pipeline 0 0 0 255
462 CLEAR variant_pipeline
463 RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 256 256
466 SHADER vertex variant_2_vertex_shader PASSTHROUGH
468 SHADER fragment variant_2_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
471 ; Generator: Khronos Glslang Reference Front End; 7
475 %1 = OpExtInstImport "GLSL.std.450"
476 OpMemoryModel Logical GLSL450
477 OpEntryPoint Fragment %4 "main" %165 %180
478 OpExecutionMode %4 OriginUpperLeft
481 OpName %165 "gl_FragCoord"
483 OpMemberName %168 0 "resolution"
485 OpName %180 "_GLF_color"
486 OpDecorate %165 BuiltIn FragCoord
487 OpMemberDecorate %168 0 Offset 0
488 OpDecorate %168 Block
489 OpDecorate %170 DescriptorSet 0
490 OpDecorate %170 Binding 0
491 OpDecorate %180 Location 0
493 %3 = OpTypeFunction %2
495 %7 = OpTypeVector %6 2
496 %9 = OpTypeVector %6 4
497 %10 = OpTypePointer Function %9
500 %22 = OpConstant %21 0
501 %23 = OpTypePointer Function %6
502 %31 = OpConstantFalse %11
503 %33 = OpConstant %21 1
504 %66 = OpConstantTrue %11
505 %70 = OpConstant %6 0.5
506 %71 = OpConstant %6 1
507 %72 = OpConstantComposite %9 %70 %70 %71 %71
509 %76 = OpConstant %73 0
510 %83 = OpConstant %73 8
511 %85 = OpConstant %21 8
512 %86 = OpTypeArray %9 %85
513 %87 = OpConstant %6 4
514 %88 = OpConstant %6 20
515 %89 = OpConstantComposite %9 %87 %87 %88 %87
516 %90 = OpConstantComposite %9 %87 %87 %87 %88
517 %91 = OpConstantComposite %9 %87 %88 %88 %87
518 %92 = OpConstant %6 8
519 %93 = OpConstantComposite %9 %88 %87 %87 %92
520 %94 = OpConstant %6 6
521 %95 = OpConstant %6 2
522 %96 = OpConstantComposite %9 %92 %94 %87 %95
523 %97 = OpConstant %6 12
524 %98 = OpConstantComposite %9 %95 %97 %95 %87
525 %99 = OpConstant %6 16
526 %100 = OpConstantComposite %9 %99 %95 %87 %87
527 %101 = OpConstant %6 22
528 %102 = OpConstantComposite %9 %97 %101 %87 %87
529 %103 = OpConstantComposite %86 %89 %90 %91 %93 %96 %98 %100 %102
530 %108 = OpTypePointer Function %86
531 %115 = OpConstant %21 16
532 %116 = OpTypeArray %9 %115
533 %117 = OpConstant %6 0
534 %118 = OpConstantComposite %9 %117 %117 %117 %71
535 %119 = OpConstantComposite %9 %70 %117 %117 %71
536 %120 = OpConstantComposite %9 %117 %70 %117 %71
537 %121 = OpConstantComposite %9 %70 %70 %117 %71
538 %122 = OpConstantComposite %9 %117 %117 %70 %71
539 %123 = OpConstantComposite %9 %70 %117 %70 %71
540 %124 = OpConstantComposite %9 %117 %70 %70 %71
541 %125 = OpConstantComposite %9 %70 %70 %70 %71
542 %126 = OpConstantComposite %9 %71 %117 %117 %71
543 %127 = OpConstantComposite %9 %117 %71 %117 %71
544 %128 = OpConstantComposite %9 %71 %71 %117 %71
545 %129 = OpConstantComposite %9 %117 %117 %71 %71
546 %130 = OpConstantComposite %9 %71 %117 %71 %71
547 %131 = OpConstantComposite %9 %117 %71 %71 %71
548 %132 = OpConstantComposite %9 %71 %71 %71 %71
549 %133 = OpConstantComposite %116 %118 %119 %120 %121 %122 %123 %124 %125 %118 %126 %127 %128 %129 %130 %131 %132
550 %146 = OpConstant %73 9
551 %149 = OpConstant %73 11
552 %151 = OpConstant %73 16
553 %153 = OpTypePointer Function %116
554 %158 = OpConstant %73 1
555 %164 = OpTypePointer Input %9
556 %165 = OpVariable %164 Input
557 %168 = OpTypeStruct %7
558 %169 = OpTypePointer Uniform %168
559 %170 = OpVariable %169 Uniform
560 %171 = OpTypePointer Uniform %7
561 %176 = OpConstant %6 32
562 %179 = OpTypePointer Output %9
563 %180 = OpVariable %179 Output
564 %386 = OpConstantComposite %9 %117 %117 %117 %117
565 %387 = OpConstantComposite %86 %386 %386 %386 %386 %386 %386 %386 %386
566 %498 = OpConstant %6 0
567 %499 = OpConstantComposite %9 %498 %498 %498 %498
568 %503 = OpConstantComposite %86 %499 %499 %499 %499 %499 %499 %499 %499
569 %4 = OpFunction %2 None %3
571 %389 = OpVariable %108 Function %387
572 %199 = OpVariable %108 Function
573 %200 = OpVariable %108 Function
574 %201 = OpVariable %108 Function
575 %202 = OpVariable %153 Function
577 %388 = OpLoad %86 %389
578 %166 = OpLoad %9 %165
579 %167 = OpVectorShuffle %7 %166 %166 0 1
580 %172 = OpAccessChain %171 %170 %76
581 %173 = OpLoad %7 %172
582 %174 = OpFDiv %7 %167 %173
583 %177 = OpVectorTimesScalar %7 %174 %176
584 %178 = OpExtInst %7 %1 Floor %177
587 %280 = OpPhi %9 %72 %5 %285 %233
588 %279 = OpPhi %73 %76 %5 %235 %233
589 %208 = OpSLessThan %11 %279 %83
590 OpLoopMerge %236 %233 None
591 OpBranchConditional %208 %209 %236
594 %212 = OpAccessChain %10 %199 %279
595 %213 = OpLoad %9 %212
596 OpSelectionMerge %277 None
599 %244 = OpCompositeExtract %6 %178 0
600 %246 = OpCompositeExtract %6 %213 0
601 %247 = OpFOrdLessThan %11 %244 %246
602 OpSelectionMerge %249 None
603 OpBranchConditional %247 %248 %249
607 %251 = OpCompositeExtract %6 %178 1
608 %253 = OpCompositeExtract %6 %213 1
609 %254 = OpFOrdLessThan %11 %251 %253
610 OpSelectionMerge %256 None
611 OpBranchConditional %254 %255 %256
615 %262 = OpCompositeExtract %6 %213 2
616 %263 = OpFAdd %6 %246 %262
617 %264 = OpFOrdGreaterThan %11 %244 %263
618 OpSelectionMerge %266 None
619 OpBranchConditional %264 %265 %266
623 %272 = OpCompositeExtract %6 %213 3
624 %273 = OpFAdd %6 %253 %272
625 %274 = OpFOrdGreaterThan %11 %251 %273
626 OpSelectionMerge %276 None
627 OpBranchConditional %274 %275 %276
633 %282 = OpPhi %11 %31 %248 %31 %255 %31 %265 %31 %275 %66 %276
634 OpSelectionMerge %232 None
635 OpBranchConditional %282 %215 %232
638 %217 = OpAccessChain %23 %200 %279 %22
639 %218 = OpLoad %6 %217
640 %219 = OpConvertFToS %73 %218
642 %221 = OpAccessChain %23 %201 %279 %33
643 %222 = OpLoad %6 %221
644 %223 = OpConvertFToS %73 %222
645 %224 = OpIMul %73 %219 %223
646 %226 = OpIMul %73 %279 %146
647 %227 = OpIAdd %73 %224 %226
648 %228 = OpIAdd %73 %227 %149
649 %229 = OpSMod %73 %228 %151
651 %230 = OpAccessChain %10 %202 %229
652 %231 = OpLoad %9 %230
655 %285 = OpPhi %9 %280 %277 %231 %215
658 %235 = OpIAdd %73 %279 %158
666 # uniforms for variant_2
669 BUFFER variant_2_resolution DATA_TYPE vec2<float> STD140 DATA
673 BUFFER variant_2_framebuffer FORMAT B8G8R8A8_UNORM
675 PIPELINE graphics variant_2_pipeline
676 ATTACH variant_2_vertex_shader
677 ATTACH variant_2_fragment_shader
678 FRAMEBUFFER_SIZE 256 256
679 BIND BUFFER variant_2_framebuffer AS color LOCATION 0
680 BIND BUFFER variant_2_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
682 CLEAR_COLOR variant_2_pipeline 0 0 0 255
684 CLEAR variant_2_pipeline
685 RUN variant_2_pipeline DRAW_RECT POS 0 0 SIZE 256 256
687 EXPECT reference_framebuffer EQ_HISTOGRAM_EMD_BUFFER variant_framebuffer TOLERANCE 0.005
688 EXPECT reference_framebuffer EQ_HISTOGRAM_EMD_BUFFER variant_2_framebuffer TOLERANCE 0.005