Fix missing dependency on sparse binds
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / data / vulkan / amber / graphicsfuzz / spv-declare-bvec4.amber
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: Equivalent shaders except one declares a bvec4
21
22 # The test passes because both shaders render the same image.
23
24 SHADER vertex reference_vertex_shader PASSTHROUGH
25
26 SHADER fragment reference_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
27 ; SPIR-V
28 ; Version: 1.0
29 ; Generator: Khronos Glslang Reference Front End; 7
30 ; Bound: 189
31 ; Schema: 0
32                OpCapability Shader
33           %1 = OpExtInstImport "GLSL.std.450"
34                OpMemoryModel Logical GLSL450
35                OpEntryPoint Fragment %4 "main" %165 %180
36                OpExecutionMode %4 OriginUpperLeft
37                OpSource ESSL 320
38                OpName %4 "main"
39                OpName %15 "collision(vf2;vf4;"
40                OpName %13 "pos"
41                OpName %14 "quad"
42                OpName %19 "match(vf2;"
43                OpName %18 "pos"
44                OpName %69 "res"
45                OpName %75 "i"
46                OpName %105 "param"
47                OpName %107 "param"
48                OpName %109 "indexable"
49                OpName %135 "indexable"
50                OpName %140 "indexable"
51                OpName %154 "indexable"
52                OpName %163 "lin"
53                OpName %165 "gl_FragCoord"
54                OpName %168 "buf0"
55                OpMemberName %168 0 "resolution"
56                OpName %170 ""
57                OpName %180 "_GLF_color"
58                OpName %181 "param"
59                OpName %185 "index"
60                OpName %188 "state"
61                OpDecorate %165 BuiltIn FragCoord
62                OpMemberDecorate %168 0 Offset 0
63                OpDecorate %168 Block
64                OpDecorate %170 DescriptorSet 0
65                OpDecorate %170 Binding 0
66                OpDecorate %180 Location 0
67           %2 = OpTypeVoid
68           %3 = OpTypeFunction %2
69           %6 = OpTypeFloat 32
70           %7 = OpTypeVector %6 2
71           %8 = OpTypePointer Function %7
72           %9 = OpTypeVector %6 4
73          %10 = OpTypePointer Function %9
74          %11 = OpTypeBool
75          %12 = OpTypeFunction %11 %8 %10
76          %17 = OpTypeFunction %9 %8
77          %21 = OpTypeInt 32 0
78          %22 = OpConstant %21 0
79          %23 = OpTypePointer Function %6
80          %31 = OpConstantFalse %11
81          %33 = OpConstant %21 1
82          %46 = OpConstant %21 2
83          %58 = OpConstant %21 3
84          %66 = OpConstantTrue %11
85          %70 = OpConstant %6 0.5
86          %71 = OpConstant %6 1
87          %72 = OpConstantComposite %9 %70 %70 %71 %71
88          %73 = OpTypeInt 32 1
89          %74 = OpTypePointer Function %73
90          %76 = OpConstant %73 0
91          %83 = OpConstant %73 8
92          %85 = OpConstant %21 8
93          %86 = OpTypeArray %9 %85
94          %87 = OpConstant %6 4
95          %88 = OpConstant %6 20
96          %89 = OpConstantComposite %9 %87 %87 %88 %87
97          %90 = OpConstantComposite %9 %87 %87 %87 %88
98          %91 = OpConstantComposite %9 %87 %88 %88 %87
99          %92 = OpConstant %6 8
100          %93 = OpConstantComposite %9 %88 %87 %87 %92
101          %94 = OpConstant %6 6
102          %95 = OpConstant %6 2
103          %96 = OpConstantComposite %9 %92 %94 %87 %95
104          %97 = OpConstant %6 12
105          %98 = OpConstantComposite %9 %95 %97 %95 %87
106          %99 = OpConstant %6 16
107         %100 = OpConstantComposite %9 %99 %95 %87 %87
108         %101 = OpConstant %6 22
109         %102 = OpConstantComposite %9 %97 %101 %87 %87
110         %103 = OpConstantComposite %86 %89 %90 %91 %93 %96 %98 %100 %102
111         %108 = OpTypePointer Function %86
112         %115 = OpConstant %21 16
113         %116 = OpTypeArray %9 %115
114         %117 = OpConstant %6 0
115         %118 = OpConstantComposite %9 %117 %117 %117 %71
116         %119 = OpConstantComposite %9 %70 %117 %117 %71
117         %120 = OpConstantComposite %9 %117 %70 %117 %71
118         %121 = OpConstantComposite %9 %70 %70 %117 %71
119         %122 = OpConstantComposite %9 %117 %117 %70 %71
120         %123 = OpConstantComposite %9 %70 %117 %70 %71
121         %124 = OpConstantComposite %9 %117 %70 %70 %71
122         %125 = OpConstantComposite %9 %70 %70 %70 %71
123         %126 = OpConstantComposite %9 %71 %117 %117 %71
124         %127 = OpConstantComposite %9 %117 %71 %117 %71
125         %128 = OpConstantComposite %9 %71 %71 %117 %71
126         %129 = OpConstantComposite %9 %117 %117 %71 %71
127         %130 = OpConstantComposite %9 %71 %117 %71 %71
128         %131 = OpConstantComposite %9 %117 %71 %71 %71
129         %132 = OpConstantComposite %9 %71 %71 %71 %71
130         %133 = OpConstantComposite %116 %118 %119 %120 %121 %122 %123 %124 %125 %118 %126 %127 %128 %129 %130 %131 %132
131         %146 = OpConstant %73 9
132         %149 = OpConstant %73 11
133         %151 = OpConstant %73 16
134         %153 = OpTypePointer Function %116
135         %158 = OpConstant %73 1
136         %164 = OpTypePointer Input %9
137         %165 = OpVariable %164 Input
138         %168 = OpTypeStruct %7
139         %169 = OpTypePointer Uniform %168
140         %170 = OpVariable %169 Uniform
141         %171 = OpTypePointer Uniform %7
142         %176 = OpConstant %6 32
143         %179 = OpTypePointer Output %9
144         %180 = OpVariable %179 Output
145         %184 = OpTypePointer Private %73
146         %185 = OpVariable %184 Private
147         %186 = OpTypeArray %73 %115
148         %187 = OpTypePointer Private %186
149         %188 = OpVariable %187 Private
150           %4 = OpFunction %2 None %3
151           %5 = OpLabel
152         %163 = OpVariable %8 Function
153         %181 = OpVariable %8 Function
154         %166 = OpLoad %9 %165
155         %167 = OpVectorShuffle %7 %166 %166 0 1
156         %172 = OpAccessChain %171 %170 %76
157         %173 = OpLoad %7 %172
158         %174 = OpFDiv %7 %167 %173
159                OpStore %163 %174
160         %175 = OpLoad %7 %163
161         %177 = OpVectorTimesScalar %7 %175 %176
162         %178 = OpExtInst %7 %1 Floor %177
163                OpStore %163 %178
164         %182 = OpLoad %7 %163
165                OpStore %181 %182
166         %183 = OpFunctionCall %9 %19 %181
167                OpStore %180 %183
168                OpReturn
169                OpFunctionEnd
170          %15 = OpFunction %11 None %12
171          %13 = OpFunctionParameter %8
172          %14 = OpFunctionParameter %10
173          %16 = OpLabel
174          %24 = OpAccessChain %23 %13 %22
175          %25 = OpLoad %6 %24
176          %26 = OpAccessChain %23 %14 %22
177          %27 = OpLoad %6 %26
178          %28 = OpFOrdLessThan %11 %25 %27
179                OpSelectionMerge %30 None
180                OpBranchConditional %28 %29 %30
181          %29 = OpLabel
182                OpReturnValue %31
183          %30 = OpLabel
184          %34 = OpAccessChain %23 %13 %33
185          %35 = OpLoad %6 %34
186          %36 = OpAccessChain %23 %14 %33
187          %37 = OpLoad %6 %36
188          %38 = OpFOrdLessThan %11 %35 %37
189                OpSelectionMerge %40 None
190                OpBranchConditional %38 %39 %40
191          %39 = OpLabel
192                OpReturnValue %31
193          %40 = OpLabel
194          %42 = OpAccessChain %23 %13 %22
195          %43 = OpLoad %6 %42
196          %44 = OpAccessChain %23 %14 %22
197          %45 = OpLoad %6 %44
198          %47 = OpAccessChain %23 %14 %46
199          %48 = OpLoad %6 %47
200          %49 = OpFAdd %6 %45 %48
201          %50 = OpFOrdGreaterThan %11 %43 %49
202                OpSelectionMerge %52 None
203                OpBranchConditional %50 %51 %52
204          %51 = OpLabel
205                OpReturnValue %31
206          %52 = OpLabel
207          %54 = OpAccessChain %23 %13 %33
208          %55 = OpLoad %6 %54
209          %56 = OpAccessChain %23 %14 %33
210          %57 = OpLoad %6 %56
211          %59 = OpAccessChain %23 %14 %58
212          %60 = OpLoad %6 %59
213          %61 = OpFAdd %6 %57 %60
214          %62 = OpFOrdGreaterThan %11 %55 %61
215                OpSelectionMerge %64 None
216                OpBranchConditional %62 %63 %64
217          %63 = OpLabel
218                OpReturnValue %31
219          %64 = OpLabel
220                OpReturnValue %66
221                OpFunctionEnd
222          %19 = OpFunction %9 None %17
223          %18 = OpFunctionParameter %8
224          %20 = OpLabel
225          %69 = OpVariable %10 Function
226          %75 = OpVariable %74 Function
227         %105 = OpVariable %8 Function
228         %107 = OpVariable %10 Function
229         %109 = OpVariable %108 Function
230         %135 = OpVariable %108 Function
231         %140 = OpVariable %108 Function
232         %154 = OpVariable %153 Function
233                OpStore %69 %72
234                OpStore %75 %76
235                OpBranch %77
236          %77 = OpLabel
237                OpLoopMerge %79 %80 None
238                OpBranch %81
239          %81 = OpLabel
240          %82 = OpLoad %73 %75
241          %84 = OpSLessThan %11 %82 %83
242                OpBranchConditional %84 %78 %79
243          %78 = OpLabel
244         %104 = OpLoad %73 %75
245         %106 = OpLoad %7 %18
246                OpStore %105 %106
247                OpStore %109 %103
248         %110 = OpAccessChain %10 %109 %104
249         %111 = OpLoad %9 %110
250                OpStore %107 %111
251         %112 = OpFunctionCall %11 %15 %105 %107
252                OpSelectionMerge %114 None
253                OpBranchConditional %112 %113 %114
254         %113 = OpLabel
255         %134 = OpLoad %73 %75
256                OpStore %135 %103
257         %136 = OpAccessChain %23 %135 %134 %22
258         %137 = OpLoad %6 %136
259         %138 = OpConvertFToS %73 %137
260         %139 = OpLoad %73 %75
261                OpStore %140 %103
262         %141 = OpAccessChain %23 %140 %139 %33
263         %142 = OpLoad %6 %141
264         %143 = OpConvertFToS %73 %142
265         %144 = OpIMul %73 %138 %143
266         %145 = OpLoad %73 %75
267         %147 = OpIMul %73 %145 %146
268         %148 = OpIAdd %73 %144 %147
269         %150 = OpIAdd %73 %148 %149
270         %152 = OpSMod %73 %150 %151
271                OpStore %154 %133
272         %155 = OpAccessChain %10 %154 %152
273         %156 = OpLoad %9 %155
274                OpStore %69 %156
275                OpBranch %114
276         %114 = OpLabel
277                OpBranch %80
278          %80 = OpLabel
279         %157 = OpLoad %73 %75
280         %159 = OpIAdd %73 %157 %158
281                OpStore %75 %159
282                OpBranch %77
283          %79 = OpLabel
284         %160 = OpLoad %9 %69
285                OpReturnValue %160
286                OpFunctionEnd
287 END
288
289 # uniforms for reference
290
291 # resolution
292 BUFFER reference_resolution DATA_TYPE vec2<float> DATA
293  256.0 256.0
294 END
295
296 BUFFER reference_framebuffer FORMAT B8G8R8A8_UNORM
297
298 PIPELINE graphics reference_pipeline
299   ATTACH reference_vertex_shader
300   ATTACH reference_fragment_shader
301   FRAMEBUFFER_SIZE 256 256
302   BIND BUFFER reference_framebuffer AS color LOCATION 0
303   BIND BUFFER reference_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
304 END
305 CLEAR_COLOR reference_pipeline 0 0 0 255
306
307 CLEAR reference_pipeline
308 RUN reference_pipeline DRAW_RECT POS 0 0 SIZE 256 256
309
310
311 SHADER vertex variant_vertex_shader PASSTHROUGH
312
313 SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
314 ; SPIR-V
315 ; Version: 1.0
316 ; Generator: Khronos Glslang Reference Front End; 7
317 ; Bound: 366
318 ; Schema: 0
319                OpCapability Shader
320           %1 = OpExtInstImport "GLSL.std.450"
321                OpMemoryModel Logical GLSL450
322                OpEntryPoint Fragment %4 "main" %165 %180
323                OpExecutionMode %4 OriginUpperLeft
324                OpSource ESSL 320
325                OpName %4 "main"
326                OpName %15 "collision(vf2;vf4;"
327                OpName %13 "pos"
328                OpName %14 "quad"
329                OpName %19 "match(vf2;"
330                OpName %18 "pos"
331                OpName %69 "res"
332                OpName %75 "i"
333                OpName %105 "param"
334                OpName %107 "param"
335                OpName %109 "indexable"
336                OpName %135 "indexable"
337                OpName %140 "indexable"
338                OpName %154 "indexable"
339                OpName %163 "lin"
340                OpName %165 "gl_FragCoord"
341                OpName %168 "buf0"
342                OpMemberName %168 0 "resolution"
343                OpName %170 ""
344                OpName %180 "_GLF_color"
345                OpName %181 "param"
346                OpName %185 "index"
347                OpName %188 "state"
348                OpDecorate %165 BuiltIn FragCoord
349                OpMemberDecorate %168 0 Offset 0
350                OpDecorate %168 Block
351                OpDecorate %170 DescriptorSet 0
352                OpDecorate %170 Binding 0
353                OpDecorate %180 Location 0
354           %2 = OpTypeVoid
355           %3 = OpTypeFunction %2
356           %6 = OpTypeFloat 32
357           %7 = OpTypeVector %6 2
358           %8 = OpTypePointer Function %7
359           %9 = OpTypeVector %6 4
360          %10 = OpTypePointer Function %9
361          %11 = OpTypeBool
362          %12 = OpTypeFunction %11 %8 %10
363          %17 = OpTypeFunction %9 %8
364          %21 = OpTypeInt 32 0
365          %22 = OpConstant %21 0
366          %23 = OpTypePointer Function %6
367          %31 = OpConstantFalse %11
368          %33 = OpConstant %21 1
369          %46 = OpConstant %21 2
370          %58 = OpConstant %21 3
371          %66 = OpConstantTrue %11
372          %70 = OpConstant %6 0.5
373          %71 = OpConstant %6 1
374          %72 = OpConstantComposite %9 %70 %70 %71 %71
375          %73 = OpTypeInt 32 1
376          %74 = OpTypePointer Function %73
377          %76 = OpConstant %73 0
378          %83 = OpConstant %73 8
379          %85 = OpConstant %21 8
380          %86 = OpTypeArray %9 %85
381          %87 = OpConstant %6 4
382          %88 = OpConstant %6 20
383          %89 = OpConstantComposite %9 %87 %87 %88 %87
384          %90 = OpConstantComposite %9 %87 %87 %87 %88
385          %91 = OpConstantComposite %9 %87 %88 %88 %87
386          %92 = OpConstant %6 8
387          %93 = OpConstantComposite %9 %88 %87 %87 %92
388          %94 = OpConstant %6 6
389          %95 = OpConstant %6 2
390          %96 = OpConstantComposite %9 %92 %94 %87 %95
391          %97 = OpConstant %6 12
392          %98 = OpConstantComposite %9 %95 %97 %95 %87
393          %99 = OpConstant %6 16
394         %100 = OpConstantComposite %9 %99 %95 %87 %87
395         %101 = OpConstant %6 22
396         %102 = OpConstantComposite %9 %97 %101 %87 %87
397         %103 = OpConstantComposite %86 %89 %90 %91 %93 %96 %98 %100 %102
398         %108 = OpTypePointer Function %86
399         %115 = OpConstant %21 16
400         %116 = OpTypeArray %9 %115
401         %117 = OpConstant %6 0
402         %118 = OpConstantComposite %9 %117 %117 %117 %71
403         %119 = OpConstantComposite %9 %70 %117 %117 %71
404         %120 = OpConstantComposite %9 %117 %70 %117 %71
405         %121 = OpConstantComposite %9 %70 %70 %117 %71
406         %122 = OpConstantComposite %9 %117 %117 %70 %71
407         %123 = OpConstantComposite %9 %70 %117 %70 %71
408         %124 = OpConstantComposite %9 %117 %70 %70 %71
409         %125 = OpConstantComposite %9 %70 %70 %70 %71
410         %126 = OpConstantComposite %9 %71 %117 %117 %71
411         %127 = OpConstantComposite %9 %117 %71 %117 %71
412         %128 = OpConstantComposite %9 %71 %71 %117 %71
413         %129 = OpConstantComposite %9 %117 %117 %71 %71
414         %130 = OpConstantComposite %9 %71 %117 %71 %71
415         %131 = OpConstantComposite %9 %117 %71 %71 %71
416         %132 = OpConstantComposite %9 %71 %71 %71 %71
417         %133 = OpConstantComposite %116 %118 %119 %120 %121 %122 %123 %124 %125 %118 %126 %127 %128 %129 %130 %131 %132
418         %146 = OpConstant %73 9
419         %149 = OpConstant %73 11
420         %151 = OpConstant %73 16
421         %153 = OpTypePointer Function %116
422         %158 = OpConstant %73 1
423         %164 = OpTypePointer Input %9
424         %165 = OpVariable %164 Input
425         %168 = OpTypeStruct %7
426         %169 = OpTypePointer Uniform %168
427         %170 = OpVariable %169 Uniform
428         %171 = OpTypePointer Uniform %7
429         %176 = OpConstant %6 32
430         %179 = OpTypePointer Output %9
431         %180 = OpVariable %179 Output
432         %184 = OpTypePointer Private %73
433         %185 = OpVariable %184 Private
434         %186 = OpTypeArray %73 %115
435         %187 = OpTypePointer Private %186
436         %188 = OpVariable %187 Private
437         %313 = OpTypeVector %11 4
438         %363 = OpTypePointer Function %313
439         %364 = OpConstantComposite %313 %31 %31 %31 %31
440           %4 = OpFunction %2 None %3
441           %5 = OpLabel
442         %163 = OpVariable %8 Function
443         %181 = OpVariable %8 Function
444         %166 = OpLoad %9 %165
445         %167 = OpVectorShuffle %7 %166 %166 0 1
446         %172 = OpAccessChain %171 %170 %76
447         %173 = OpLoad %7 %172
448         %174 = OpFDiv %7 %167 %173
449                OpStore %163 %174
450         %175 = OpLoad %7 %163
451         %177 = OpVectorTimesScalar %7 %175 %176
452         %178 = OpExtInst %7 %1 Floor %177
453                OpStore %163 %178
454         %182 = OpLoad %7 %163
455                OpStore %181 %182
456         %183 = OpFunctionCall %9 %19 %181
457                OpStore %180 %183
458                OpReturn
459                OpFunctionEnd
460          %15 = OpFunction %11 None %12
461          %13 = OpFunctionParameter %8
462          %14 = OpFunctionParameter %10
463          %16 = OpLabel
464         %365 = OpVariable %363 Function %364
465          %24 = OpAccessChain %23 %13 %22
466          %25 = OpLoad %6 %24
467          %26 = OpAccessChain %23 %14 %22
468          %27 = OpLoad %6 %26
469          %28 = OpFOrdLessThan %11 %25 %27
470                OpSelectionMerge %30 None
471                OpBranchConditional %28 %29 %30
472          %29 = OpLabel
473                OpReturnValue %31
474          %30 = OpLabel
475          %34 = OpAccessChain %23 %13 %33
476          %35 = OpLoad %6 %34
477          %36 = OpAccessChain %23 %14 %33
478          %37 = OpLoad %6 %36
479          %38 = OpFOrdLessThan %11 %35 %37
480                OpSelectionMerge %40 None
481                OpBranchConditional %38 %39 %40
482          %39 = OpLabel
483                OpReturnValue %31
484          %40 = OpLabel
485          %42 = OpAccessChain %23 %13 %22
486          %43 = OpLoad %6 %42
487          %44 = OpAccessChain %23 %14 %22
488          %45 = OpLoad %6 %44
489          %47 = OpAccessChain %23 %14 %46
490          %48 = OpLoad %6 %47
491          %49 = OpFAdd %6 %45 %48
492          %50 = OpFOrdGreaterThan %11 %43 %49
493                OpSelectionMerge %52 None
494                OpBranchConditional %50 %51 %52
495          %51 = OpLabel
496                OpReturnValue %31
497          %52 = OpLabel
498          %54 = OpAccessChain %23 %13 %33
499          %55 = OpLoad %6 %54
500          %56 = OpAccessChain %23 %14 %33
501          %57 = OpLoad %6 %56
502          %59 = OpAccessChain %23 %14 %58
503          %60 = OpLoad %6 %59
504          %61 = OpFAdd %6 %57 %60
505          %62 = OpFOrdGreaterThan %11 %55 %61
506                OpSelectionMerge %64 None
507                OpBranchConditional %62 %63 %64
508          %63 = OpLabel
509                OpReturnValue %31
510          %64 = OpLabel
511                OpReturnValue %66
512                OpFunctionEnd
513          %19 = OpFunction %9 None %17
514          %18 = OpFunctionParameter %8
515          %20 = OpLabel
516          %69 = OpVariable %10 Function
517          %75 = OpVariable %74 Function
518         %105 = OpVariable %8 Function
519         %107 = OpVariable %10 Function
520         %109 = OpVariable %108 Function
521         %135 = OpVariable %108 Function
522         %140 = OpVariable %108 Function
523         %154 = OpVariable %153 Function
524                OpStore %69 %72
525                OpStore %75 %76
526                OpBranch %77
527          %77 = OpLabel
528                OpLoopMerge %79 %80 None
529                OpBranch %81
530          %81 = OpLabel
531          %82 = OpLoad %73 %75
532          %84 = OpSLessThan %11 %82 %83
533                OpBranchConditional %84 %78 %79
534          %78 = OpLabel
535         %104 = OpLoad %73 %75
536         %106 = OpLoad %7 %18
537                OpStore %105 %106
538                OpStore %109 %103
539         %110 = OpAccessChain %10 %109 %104
540         %111 = OpLoad %9 %110
541                OpStore %107 %111
542         %112 = OpFunctionCall %11 %15 %105 %107
543                OpSelectionMerge %114 None
544                OpBranchConditional %112 %113 %114
545         %113 = OpLabel
546         %134 = OpLoad %73 %75
547                OpStore %135 %103
548         %136 = OpAccessChain %23 %135 %134 %22
549         %137 = OpLoad %6 %136
550         %138 = OpConvertFToS %73 %137
551         %139 = OpLoad %73 %75
552                OpStore %140 %103
553         %141 = OpAccessChain %23 %140 %139 %33
554         %142 = OpLoad %6 %141
555         %143 = OpConvertFToS %73 %142
556         %144 = OpIMul %73 %138 %143
557         %145 = OpLoad %73 %75
558         %147 = OpIMul %73 %145 %146
559         %148 = OpIAdd %73 %144 %147
560         %150 = OpIAdd %73 %148 %149
561         %152 = OpSMod %73 %150 %151
562                OpStore %154 %133
563         %155 = OpAccessChain %10 %154 %152
564         %156 = OpLoad %9 %155
565                OpStore %69 %156
566                OpBranch %114
567         %114 = OpLabel
568                OpBranch %80
569          %80 = OpLabel
570         %157 = OpLoad %73 %75
571         %159 = OpIAdd %73 %157 %158
572                OpStore %75 %159
573                OpBranch %77
574          %79 = OpLabel
575         %160 = OpLoad %9 %69
576                OpReturnValue %160
577                OpFunctionEnd
578 END
579
580 # uniforms for variant
581
582 # resolution
583 BUFFER variant_resolution DATA_TYPE vec2<float> DATA
584  256.0 256.0
585 END
586
587 BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
588
589 PIPELINE graphics variant_pipeline
590   ATTACH variant_vertex_shader
591   ATTACH variant_fragment_shader
592   FRAMEBUFFER_SIZE 256 256
593   BIND BUFFER variant_framebuffer AS color LOCATION 0
594   BIND BUFFER variant_resolution AS uniform DESCRIPTOR_SET 0 BINDING 0
595 END
596 CLEAR_COLOR variant_pipeline 0 0 0 255
597
598 CLEAR variant_pipeline
599 RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 256 256
600
601 EXPECT reference_framebuffer EQ_HISTOGRAM_EMD_BUFFER variant_framebuffer TOLERANCE 0.005