#!amber # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # A test for a coverage-gap found by the GraphicsFuzz project. # Short description: A fragment shader that covers specific LLVM code paths # The test passes because the shader always writes red. SHADER vertex variant_vertex_shader PASSTHROUGH # variant_fragment_shader is derived from the following GLSL: # #version 320 es # #define _int_3 _GLF_uniform_int_values[0] # #define _int_1 _GLF_uniform_int_values[1] # #define _int_2 _GLF_uniform_int_values[2] # #define _int_4 _GLF_uniform_int_values[3] # #define _int_14 _GLF_uniform_int_values[4] # #define _int_15 _GLF_uniform_int_values[5] # #define _int_16 _GLF_uniform_int_values[6] # #define _int_17 _GLF_uniform_int_values[7] # #define _int_18 _GLF_uniform_int_values[8] # #define _int_19 _GLF_uniform_int_values[9] # #define _int_10 _GLF_uniform_int_values[10] # #define _int_0 _GLF_uniform_int_values[11] # #define _int_9 _GLF_uniform_int_values[12] # #define _int_5 _GLF_uniform_int_values[13] # #define _int_6 _GLF_uniform_int_values[14] # #define _int_7 _GLF_uniform_int_values[15] # #define _int_8 _GLF_uniform_int_values[16] # #define _float_1_0 _GLF_uniform_float_values[0] # # precision highp float; # precision highp int; # # // Contents of _GLF_uniform_float_values: 1.0 # layout(set = 0, binding = 0) uniform buf0 # { # float _GLF_uniform_float_values[1]; # }; # # // Contents of _GLF_uniform_int_values: [3, 1, 2, 4, 14, 15, 16, 17, 18, 19, 10, 0, 9, 5, 6, 7, 8] # layout(set = 0, binding = 1) uniform buf1 # { # int _GLF_uniform_int_values[17]; # }; # # // Contents of two: 2.0 # layout(set = 0, binding = 2) uniform buf2 # { # float two; # }; # # struct S # { # int data; # int leftIndex; # int rightIndex; # }; # # layout(location = 0) out vec4 _GLF_color; # # int data0[10] = int[10](0, 1, 2, 3, 4, 5, 6, 7, 8, 9), data1[10] = int[10](10, 11, 12, 13, 14, 15, 16, 17, 18, 19); # # void func0(int from, int mid, int to) # { # int k = _int_1, i = 1, j = _int_1; # # while(i <= mid) # { # if(i <= j) # { # _GLF_color = vec4(_int_1); # # int a = - _int_1; # # // Iterates once. # while(a != _int_1) # { # a = S[10](S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3), S(_int_1, _int_2, _int_3))[clamp(a, _int_0, _int_9)].data; # } # } # else # { # data1[k++] = data0[j++]; # } # # i++; # } # # while(i < 5 && k < _int_10) # { # data1[k++] = int[10](_int_0, _int_1, _int_2, _int_3, _int_4, _int_5, _int_6, _int_7, _int_8, _int_9)[i++]; # } # # for(int i = from; i <= to - 1; i++) # { # data0[i] = data1[i]; # } # } # # int func1() # { # int a = _int_1; # # for(int i = 1; i < 10; i *= 2) # { # for(int j = 1; j < 10; j += i) # { # func0(i, j, min(i + j, 10)); # } # # while(a < _int_5) # { # // v becomes (0, 0). # ivec2 v = ivec2(vec2(_float_1_0) / two); # # // This loop is never iterated. # while(v.x + v.y > _int_2) # { # } # # a++; # } # } # return a; # } # # void main() # { # _GLF_color = vec4(_int_0); # # // Always true. # if(func1() == _int_5) # { # _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1); # } # # /* # This python script was used to generate the reference values: # # data0 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # data1 = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] # # def func0(x, y, z): # global data0 # global data1 # k = 1 # i = 1 # j = 1 # # while i <= y: # if i > j: # data1[k] = data0[j] # k = k + 1 # j = j + 1 # i = i + 1 # # while i < 5 and k < 10: # data1[k] = i # k = k + 1 # i = i + 1 # # for i in range(x, z): # data0[i] = data1[i] # # def func1(): # a = 1 # i = 1 # # while i < 10: # j = 1 # while j < 10: # func0(i, j, min(i + j, 10)) # j = i + j # while a < 5: # a = a + 1 # i = 2 * i # return a # # print(func1()) # print(data0) # print(data1) # */ # # int ref0[10] = int[10](_int_0, _int_2, _int_3, _int_4, _int_14, _int_15, _int_16, _int_17, _int_18, _int_19); # int ref1[10] = int[10](_int_10, _int_2, _int_3, _int_4, _int_14, _int_15, _int_16, _int_17, _int_18, _int_19); # # // Verify the global arrays against reference and set output to zero if the check fails. # for(int i = _int_0; i < _int_10; i++) # { # if(data0[i] != ref0[i] || data1[i] != ref1[i]) # { # _GLF_color = vec4(_int_0); # } # } # } SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0 ; SPIR-V ; Version: 1.0 ; Generator: Khronos Glslang Reference Front End; 10 ; Bound: 437 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %75 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 320 OpName %4 "main" OpName %12 "func0(i1;i1;i1;" OpName %9 "from" OpName %10 "mid" OpName %11 "to" OpName %15 "func1(" OpName %21 "data0" OpName %33 "data1" OpName %45 "k" OpName %48 "buf1" OpMemberName %48 0 "_GLF_uniform_int_values" OpName %50 "" OpName %54 "i" OpName %55 "j" OpName %75 "_GLF_color" OpName %80 "a" OpName %99 "S" OpMemberName %99 0 "data" OpMemberName %99 1 "leftIndex" OpMemberName %99 2 "rightIndex" OpName %173 "indexable" OpName %227 "indexable" OpName %231 "i" OpName %249 "a" OpName %252 "i" OpName %260 "j" OpName %272 "param" OpName %274 "param" OpName %276 "param" OpName %292 "v" OpName %295 "buf0" OpMemberName %295 0 "_GLF_uniform_float_values" OpName %297 "" OpName %303 "buf2" OpMemberName %303 0 "two" OpName %305 "" OpName %355 "ref0" OpName %377 "ref1" OpName %399 "i" OpDecorate %47 ArrayStride 16 OpMemberDecorate %48 0 Offset 0 OpDecorate %48 Block OpDecorate %50 DescriptorSet 0 OpDecorate %50 Binding 1 OpDecorate %75 Location 0 OpDecorate %294 ArrayStride 16 OpMemberDecorate %295 0 Offset 0 OpDecorate %295 Block OpDecorate %297 DescriptorSet 0 OpDecorate %297 Binding 0 OpMemberDecorate %303 0 Offset 0 OpDecorate %303 Block OpDecorate %305 DescriptorSet 0 OpDecorate %305 Binding 2 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeInt 32 1 %7 = OpTypePointer Function %6 %8 = OpTypeFunction %2 %7 %7 %7 %14 = OpTypeFunction %6 %17 = OpTypeInt 32 0 %18 = OpConstant %17 10 %19 = OpTypeArray %6 %18 %20 = OpTypePointer Private %19 %21 = OpVariable %20 Private %22 = OpConstant %6 0 %23 = OpConstant %6 1 %24 = OpConstant %6 2 %25 = OpConstant %6 3 %26 = OpConstant %6 4 %27 = OpConstant %6 5 %28 = OpConstant %6 6 %29 = OpConstant %6 7 %30 = OpConstant %6 8 %31 = OpConstant %6 9 %32 = OpConstantComposite %19 %22 %23 %24 %25 %26 %27 %28 %29 %30 %31 %33 = OpVariable %20 Private %34 = OpConstant %6 10 %35 = OpConstant %6 11 %36 = OpConstant %6 12 %37 = OpConstant %6 13 %38 = OpConstant %6 14 %39 = OpConstant %6 15 %40 = OpConstant %6 16 %41 = OpConstant %6 17 %42 = OpConstant %6 18 %43 = OpConstant %6 19 %44 = OpConstantComposite %19 %34 %35 %36 %37 %38 %39 %40 %41 %42 %43 %46 = OpConstant %17 17 %47 = OpTypeArray %6 %46 %48 = OpTypeStruct %47 %49 = OpTypePointer Uniform %48 %50 = OpVariable %49 Uniform %51 = OpTypePointer Uniform %6 %65 = OpTypeBool %72 = OpTypeFloat 32 %73 = OpTypeVector %72 4 %74 = OpTypePointer Output %73 %75 = OpVariable %74 Output %99 = OpTypeStruct %6 %6 %6 %164 = OpTypeArray %99 %18 %172 = OpTypePointer Function %164 %181 = OpTypePointer Private %6 %226 = OpTypePointer Function %19 %290 = OpTypeVector %6 2 %291 = OpTypePointer Function %290 %293 = OpConstant %17 1 %294 = OpTypeArray %72 %293 %295 = OpTypeStruct %294 %296 = OpTypePointer Uniform %295 %297 = OpVariable %296 Uniform %298 = OpTypePointer Uniform %72 %301 = OpTypeVector %72 2 %303 = OpTypeStruct %72 %304 = OpTypePointer Uniform %303 %305 = OpVariable %304 Uniform %316 = OpConstant %17 0 %4 = OpFunction %2 None %3 %5 = OpLabel %355 = OpVariable %226 Function %377 = OpVariable %226 Function %399 = OpVariable %7 Function OpStore %21 %32 OpStore %33 %44 %332 = OpAccessChain %51 %50 %22 %35 %333 = OpLoad %6 %332 %334 = OpConvertSToF %72 %333 %335 = OpCompositeConstruct %73 %334 %334 %334 %334 OpStore %75 %335 %336 = OpFunctionCall %6 %15 %337 = OpAccessChain %51 %50 %22 %37 %338 = OpLoad %6 %337 %339 = OpIEqual %65 %336 %338 OpSelectionMerge %341 None OpBranchConditional %339 %340 %341 %340 = OpLabel %342 = OpAccessChain %51 %50 %22 %23 %343 = OpLoad %6 %342 %344 = OpConvertSToF %72 %343 %345 = OpAccessChain %51 %50 %22 %35 %346 = OpLoad %6 %345 %347 = OpConvertSToF %72 %346 %348 = OpAccessChain %51 %50 %22 %35 %349 = OpLoad %6 %348 %350 = OpConvertSToF %72 %349 %351 = OpAccessChain %51 %50 %22 %23 %352 = OpLoad %6 %351 %353 = OpConvertSToF %72 %352 %354 = OpCompositeConstruct %73 %344 %347 %350 %353 OpStore %75 %354 OpBranch %341 %341 = OpLabel %356 = OpAccessChain %51 %50 %22 %35 %357 = OpLoad %6 %356 %358 = OpAccessChain %51 %50 %22 %24 %359 = OpLoad %6 %358 %360 = OpAccessChain %51 %50 %22 %22 %361 = OpLoad %6 %360 %362 = OpAccessChain %51 %50 %22 %25 %363 = OpLoad %6 %362 %364 = OpAccessChain %51 %50 %22 %26 %365 = OpLoad %6 %364 %366 = OpAccessChain %51 %50 %22 %27 %367 = OpLoad %6 %366 %368 = OpAccessChain %51 %50 %22 %28 %369 = OpLoad %6 %368 %370 = OpAccessChain %51 %50 %22 %29 %371 = OpLoad %6 %370 %372 = OpAccessChain %51 %50 %22 %30 %373 = OpLoad %6 %372 %374 = OpAccessChain %51 %50 %22 %31 %375 = OpLoad %6 %374 %376 = OpCompositeConstruct %19 %357 %359 %361 %363 %365 %367 %369 %371 %373 %375 OpStore %355 %376 %378 = OpAccessChain %51 %50 %22 %34 %379 = OpLoad %6 %378 %380 = OpAccessChain %51 %50 %22 %24 %381 = OpLoad %6 %380 %382 = OpAccessChain %51 %50 %22 %22 %383 = OpLoad %6 %382 %384 = OpAccessChain %51 %50 %22 %25 %385 = OpLoad %6 %384 %386 = OpAccessChain %51 %50 %22 %26 %387 = OpLoad %6 %386 %388 = OpAccessChain %51 %50 %22 %27 %389 = OpLoad %6 %388 %390 = OpAccessChain %51 %50 %22 %28 %391 = OpLoad %6 %390 %392 = OpAccessChain %51 %50 %22 %29 %393 = OpLoad %6 %392 %394 = OpAccessChain %51 %50 %22 %30 %395 = OpLoad %6 %394 %396 = OpAccessChain %51 %50 %22 %31 %397 = OpLoad %6 %396 %398 = OpCompositeConstruct %19 %379 %381 %383 %385 %387 %389 %391 %393 %395 %397 OpStore %377 %398 %400 = OpAccessChain %51 %50 %22 %35 %401 = OpLoad %6 %400 OpStore %399 %401 OpBranch %402 %402 = OpLabel OpLoopMerge %404 %405 None OpBranch %406 %406 = OpLabel %407 = OpLoad %6 %399 %408 = OpAccessChain %51 %50 %22 %34 %409 = OpLoad %6 %408 %410 = OpSLessThan %65 %407 %409 OpBranchConditional %410 %403 %404 %403 = OpLabel %411 = OpLoad %6 %399 %412 = OpAccessChain %181 %21 %411 %413 = OpLoad %6 %412 %414 = OpLoad %6 %399 %415 = OpAccessChain %7 %355 %414 %416 = OpLoad %6 %415 %417 = OpINotEqual %65 %413 %416 %418 = OpLogicalNot %65 %417 OpSelectionMerge %420 None OpBranchConditional %418 %419 %420 %419 = OpLabel %421 = OpLoad %6 %399 %422 = OpAccessChain %181 %33 %421 %423 = OpLoad %6 %422 %424 = OpLoad %6 %399 %425 = OpAccessChain %7 %377 %424 %426 = OpLoad %6 %425 %427 = OpINotEqual %65 %423 %426 OpBranch %420 %420 = OpLabel %428 = OpPhi %65 %417 %403 %427 %419 OpSelectionMerge %430 None OpBranchConditional %428 %429 %430 %429 = OpLabel %431 = OpAccessChain %51 %50 %22 %35 %432 = OpLoad %6 %431 %433 = OpConvertSToF %72 %432 %434 = OpCompositeConstruct %73 %433 %433 %433 %433 OpStore %75 %434 OpBranch %430 %430 = OpLabel OpBranch %405 %405 = OpLabel %435 = OpLoad %6 %399 %436 = OpIAdd %6 %435 %23 OpStore %399 %436 OpBranch %402 %404 = OpLabel OpReturn OpFunctionEnd %12 = OpFunction %2 None %8 %9 = OpFunctionParameter %7 %10 = OpFunctionParameter %7 %11 = OpFunctionParameter %7 %13 = OpLabel %45 = OpVariable %7 Function %54 = OpVariable %7 Function %55 = OpVariable %7 Function %80 = OpVariable %7 Function %173 = OpVariable %172 Function %227 = OpVariable %226 Function %231 = OpVariable %7 Function %52 = OpAccessChain %51 %50 %22 %23 %53 = OpLoad %6 %52 OpStore %45 %53 OpStore %54 %23 %56 = OpAccessChain %51 %50 %22 %23 %57 = OpLoad %6 %56 OpStore %55 %57 OpBranch %58 %58 = OpLabel OpLoopMerge %60 %61 None OpBranch %62 %62 = OpLabel %63 = OpLoad %6 %54 %64 = OpLoad %6 %10 %66 = OpSLessThanEqual %65 %63 %64 OpBranchConditional %66 %59 %60 %59 = OpLabel %67 = OpLoad %6 %54 %68 = OpLoad %6 %55 %69 = OpSLessThanEqual %65 %67 %68 OpSelectionMerge %71 None OpBranchConditional %69 %70 %176 %70 = OpLabel %76 = OpAccessChain %51 %50 %22 %23 %77 = OpLoad %6 %76 %78 = OpConvertSToF %72 %77 %79 = OpCompositeConstruct %73 %78 %78 %78 %78 OpStore %75 %79 %81 = OpAccessChain %51 %50 %22 %23 %82 = OpLoad %6 %81 %83 = OpSNegate %6 %82 OpStore %80 %83 OpBranch %84 %84 = OpLabel OpLoopMerge %86 %87 None OpBranch %88 %88 = OpLabel %89 = OpLoad %6 %80 %90 = OpAccessChain %51 %50 %22 %23 %91 = OpLoad %6 %90 %92 = OpINotEqual %65 %89 %91 OpBranchConditional %92 %85 %86 %85 = OpLabel %93 = OpAccessChain %51 %50 %22 %23 %94 = OpLoad %6 %93 %95 = OpAccessChain %51 %50 %22 %24 %96 = OpLoad %6 %95 %97 = OpAccessChain %51 %50 %22 %22 %98 = OpLoad %6 %97 %100 = OpCompositeConstruct %99 %94 %96 %98 %101 = OpAccessChain %51 %50 %22 %23 %102 = OpLoad %6 %101 %103 = OpAccessChain %51 %50 %22 %24 %104 = OpLoad %6 %103 %105 = OpAccessChain %51 %50 %22 %22 %106 = OpLoad %6 %105 %107 = OpCompositeConstruct %99 %102 %104 %106 %108 = OpAccessChain %51 %50 %22 %23 %109 = OpLoad %6 %108 %110 = OpAccessChain %51 %50 %22 %24 %111 = OpLoad %6 %110 %112 = OpAccessChain %51 %50 %22 %22 %113 = OpLoad %6 %112 %114 = OpCompositeConstruct %99 %109 %111 %113 %115 = OpAccessChain %51 %50 %22 %23 %116 = OpLoad %6 %115 %117 = OpAccessChain %51 %50 %22 %24 %118 = OpLoad %6 %117 %119 = OpAccessChain %51 %50 %22 %22 %120 = OpLoad %6 %119 %121 = OpCompositeConstruct %99 %116 %118 %120 %122 = OpAccessChain %51 %50 %22 %23 %123 = OpLoad %6 %122 %124 = OpAccessChain %51 %50 %22 %24 %125 = OpLoad %6 %124 %126 = OpAccessChain %51 %50 %22 %22 %127 = OpLoad %6 %126 %128 = OpCompositeConstruct %99 %123 %125 %127 %129 = OpAccessChain %51 %50 %22 %23 %130 = OpLoad %6 %129 %131 = OpAccessChain %51 %50 %22 %24 %132 = OpLoad %6 %131 %133 = OpAccessChain %51 %50 %22 %22 %134 = OpLoad %6 %133 %135 = OpCompositeConstruct %99 %130 %132 %134 %136 = OpAccessChain %51 %50 %22 %23 %137 = OpLoad %6 %136 %138 = OpAccessChain %51 %50 %22 %24 %139 = OpLoad %6 %138 %140 = OpAccessChain %51 %50 %22 %22 %141 = OpLoad %6 %140 %142 = OpCompositeConstruct %99 %137 %139 %141 %143 = OpAccessChain %51 %50 %22 %23 %144 = OpLoad %6 %143 %145 = OpAccessChain %51 %50 %22 %24 %146 = OpLoad %6 %145 %147 = OpAccessChain %51 %50 %22 %22 %148 = OpLoad %6 %147 %149 = OpCompositeConstruct %99 %144 %146 %148 %150 = OpAccessChain %51 %50 %22 %23 %151 = OpLoad %6 %150 %152 = OpAccessChain %51 %50 %22 %24 %153 = OpLoad %6 %152 %154 = OpAccessChain %51 %50 %22 %22 %155 = OpLoad %6 %154 %156 = OpCompositeConstruct %99 %151 %153 %155 %157 = OpAccessChain %51 %50 %22 %23 %158 = OpLoad %6 %157 %159 = OpAccessChain %51 %50 %22 %24 %160 = OpLoad %6 %159 %161 = OpAccessChain %51 %50 %22 %22 %162 = OpLoad %6 %161 %163 = OpCompositeConstruct %99 %158 %160 %162 %165 = OpCompositeConstruct %164 %100 %107 %114 %121 %128 %135 %142 %149 %156 %163 %166 = OpLoad %6 %80 %167 = OpAccessChain %51 %50 %22 %35 %168 = OpLoad %6 %167 %169 = OpAccessChain %51 %50 %22 %36 %170 = OpLoad %6 %169 %171 = OpExtInst %6 %1 SClamp %166 %168 %170 OpStore %173 %165 %174 = OpAccessChain %7 %173 %171 %22 %175 = OpLoad %6 %174 OpStore %80 %175 OpBranch %87 %87 = OpLabel OpBranch %84 %86 = OpLabel OpBranch %71 %176 = OpLabel %177 = OpLoad %6 %45 %178 = OpIAdd %6 %177 %23 OpStore %45 %178 %179 = OpLoad %6 %55 %180 = OpIAdd %6 %179 %23 OpStore %55 %180 %182 = OpAccessChain %181 %21 %179 %183 = OpLoad %6 %182 %184 = OpAccessChain %181 %33 %177 OpStore %184 %183 OpBranch %71 %71 = OpLabel %185 = OpLoad %6 %54 %186 = OpIAdd %6 %185 %23 OpStore %54 %186 OpBranch %61 %61 = OpLabel OpBranch %58 %60 = OpLabel OpBranch %187 %187 = OpLabel OpLoopMerge %189 %190 None OpBranch %191 %191 = OpLabel %192 = OpLoad %6 %54 %193 = OpSLessThan %65 %192 %27 OpSelectionMerge %195 None OpBranchConditional %193 %194 %195 %194 = OpLabel %196 = OpLoad %6 %45 %197 = OpAccessChain %51 %50 %22 %34 %198 = OpLoad %6 %197 %199 = OpSLessThan %65 %196 %198 OpBranch %195 %195 = OpLabel %200 = OpPhi %65 %193 %191 %199 %194 OpBranchConditional %200 %188 %189 %188 = OpLabel %201 = OpLoad %6 %45 %202 = OpIAdd %6 %201 %23 OpStore %45 %202 %203 = OpAccessChain %51 %50 %22 %35 %204 = OpLoad %6 %203 %205 = OpAccessChain %51 %50 %22 %23 %206 = OpLoad %6 %205 %207 = OpAccessChain %51 %50 %22 %24 %208 = OpLoad %6 %207 %209 = OpAccessChain %51 %50 %22 %22 %210 = OpLoad %6 %209 %211 = OpAccessChain %51 %50 %22 %25 %212 = OpLoad %6 %211 %213 = OpAccessChain %51 %50 %22 %37 %214 = OpLoad %6 %213 %215 = OpAccessChain %51 %50 %22 %38 %216 = OpLoad %6 %215 %217 = OpAccessChain %51 %50 %22 %39 %218 = OpLoad %6 %217 %219 = OpAccessChain %51 %50 %22 %40 %220 = OpLoad %6 %219 %221 = OpAccessChain %51 %50 %22 %36 %222 = OpLoad %6 %221 %223 = OpCompositeConstruct %19 %204 %206 %208 %210 %212 %214 %216 %218 %220 %222 %224 = OpLoad %6 %54 %225 = OpIAdd %6 %224 %23 OpStore %54 %225 OpStore %227 %223 %228 = OpAccessChain %7 %227 %224 %229 = OpLoad %6 %228 %230 = OpAccessChain %181 %33 %201 OpStore %230 %229 OpBranch %190 %190 = OpLabel OpBranch %187 %189 = OpLabel %232 = OpLoad %6 %9 OpStore %231 %232 OpBranch %233 %233 = OpLabel OpLoopMerge %235 %236 None OpBranch %237 %237 = OpLabel %238 = OpLoad %6 %231 %239 = OpLoad %6 %11 %240 = OpISub %6 %239 %23 %241 = OpSLessThanEqual %65 %238 %240 OpBranchConditional %241 %234 %235 %234 = OpLabel %242 = OpLoad %6 %231 %243 = OpLoad %6 %231 %244 = OpAccessChain %181 %33 %243 %245 = OpLoad %6 %244 %246 = OpAccessChain %181 %21 %242 OpStore %246 %245 OpBranch %236 %236 = OpLabel %247 = OpLoad %6 %231 %248 = OpIAdd %6 %247 %23 OpStore %231 %248 OpBranch %233 %235 = OpLabel OpReturn OpFunctionEnd %15 = OpFunction %6 None %14 %16 = OpLabel %249 = OpVariable %7 Function %252 = OpVariable %7 Function %260 = OpVariable %7 Function %272 = OpVariable %7 Function %274 = OpVariable %7 Function %276 = OpVariable %7 Function %292 = OpVariable %291 Function %250 = OpAccessChain %51 %50 %22 %23 %251 = OpLoad %6 %250 OpStore %249 %251 OpStore %252 %23 OpBranch %253 %253 = OpLabel OpLoopMerge %255 %256 None OpBranch %257 %257 = OpLabel %258 = OpLoad %6 %252 %259 = OpSLessThan %65 %258 %34 OpBranchConditional %259 %254 %255 %254 = OpLabel OpStore %260 %23 OpBranch %261 %261 = OpLabel OpLoopMerge %263 %264 None OpBranch %265 %265 = OpLabel %266 = OpLoad %6 %260 %267 = OpSLessThan %65 %266 %34 OpBranchConditional %267 %262 %263 %262 = OpLabel %268 = OpLoad %6 %252 %269 = OpLoad %6 %260 %270 = OpIAdd %6 %268 %269 %271 = OpExtInst %6 %1 SMin %270 %34 %273 = OpLoad %6 %252 OpStore %272 %273 %275 = OpLoad %6 %260 OpStore %274 %275 OpStore %276 %271 %277 = OpFunctionCall %2 %12 %272 %274 %276 OpBranch %264 %264 = OpLabel %278 = OpLoad %6 %252 %279 = OpLoad %6 %260 %280 = OpIAdd %6 %279 %278 OpStore %260 %280 OpBranch %261 %263 = OpLabel OpBranch %281 %281 = OpLabel OpLoopMerge %283 %284 None OpBranch %285 %285 = OpLabel %286 = OpLoad %6 %249 %287 = OpAccessChain %51 %50 %22 %37 %288 = OpLoad %6 %287 %289 = OpSLessThan %65 %286 %288 OpBranchConditional %289 %282 %283 %282 = OpLabel %299 = OpAccessChain %298 %297 %22 %22 %300 = OpLoad %72 %299 %302 = OpCompositeConstruct %301 %300 %300 %306 = OpAccessChain %298 %305 %22 %307 = OpLoad %72 %306 %308 = OpCompositeConstruct %301 %307 %307 %309 = OpFDiv %301 %302 %308 %310 = OpConvertFToS %290 %309 OpStore %292 %310 OpBranch %311 %311 = OpLabel OpLoopMerge %313 %314 None OpBranch %315 %315 = OpLabel %317 = OpAccessChain %7 %292 %316 %318 = OpLoad %6 %317 %319 = OpAccessChain %7 %292 %293 %320 = OpLoad %6 %319 %321 = OpIAdd %6 %318 %320 %322 = OpAccessChain %51 %50 %22 %24 %323 = OpLoad %6 %322 %324 = OpSGreaterThan %65 %321 %323 OpBranchConditional %324 %312 %313 %312 = OpLabel OpBranch %314 %314 = OpLabel OpBranch %311 %313 = OpLabel %325 = OpLoad %6 %249 %326 = OpIAdd %6 %325 %23 OpStore %249 %326 OpBranch %284 %284 = OpLabel OpBranch %281 %283 = OpLabel OpBranch %256 %256 = OpLabel %327 = OpLoad %6 %252 %328 = OpIMul %6 %327 %24 OpStore %252 %328 OpBranch %253 %255 = OpLabel %329 = OpLoad %6 %249 OpReturnValue %329 OpFunctionEnd END # uniforms for variant # two BUFFER variant_two DATA_TYPE float STD140 DATA 2.0 END # _GLF_uniform_int_values BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA 3 1 2 4 14 15 16 17 18 19 10 0 9 5 6 7 8 END # _GLF_uniform_float_values BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA 1.0 END BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM PIPELINE graphics variant_pipeline ATTACH variant_vertex_shader ATTACH variant_fragment_shader FRAMEBUFFER_SIZE 32 32 BIND BUFFER variant_framebuffer AS color LOCATION 0 BIND BUFFER variant_two AS uniform DESCRIPTOR_SET 0 BINDING 2 BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 1 BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 0 END CLEAR_COLOR variant_pipeline 0 0 0 255 CLEAR variant_pipeline RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32 EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255