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