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