Add a batch of GraphicsFuzz coverage tests
authorAntto Mäkinen <antto.makinen@siru.fi>
Fri, 23 Apr 2021 14:40:30 +0000 (17:40 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 16 Jun 2021 06:57:30 +0000 (06:57 +0000)
This commit adds a batch of GraphicsFuzz coverage tests.

Components: Vulkan

New Tests:

dEQP-VK.graphicsfuzz.cov-array-copies-loops-with-limiters
dEQP-VK.graphicsfuzz.cov-bitfieldreverse-loop-limit-underflow
dEQP-VK.graphicsfuzz.cov-condition-loop-index-bitwise-not
dEQP-VK.graphicsfuzz.cov-descending-loop-min-max-always-zero
dEQP-VK.graphicsfuzz.cov-global-loop-bound-true-logical-or
dEQP-VK.graphicsfuzz.cov-global-loop-counter-multiply-one-minus
dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
dEQP-VK.graphicsfuzz.cov-loop-logical-xor
dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
dEQP-VK.graphicsfuzz.cov-one-minus-clamp-always-one-cast-to-int

Change-Id: Ic3a4703622da470b4551fb5d5836c146897ec7bc

16 files changed:
android/cts/master/vk-master-2021-03-01/graphicsfuzz.txt
android/cts/master/vk-master/graphicsfuzz.txt
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-array-copies-loops-with-limiters.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-condition-loop-index-bitwise-not.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-descending-loop-min-max-always-zero.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-global-loop-bound-true-logical-or.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-global-loop-counter-multiply-one-minus.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-condition-double-negate.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-increment-matrix-element-break-after-first-iteration.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-logical-xor.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-nested-functions-accumulate-global-matrix.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-nested-loop-undefined-smoothstep-never-executed.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-one-minus-clamp-always-one-cast-to-int.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt
external/vulkancts/mustpass/master/vk-default/graphicsfuzz.txt

index 469d6c2..fa921e5 100644 (file)
@@ -21,6 +21,7 @@ dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
 dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
 dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
 dEQP-VK.graphicsfuzz.cov-array-accesses-clamp
+dEQP-VK.graphicsfuzz.cov-array-copies-loops-with-limiters
 dEQP-VK.graphicsfuzz.cov-asin-undefined-smoothstep
 dEQP-VK.graphicsfuzz.cov-atan-trunc-vec4
 dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
@@ -28,6 +29,7 @@ dEQP-VK.graphicsfuzz.cov-bitcount
 dEQP-VK.graphicsfuzz.cov-bitfieldExtract-undefined
 dEQP-VK.graphicsfuzz.cov-bitfieldinsert-undefined
 dEQP-VK.graphicsfuzz.cov-bitfieldreverse-left-shift-findmsb
+dEQP-VK.graphicsfuzz.cov-bitfieldreverse-loop-limit-underflow
 dEQP-VK.graphicsfuzz.cov-bitwise-inverse-uniform-condition
 dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
 dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
@@ -38,6 +40,7 @@ dEQP-VK.graphicsfuzz.cov-clamp-vector-element-ceil-negative
 dEQP-VK.graphicsfuzz.cov-clamp-vector-variable-negative-offset
 dEQP-VK.graphicsfuzz.cov-clear-yz-inside-condition
 dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
+dEQP-VK.graphicsfuzz.cov-condition-loop-index-bitwise-not
 dEQP-VK.graphicsfuzz.cov-conditional-discard-inside-loop
 dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
 dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
@@ -77,6 +80,7 @@ dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
 dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
 dEQP-VK.graphicsfuzz.cov-dead-code-unreachable-merge
 dEQP-VK.graphicsfuzz.cov-derivative-uniform-vector-global-loop-count
+dEQP-VK.graphicsfuzz.cov-descending-loop-min-max-always-zero
 dEQP-VK.graphicsfuzz.cov-double-if-true-in-loop
 dEQP-VK.graphicsfuzz.cov-exp2-two
 dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
@@ -119,8 +123,10 @@ dEQP-VK.graphicsfuzz.cov-fract-smoothstep-undefined
 dEQP-VK.graphicsfuzz.cov-fragcoord-clamp-array-access
 dEQP-VK.graphicsfuzz.cov-fragcoord-multiply
 dEQP-VK.graphicsfuzz.cov-function-vec2-never-discard
+dEQP-VK.graphicsfuzz.cov-global-loop-bound-true-logical-or
 dEQP-VK.graphicsfuzz.cov-global-loop-counter-float-accumulate-matrix
 dEQP-VK.graphicsfuzz.cov-global-loop-counter-main-function-call
+dEQP-VK.graphicsfuzz.cov-global-loop-counter-multiply-one-minus
 dEQP-VK.graphicsfuzz.cov-if-conversion-identical-branches
 dEQP-VK.graphicsfuzz.cov-if-switch-fallthrough
 dEQP-VK.graphicsfuzz.cov-if-true-continue
@@ -189,8 +195,11 @@ dEQP-VK.graphicsfuzz.cov-left-shift-right-shift-compare
 dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
 dEQP-VK.graphicsfuzz.cov-loop-abs-multiply-offset
 dEQP-VK.graphicsfuzz.cov-loop-clamp-to-one-empty-condition
+dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
 dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
+dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
 dEQP-VK.graphicsfuzz.cov-loop-increment-or-divide-by-loop-index
+dEQP-VK.graphicsfuzz.cov-loop-logical-xor
 dEQP-VK.graphicsfuzz.cov-loop-returns-behind-true-and-false
 dEQP-VK.graphicsfuzz.cov-loop-with-two-integers
 dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
@@ -211,10 +220,13 @@ dEQP-VK.graphicsfuzz.cov-mod-uint-bits-float
 dEQP-VK.graphicsfuzz.cov-modf-clamp-for
 dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
 dEQP-VK.graphicsfuzz.cov-multiple-one-iteration-loops-global-counter-write-matrices
+dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
+dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
 dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-do-while-accumulate-float
 dEQP-VK.graphicsfuzz.cov-nir-array-access
 dEQP-VK.graphicsfuzz.cov-nir-opt-large-constants-for-clamp-vector-access
 dEQP-VK.graphicsfuzz.cov-nir-opt-loop-unroll-if-if-if-if-do-while
+dEQP-VK.graphicsfuzz.cov-one-minus-clamp-always-one-cast-to-int
 dEQP-VK.graphicsfuzz.cov-optimize-phis-for
 dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
 dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access
index 13d4215..2b08c42 100644 (file)
@@ -33,6 +33,7 @@ dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
 dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
 dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
 dEQP-VK.graphicsfuzz.cov-array-accesses-clamp
+dEQP-VK.graphicsfuzz.cov-array-copies-loops-with-limiters
 dEQP-VK.graphicsfuzz.cov-asin-undefined-smoothstep
 dEQP-VK.graphicsfuzz.cov-atan-trunc-vec4
 dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
@@ -40,6 +41,7 @@ dEQP-VK.graphicsfuzz.cov-bitcount
 dEQP-VK.graphicsfuzz.cov-bitfieldExtract-undefined
 dEQP-VK.graphicsfuzz.cov-bitfieldinsert-undefined
 dEQP-VK.graphicsfuzz.cov-bitfieldreverse-left-shift-findmsb
+dEQP-VK.graphicsfuzz.cov-bitfieldreverse-loop-limit-underflow
 dEQP-VK.graphicsfuzz.cov-bitwise-inverse-uniform-condition
 dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
 dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
@@ -50,6 +52,7 @@ dEQP-VK.graphicsfuzz.cov-clamp-vector-element-ceil-negative
 dEQP-VK.graphicsfuzz.cov-clamp-vector-variable-negative-offset
 dEQP-VK.graphicsfuzz.cov-clear-yz-inside-condition
 dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
+dEQP-VK.graphicsfuzz.cov-condition-loop-index-bitwise-not
 dEQP-VK.graphicsfuzz.cov-conditional-discard-inside-loop
 dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
 dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
@@ -89,6 +92,7 @@ dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
 dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
 dEQP-VK.graphicsfuzz.cov-dead-code-unreachable-merge
 dEQP-VK.graphicsfuzz.cov-derivative-uniform-vector-global-loop-count
+dEQP-VK.graphicsfuzz.cov-descending-loop-min-max-always-zero
 dEQP-VK.graphicsfuzz.cov-double-if-true-in-loop
 dEQP-VK.graphicsfuzz.cov-exp2-two
 dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
@@ -131,8 +135,10 @@ dEQP-VK.graphicsfuzz.cov-fract-smoothstep-undefined
 dEQP-VK.graphicsfuzz.cov-fragcoord-clamp-array-access
 dEQP-VK.graphicsfuzz.cov-fragcoord-multiply
 dEQP-VK.graphicsfuzz.cov-function-vec2-never-discard
+dEQP-VK.graphicsfuzz.cov-global-loop-bound-true-logical-or
 dEQP-VK.graphicsfuzz.cov-global-loop-counter-float-accumulate-matrix
 dEQP-VK.graphicsfuzz.cov-global-loop-counter-main-function-call
+dEQP-VK.graphicsfuzz.cov-global-loop-counter-multiply-one-minus
 dEQP-VK.graphicsfuzz.cov-if-conversion-identical-branches
 dEQP-VK.graphicsfuzz.cov-if-switch-fallthrough
 dEQP-VK.graphicsfuzz.cov-if-true-continue
@@ -201,8 +207,11 @@ dEQP-VK.graphicsfuzz.cov-left-shift-right-shift-compare
 dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
 dEQP-VK.graphicsfuzz.cov-loop-abs-multiply-offset
 dEQP-VK.graphicsfuzz.cov-loop-clamp-to-one-empty-condition
+dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
 dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
+dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
 dEQP-VK.graphicsfuzz.cov-loop-increment-or-divide-by-loop-index
+dEQP-VK.graphicsfuzz.cov-loop-logical-xor
 dEQP-VK.graphicsfuzz.cov-loop-returns-behind-true-and-false
 dEQP-VK.graphicsfuzz.cov-loop-with-two-integers
 dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
@@ -223,10 +232,13 @@ dEQP-VK.graphicsfuzz.cov-mod-uint-bits-float
 dEQP-VK.graphicsfuzz.cov-modf-clamp-for
 dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
 dEQP-VK.graphicsfuzz.cov-multiple-one-iteration-loops-global-counter-write-matrices
+dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
+dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
 dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-do-while-accumulate-float
 dEQP-VK.graphicsfuzz.cov-nir-array-access
 dEQP-VK.graphicsfuzz.cov-nir-opt-large-constants-for-clamp-vector-access
 dEQP-VK.graphicsfuzz.cov-nir-opt-loop-unroll-if-if-if-if-do-while
+dEQP-VK.graphicsfuzz.cov-one-minus-clamp-always-one-cast-to-int
 dEQP-VK.graphicsfuzz.cov-optimize-phis-for
 dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
 dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-array-copies-loops-with-limiters.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-array-copies-loops-with-limiters.amber
new file mode 100644 (file)
index 0000000..0e6ddc2
--- /dev/null
@@ -0,0 +1,569 @@
+#!amber
+
+# Copyright 2021 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 NIR 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_8 _GLF_uniform_int_values[0]
+# #define _int_10 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _int_0 _GLF_uniform_int_values[3]
+# #define _int_2 _GLF_uniform_int_values[4]
+# #define _int_3 _GLF_uniform_int_values[5]
+# #define _int_4 _GLF_uniform_int_values[6]
+# #define _int_5 _GLF_uniform_int_values[7]
+# #define _int_6 _GLF_uniform_int_values[8]
+# #define _int_7 _GLF_uniform_int_values[9]
+# #define _int_9 _GLF_uniform_int_values[10]
+# #define _int_17 _GLF_uniform_int_values[11]
+# #define _int_11 _GLF_uniform_int_values[12]
+# #define _int_15 _GLF_uniform_int_values[13]
+# #define _int_16 _GLF_uniform_int_values[14]
+# #define _int_12 _GLF_uniform_int_values[15]
+# #define _int_13 _GLF_uniform_int_values[16]
+# #define _int_14 _GLF_uniform_int_values[17]
+# #define _int_18 _GLF_uniform_int_values[18]
+# #define _int_19 _GLF_uniform_int_values[19]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [8, 10, 1, 0, 2, 3, 4, 5, 6, 7, 9, 17, 11, 15, 16, 12, 13, 14, 18, 19]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[20];
+# };
+#
+# // Contents of one: 1
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int one;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int arr0[10] = int[10](_int_0, _int_1, _int_2, _int_3, _int_4, _int_5, _int_6, _int_7, _int_8, _int_9);
+#     int arr1[10] = int[10](_int_10, _int_11, _int_12, _int_13, _int_14, _int_15, _int_16, _int_17, _int_18, _int_19);
+#
+#     for(int a = _int_6; a < _int_8; a++)
+#     {
+#         int limiter0 = _int_0;
+#         while(limiter0 < _int_2)
+#         {
+#             limiter0++;
+#
+#             int limiter1 = _int_1;
+#             // Iterated for b = 0..3.
+#             for(int b = _int_0; b < _int_10; b ++)
+#             {
+#                 if(limiter1 > _int_3)
+#                 {
+#                     break;
+#                 }
+#                 limiter1++;
+#                 arr0[b] = arr1[a];
+#             }
+#         }
+#
+#         int limiter2 = 0;
+#         // Does the same assignment five times.
+#         while(limiter2 < 5)
+#         {
+#             limiter2++;
+#             arr0[1] = arr1[1];
+#         }
+#
+#         // Iterated once.
+#         do
+#         {
+#             int limiter3 = 0;
+#             // Iterated for d = 0..4.
+#             for(int d = 0; d < 10; d ++)
+#             {
+#                 if(limiter3 > 4)
+#                 {
+#                     break;
+#                 }
+#                 limiter3 ++;
+#                 arr1[d] = arr0[d];
+#             }
+#         }
+#         while(_int_1 == _int_0);
+#     }
+#
+#     // Reference values.
+#     int ref0[10] = int[10](_int_17, _int_11, _int_17, _int_3, _int_4, _int_5, _int_6, _int_7, _int_8, _int_9);
+#     int ref1[10] = int[10](_int_17, _int_11, _int_17, _int_3, _int_4, _int_15, _int_16, _int_17, _int_18, _int_19);
+#
+#     // Return red if no error is detected.
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+#     for(int i = _int_0; i < _int_10; i ++)
+#     {
+#         // Unexpected value. Change the color to black.
+#         if(arr0[i] != ref0[i] || arr1[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: 289
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %234
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %11 "arr0"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %49 "arr1"
+               OpName %82 "a"
+               OpName %95 "limiter0"
+               OpName %109 "limiter1"
+               OpName %112 "b"
+               OpName %140 "limiter2"
+               OpName %157 "limiter3"
+               OpName %158 "d"
+               OpName %187 "ref0"
+               OpName %209 "ref1"
+               OpName %234 "_GLF_color"
+               OpName %248 "i"
+               OpName %286 "buf1"
+               OpMemberName %286 0 "one"
+               OpName %288 ""
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %234 Location 0
+               OpMemberDecorate %286 0 Offset 0
+               OpDecorate %286 Block
+               OpDecorate %288 DescriptorSet 0
+               OpDecorate %288 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 10
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypePointer Function %9
+         %12 = OpConstant %7 20
+         %13 = OpTypeArray %6 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %6 0
+         %18 = OpConstant %6 3
+         %19 = OpTypePointer Uniform %6
+         %22 = OpConstant %6 2
+         %25 = OpConstant %6 4
+         %28 = OpConstant %6 5
+         %31 = OpConstant %6 6
+         %34 = OpConstant %6 7
+         %37 = OpConstant %6 8
+         %40 = OpConstant %6 9
+         %45 = OpConstant %6 10
+         %50 = OpConstant %6 1
+         %53 = OpConstant %6 12
+         %56 = OpConstant %6 15
+         %59 = OpConstant %6 16
+         %62 = OpConstant %6 17
+         %65 = OpConstant %6 13
+         %68 = OpConstant %6 14
+         %71 = OpConstant %6 11
+         %74 = OpConstant %6 18
+         %77 = OpConstant %6 19
+         %81 = OpTypePointer Function %6
+         %93 = OpTypeBool
+        %231 = OpTypeFloat 32
+        %232 = OpTypeVector %231 4
+        %233 = OpTypePointer Output %232
+        %234 = OpVariable %233 Output
+        %286 = OpTypeStruct %6
+        %287 = OpTypePointer Uniform %286
+        %288 = OpVariable %287 Uniform
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %49 = OpVariable %10 Function
+         %82 = OpVariable %81 Function
+         %95 = OpVariable %81 Function
+        %109 = OpVariable %81 Function
+        %112 = OpVariable %81 Function
+        %140 = OpVariable %81 Function
+        %157 = OpVariable %81 Function
+        %158 = OpVariable %81 Function
+        %187 = OpVariable %10 Function
+        %209 = OpVariable %10 Function
+        %248 = OpVariable %81 Function
+         %20 = OpAccessChain %19 %16 %17 %18
+         %21 = OpLoad %6 %20
+         %23 = OpAccessChain %19 %16 %17 %22
+         %24 = OpLoad %6 %23
+         %26 = OpAccessChain %19 %16 %17 %25
+         %27 = OpLoad %6 %26
+         %29 = OpAccessChain %19 %16 %17 %28
+         %30 = OpLoad %6 %29
+         %32 = OpAccessChain %19 %16 %17 %31
+         %33 = OpLoad %6 %32
+         %35 = OpAccessChain %19 %16 %17 %34
+         %36 = OpLoad %6 %35
+         %38 = OpAccessChain %19 %16 %17 %37
+         %39 = OpLoad %6 %38
+         %41 = OpAccessChain %19 %16 %17 %40
+         %42 = OpLoad %6 %41
+         %43 = OpAccessChain %19 %16 %17 %17
+         %44 = OpLoad %6 %43
+         %46 = OpAccessChain %19 %16 %17 %45
+         %47 = OpLoad %6 %46
+         %48 = OpCompositeConstruct %9 %21 %24 %27 %30 %33 %36 %39 %42 %44 %47
+               OpStore %11 %48
+         %51 = OpAccessChain %19 %16 %17 %50
+         %52 = OpLoad %6 %51
+         %54 = OpAccessChain %19 %16 %17 %53
+         %55 = OpLoad %6 %54
+         %57 = OpAccessChain %19 %16 %17 %56
+         %58 = OpLoad %6 %57
+         %60 = OpAccessChain %19 %16 %17 %59
+         %61 = OpLoad %6 %60
+         %63 = OpAccessChain %19 %16 %17 %62
+         %64 = OpLoad %6 %63
+         %66 = OpAccessChain %19 %16 %17 %65
+         %67 = OpLoad %6 %66
+         %69 = OpAccessChain %19 %16 %17 %68
+         %70 = OpLoad %6 %69
+         %72 = OpAccessChain %19 %16 %17 %71
+         %73 = OpLoad %6 %72
+         %75 = OpAccessChain %19 %16 %17 %74
+         %76 = OpLoad %6 %75
+         %78 = OpAccessChain %19 %16 %17 %77
+         %79 = OpLoad %6 %78
+         %80 = OpCompositeConstruct %9 %52 %55 %58 %61 %64 %67 %70 %73 %76 %79
+               OpStore %49 %80
+         %83 = OpAccessChain %19 %16 %17 %37
+         %84 = OpLoad %6 %83
+               OpStore %82 %84
+               OpBranch %85
+         %85 = OpLabel
+               OpLoopMerge %87 %88 None
+               OpBranch %89
+         %89 = OpLabel
+         %90 = OpLoad %6 %82
+         %91 = OpAccessChain %19 %16 %17 %17
+         %92 = OpLoad %6 %91
+         %94 = OpSLessThan %93 %90 %92
+               OpBranchConditional %94 %86 %87
+         %86 = OpLabel
+         %96 = OpAccessChain %19 %16 %17 %18
+         %97 = OpLoad %6 %96
+               OpStore %95 %97
+               OpBranch %98
+         %98 = OpLabel
+               OpLoopMerge %100 %101 None
+               OpBranch %102
+        %102 = OpLabel
+        %103 = OpLoad %6 %95
+        %104 = OpAccessChain %19 %16 %17 %25
+        %105 = OpLoad %6 %104
+        %106 = OpSLessThan %93 %103 %105
+               OpBranchConditional %106 %99 %100
+         %99 = OpLabel
+        %107 = OpLoad %6 %95
+        %108 = OpIAdd %6 %107 %50
+               OpStore %95 %108
+        %110 = OpAccessChain %19 %16 %17 %22
+        %111 = OpLoad %6 %110
+               OpStore %109 %111
+        %113 = OpAccessChain %19 %16 %17 %18
+        %114 = OpLoad %6 %113
+               OpStore %112 %114
+               OpBranch %115
+        %115 = OpLabel
+               OpLoopMerge %117 %118 None
+               OpBranch %119
+        %119 = OpLabel
+        %120 = OpLoad %6 %112
+        %121 = OpAccessChain %19 %16 %17 %50
+        %122 = OpLoad %6 %121
+        %123 = OpSLessThan %93 %120 %122
+               OpBranchConditional %123 %116 %117
+        %116 = OpLabel
+        %124 = OpLoad %6 %109
+        %125 = OpAccessChain %19 %16 %17 %28
+        %126 = OpLoad %6 %125
+        %127 = OpSGreaterThan %93 %124 %126
+               OpSelectionMerge %129 None
+               OpBranchConditional %127 %128 %129
+        %128 = OpLabel
+               OpBranch %117
+        %129 = OpLabel
+        %131 = OpLoad %6 %109
+        %132 = OpIAdd %6 %131 %50
+               OpStore %109 %132
+        %133 = OpLoad %6 %112
+        %134 = OpLoad %6 %82
+        %135 = OpAccessChain %81 %49 %134
+        %136 = OpLoad %6 %135
+        %137 = OpAccessChain %81 %11 %133
+               OpStore %137 %136
+               OpBranch %118
+        %118 = OpLabel
+        %138 = OpLoad %6 %112
+        %139 = OpIAdd %6 %138 %50
+               OpStore %112 %139
+               OpBranch %115
+        %117 = OpLabel
+               OpBranch %101
+        %101 = OpLabel
+               OpBranch %98
+        %100 = OpLabel
+               OpStore %140 %17
+               OpBranch %141
+        %141 = OpLabel
+               OpLoopMerge %143 %144 None
+               OpBranch %145
+        %145 = OpLabel
+        %146 = OpLoad %6 %140
+        %147 = OpSLessThan %93 %146 %28
+               OpBranchConditional %147 %142 %143
+        %142 = OpLabel
+        %148 = OpLoad %6 %140
+        %149 = OpIAdd %6 %148 %50
+               OpStore %140 %149
+        %150 = OpAccessChain %81 %49 %50
+        %151 = OpLoad %6 %150
+        %152 = OpAccessChain %81 %11 %50
+               OpStore %152 %151
+               OpBranch %144
+        %144 = OpLabel
+               OpBranch %141
+        %143 = OpLabel
+               OpBranch %153
+        %153 = OpLabel
+               OpLoopMerge %155 %156 None
+               OpBranch %154
+        %154 = OpLabel
+               OpStore %157 %17
+               OpStore %158 %17
+               OpBranch %159
+        %159 = OpLabel
+               OpLoopMerge %161 %162 None
+               OpBranch %163
+        %163 = OpLabel
+        %164 = OpLoad %6 %158
+        %165 = OpSLessThan %93 %164 %45
+               OpBranchConditional %165 %160 %161
+        %160 = OpLabel
+        %166 = OpLoad %6 %157
+        %167 = OpSGreaterThan %93 %166 %25
+               OpSelectionMerge %169 None
+               OpBranchConditional %167 %168 %169
+        %168 = OpLabel
+               OpBranch %161
+        %169 = OpLabel
+        %171 = OpLoad %6 %157
+        %172 = OpIAdd %6 %171 %50
+               OpStore %157 %172
+        %173 = OpLoad %6 %158
+        %174 = OpLoad %6 %158
+        %175 = OpAccessChain %81 %11 %174
+        %176 = OpLoad %6 %175
+        %177 = OpAccessChain %81 %49 %173
+               OpStore %177 %176
+               OpBranch %162
+        %162 = OpLabel
+        %178 = OpLoad %6 %158
+        %179 = OpIAdd %6 %178 %50
+               OpStore %158 %179
+               OpBranch %159
+        %161 = OpLabel
+               OpBranch %156
+        %156 = OpLabel
+        %180 = OpAccessChain %19 %16 %17 %22
+        %181 = OpLoad %6 %180
+        %182 = OpAccessChain %19 %16 %17 %18
+        %183 = OpLoad %6 %182
+        %184 = OpIEqual %93 %181 %183
+               OpBranchConditional %184 %153 %155
+        %155 = OpLabel
+               OpBranch %88
+         %88 = OpLabel
+        %185 = OpLoad %6 %82
+        %186 = OpIAdd %6 %185 %50
+               OpStore %82 %186
+               OpBranch %85
+         %87 = OpLabel
+        %188 = OpAccessChain %19 %16 %17 %71
+        %189 = OpLoad %6 %188
+        %190 = OpAccessChain %19 %16 %17 %53
+        %191 = OpLoad %6 %190
+        %192 = OpAccessChain %19 %16 %17 %71
+        %193 = OpLoad %6 %192
+        %194 = OpAccessChain %19 %16 %17 %28
+        %195 = OpLoad %6 %194
+        %196 = OpAccessChain %19 %16 %17 %31
+        %197 = OpLoad %6 %196
+        %198 = OpAccessChain %19 %16 %17 %34
+        %199 = OpLoad %6 %198
+        %200 = OpAccessChain %19 %16 %17 %37
+        %201 = OpLoad %6 %200
+        %202 = OpAccessChain %19 %16 %17 %40
+        %203 = OpLoad %6 %202
+        %204 = OpAccessChain %19 %16 %17 %17
+        %205 = OpLoad %6 %204
+        %206 = OpAccessChain %19 %16 %17 %45
+        %207 = OpLoad %6 %206
+        %208 = OpCompositeConstruct %9 %189 %191 %193 %195 %197 %199 %201 %203 %205 %207
+               OpStore %187 %208
+        %210 = OpAccessChain %19 %16 %17 %71
+        %211 = OpLoad %6 %210
+        %212 = OpAccessChain %19 %16 %17 %53
+        %213 = OpLoad %6 %212
+        %214 = OpAccessChain %19 %16 %17 %71
+        %215 = OpLoad %6 %214
+        %216 = OpAccessChain %19 %16 %17 %28
+        %217 = OpLoad %6 %216
+        %218 = OpAccessChain %19 %16 %17 %31
+        %219 = OpLoad %6 %218
+        %220 = OpAccessChain %19 %16 %17 %65
+        %221 = OpLoad %6 %220
+        %222 = OpAccessChain %19 %16 %17 %68
+        %223 = OpLoad %6 %222
+        %224 = OpAccessChain %19 %16 %17 %71
+        %225 = OpLoad %6 %224
+        %226 = OpAccessChain %19 %16 %17 %74
+        %227 = OpLoad %6 %226
+        %228 = OpAccessChain %19 %16 %17 %77
+        %229 = OpLoad %6 %228
+        %230 = OpCompositeConstruct %9 %211 %213 %215 %217 %219 %221 %223 %225 %227 %229
+               OpStore %209 %230
+        %235 = OpAccessChain %19 %16 %17 %22
+        %236 = OpLoad %6 %235
+        %237 = OpConvertSToF %231 %236
+        %238 = OpAccessChain %19 %16 %17 %18
+        %239 = OpLoad %6 %238
+        %240 = OpConvertSToF %231 %239
+        %241 = OpAccessChain %19 %16 %17 %18
+        %242 = OpLoad %6 %241
+        %243 = OpConvertSToF %231 %242
+        %244 = OpAccessChain %19 %16 %17 %22
+        %245 = OpLoad %6 %244
+        %246 = OpConvertSToF %231 %245
+        %247 = OpCompositeConstruct %232 %237 %240 %243 %246
+               OpStore %234 %247
+        %249 = OpAccessChain %19 %16 %17 %18
+        %250 = OpLoad %6 %249
+               OpStore %248 %250
+               OpBranch %251
+        %251 = OpLabel
+               OpLoopMerge %253 %254 None
+               OpBranch %255
+        %255 = OpLabel
+        %256 = OpLoad %6 %248
+        %257 = OpAccessChain %19 %16 %17 %50
+        %258 = OpLoad %6 %257
+        %259 = OpSLessThan %93 %256 %258
+               OpBranchConditional %259 %252 %253
+        %252 = OpLabel
+        %260 = OpLoad %6 %248
+        %261 = OpAccessChain %81 %11 %260
+        %262 = OpLoad %6 %261
+        %263 = OpLoad %6 %248
+        %264 = OpAccessChain %81 %187 %263
+        %265 = OpLoad %6 %264
+        %266 = OpINotEqual %93 %262 %265
+        %267 = OpLogicalNot %93 %266
+               OpSelectionMerge %269 None
+               OpBranchConditional %267 %268 %269
+        %268 = OpLabel
+        %270 = OpLoad %6 %248
+        %271 = OpAccessChain %81 %49 %270
+        %272 = OpLoad %6 %271
+        %273 = OpLoad %6 %248
+        %274 = OpAccessChain %81 %209 %273
+        %275 = OpLoad %6 %274
+        %276 = OpINotEqual %93 %272 %275
+               OpBranch %269
+        %269 = OpLabel
+        %277 = OpPhi %93 %266 %252 %276 %268
+               OpSelectionMerge %279 None
+               OpBranchConditional %277 %278 %279
+        %278 = OpLabel
+        %280 = OpAccessChain %19 %16 %17 %18
+        %281 = OpLoad %6 %280
+        %282 = OpConvertSToF %231 %281
+        %283 = OpCompositeConstruct %232 %282 %282 %282 %282
+               OpStore %234 %283
+               OpBranch %279
+        %279 = OpLabel
+               OpBranch %254
+        %254 = OpLabel
+        %284 = OpLoad %6 %248
+        %285 = OpIAdd %6 %284 %50
+               OpStore %248 %285
+               OpBranch %251
+        %253 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# one
+BUFFER variant_one DATA_TYPE int32 STD140 DATA
+ 1
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 8 10 1 0 2 3 4 5 6 7 9 17 11 15 16 12 13 14 18 19
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant_one AS uniform DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow.amber
new file mode 100644 (file)
index 0000000..d3d50d3
--- /dev/null
@@ -0,0 +1,199 @@
+#!amber
+
+# Copyright 2021 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 NIR code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '-O'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_6 _GLF_uniform_int_values[2]
+# #define _int_5 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 6, 5]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     // a becomes 0x8000000 which is the smallest possible negative integer.
+#     int a = min(1, bitfieldReverse(1));
+#     int b = _int_5;
+#
+#     // a - 1 underflowa to the largest positive integer. The loop is executed
+#     // once because of the break inside.
+#     for (int i = 1; i <= a - 1; i++)
+#     {
+#         b += i;
+#
+#         // Always true.
+#         if (_int_1 == 1)
+#         {
+#             break;
+#         }
+#     }
+#
+#     // Always true.
+#     if (b == _int_6)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 78
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %56
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %16 "buf0"
+               OpMemberName %16 0 "_GLF_uniform_int_values"
+               OpName %18 ""
+               OpName %56 "_GLF_color"
+               OpDecorate %15 ArrayStride 16
+               OpMemberDecorate %16 0 Offset 0
+               OpDecorate %16 Block
+               OpDecorate %18 DescriptorSet 0
+               OpDecorate %18 Binding 0
+               OpDecorate %56 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %9 = OpConstant %6 1
+         %13 = OpTypeInt 32 0
+         %14 = OpConstant %13 4
+         %15 = OpTypeArray %6 %14
+         %16 = OpTypeStruct %15
+         %17 = OpTypePointer Uniform %16
+         %18 = OpVariable %17 Uniform
+         %19 = OpConstant %6 0
+         %20 = OpConstant %6 3
+         %21 = OpTypePointer Uniform %6
+         %33 = OpTypeBool
+         %47 = OpConstant %6 2
+         %53 = OpTypeFloat 32
+         %54 = OpTypeVector %53 4
+         %55 = OpTypePointer Output %54
+         %56 = OpVariable %55 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %10 = OpBitReverse %6 %9
+         %11 = OpExtInst %6 %1 SMin %9 %10
+         %22 = OpAccessChain %21 %18 %19 %20
+         %23 = OpLoad %6 %22
+               OpBranch %25
+         %25 = OpLabel
+         %76 = OpPhi %6 %23 %5 %37 %28
+         %75 = OpPhi %6 %9 %5 %45 %28
+         %32 = OpISub %6 %11 %9
+         %34 = OpSLessThanEqual %33 %75 %32
+               OpLoopMerge %27 %28 None
+               OpBranchConditional %34 %26 %27
+         %26 = OpLabel
+         %37 = OpIAdd %6 %76 %75
+         %38 = OpAccessChain %21 %18 %19 %19
+         %39 = OpLoad %6 %38
+         %40 = OpIEqual %33 %39 %9
+               OpSelectionMerge %42 None
+               OpBranchConditional %40 %41 %42
+         %41 = OpLabel
+               OpBranch %27
+         %42 = OpLabel
+               OpBranch %28
+         %28 = OpLabel
+         %45 = OpIAdd %6 %75 %9
+               OpBranch %25
+         %27 = OpLabel
+         %77 = OpPhi %6 %76 %25 %37 %41
+         %48 = OpAccessChain %21 %18 %19 %47
+         %49 = OpLoad %6 %48
+         %50 = OpIEqual %33 %77 %49
+               OpSelectionMerge %52 None
+               OpBranchConditional %50 %51 %70
+         %51 = OpLabel
+         %57 = OpAccessChain %21 %18 %19 %19
+         %58 = OpLoad %6 %57
+         %59 = OpConvertSToF %53 %58
+         %60 = OpAccessChain %21 %18 %19 %9
+         %61 = OpLoad %6 %60
+         %62 = OpConvertSToF %53 %61
+         %69 = OpCompositeConstruct %54 %59 %62 %62 %59
+               OpStore %56 %69
+               OpBranch %52
+         %70 = OpLabel
+         %71 = OpAccessChain %21 %18 %19 %9
+         %72 = OpLoad %6 %71
+         %73 = OpConvertSToF %53 %72
+         %74 = OpCompositeConstruct %54 %73 %73 %73 %73
+               OpStore %56 %74
+               OpBranch %52
+         %52 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 6 5
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-condition-loop-index-bitwise-not.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-condition-loop-index-bitwise-not.amber
new file mode 100644 (file)
index 0000000..f097cf1
--- /dev/null
@@ -0,0 +1,204 @@
+#!amber
+
+# Copyright 2021 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 BRW 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_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_50 _GLF_uniform_int_values[2]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 50]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = _int_0;
+#
+#     for(int i = _int_0; i < _int_50; i++)
+#     {
+#         // Always true.
+#         if ((~i) != 0)
+#         {
+#             a++;
+#         }
+#     }
+#
+#     // Always true.
+#     if(a == _int_50)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 71
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %52
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %20 "i"
+               OpName %52 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %52 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 3
+         %11 = OpTypeArray %6 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpConstant %6 0
+         %16 = OpConstant %6 1
+         %17 = OpTypePointer Uniform %6
+         %29 = OpConstant %6 2
+         %32 = OpTypeBool
+         %49 = OpTypeFloat 32
+         %50 = OpTypeVector %49 4
+         %51 = OpTypePointer Output %50
+         %52 = OpVariable %51 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %20 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %14 %15 %16
+         %19 = OpLoad %6 %18
+               OpStore %8 %19
+         %21 = OpAccessChain %17 %14 %15 %16
+         %22 = OpLoad %6 %21
+               OpStore %20 %22
+               OpBranch %23
+         %23 = OpLabel
+               OpLoopMerge %25 %26 None
+               OpBranch %27
+         %27 = OpLabel
+         %28 = OpLoad %6 %20
+         %30 = OpAccessChain %17 %14 %15 %29
+         %31 = OpLoad %6 %30
+         %33 = OpSLessThan %32 %28 %31
+               OpBranchConditional %33 %24 %25
+         %24 = OpLabel
+         %34 = OpLoad %6 %20
+         %35 = OpNot %6 %34
+         %36 = OpINotEqual %32 %35 %15
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %37 %38
+         %37 = OpLabel
+         %39 = OpLoad %6 %8
+         %40 = OpIAdd %6 %39 %16
+               OpStore %8 %40
+               OpBranch %38
+         %38 = OpLabel
+               OpBranch %26
+         %26 = OpLabel
+         %41 = OpLoad %6 %20
+         %42 = OpIAdd %6 %41 %16
+               OpStore %20 %42
+               OpBranch %23
+         %25 = OpLabel
+         %43 = OpLoad %6 %8
+         %44 = OpAccessChain %17 %14 %15 %29
+         %45 = OpLoad %6 %44
+         %46 = OpIEqual %32 %43 %45
+               OpSelectionMerge %48 None
+               OpBranchConditional %46 %47 %66
+         %47 = OpLabel
+         %53 = OpAccessChain %17 %14 %15 %15
+         %54 = OpLoad %6 %53
+         %55 = OpConvertSToF %49 %54
+         %56 = OpAccessChain %17 %14 %15 %16
+         %57 = OpLoad %6 %56
+         %58 = OpConvertSToF %49 %57
+         %59 = OpAccessChain %17 %14 %15 %16
+         %60 = OpLoad %6 %59
+         %61 = OpConvertSToF %49 %60
+         %62 = OpAccessChain %17 %14 %15 %15
+         %63 = OpLoad %6 %62
+         %64 = OpConvertSToF %49 %63
+         %65 = OpCompositeConstruct %50 %55 %58 %61 %64
+               OpStore %52 %65
+               OpBranch %48
+         %66 = OpLabel
+         %67 = OpAccessChain %17 %14 %15 %16
+         %68 = OpLoad %6 %67
+         %69 = OpConvertSToF %49 %68
+         %70 = OpCompositeConstruct %50 %69 %69 %69 %69
+               OpStore %52 %70
+               OpBranch %48
+         %48 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 50
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-descending-loop-min-max-always-zero.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-descending-loop-min-max-always-zero.amber
new file mode 100644 (file)
index 0000000..28616fc
--- /dev/null
@@ -0,0 +1,224 @@
+#!amber
+
+# Copyright 2021 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 BRW 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_0 _GLF_uniform_int_values[0]
+# #define _int_10 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 10, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float f = _float_1_0;
+#
+#     for (int i = _int_10; i > _int_0; i--)
+#     {
+#         float a = 1.0 - max(1.0, float(i));
+#         // Always sets f to zero.
+#         f = min(max(a, 0.0), 0.0);
+#     }
+#
+#     // Always true.
+#     if(f == _float_0_0)
+#     {
+#         _GLF_color = vec4(_int_1, f, _int_0, 1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(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: 73
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %61
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %8 "f"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_float_values"
+               OpName %14 ""
+               OpName %22 "i"
+               OpName %25 "buf1"
+               OpMemberName %25 0 "_GLF_uniform_int_values"
+               OpName %27 ""
+               OpName %41 "a"
+               OpName %61 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %24 ArrayStride 16
+               OpMemberDecorate %25 0 Offset 0
+               OpDecorate %25 Block
+               OpDecorate %27 DescriptorSet 0
+               OpDecorate %27 Binding 1
+               OpDecorate %61 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 2
+         %11 = OpTypeArray %6 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpTypeInt 32 1
+         %16 = OpConstant %15 0
+         %17 = OpConstant %15 1
+         %18 = OpTypePointer Uniform %6
+         %21 = OpTypePointer Function %15
+         %23 = OpConstant %9 3
+         %24 = OpTypeArray %15 %23
+         %25 = OpTypeStruct %24
+         %26 = OpTypePointer Uniform %25
+         %27 = OpVariable %26 Uniform
+         %28 = OpTypePointer Uniform %15
+         %39 = OpTypeBool
+         %42 = OpConstant %6 1
+         %48 = OpConstant %6 0
+         %59 = OpTypeVector %6 4
+         %60 = OpTypePointer Output %59
+         %61 = OpVariable %60 Output
+         %62 = OpConstant %15 2
+         %72 = OpConstantComposite %59 %48 %48 %48 %48
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %22 = OpVariable %21 Function
+         %41 = OpVariable %7 Function
+         %19 = OpAccessChain %18 %14 %16 %17
+         %20 = OpLoad %6 %19
+               OpStore %8 %20
+         %29 = OpAccessChain %28 %27 %16 %17
+         %30 = OpLoad %15 %29
+               OpStore %22 %30
+               OpBranch %31
+         %31 = OpLabel
+               OpLoopMerge %33 %34 None
+               OpBranch %35
+         %35 = OpLabel
+         %36 = OpLoad %15 %22
+         %37 = OpAccessChain %28 %27 %16 %16
+         %38 = OpLoad %15 %37
+         %40 = OpSGreaterThan %39 %36 %38
+               OpBranchConditional %40 %32 %33
+         %32 = OpLabel
+         %43 = OpLoad %15 %22
+         %44 = OpConvertSToF %6 %43
+         %45 = OpExtInst %6 %1 FMax %42 %44
+         %46 = OpFSub %6 %42 %45
+               OpStore %41 %46
+         %47 = OpLoad %6 %41
+         %49 = OpExtInst %6 %1 FMax %47 %48
+         %50 = OpExtInst %6 %1 FMin %49 %48
+               OpStore %8 %50
+               OpBranch %34
+         %34 = OpLabel
+         %51 = OpLoad %15 %22
+         %52 = OpISub %15 %51 %17
+               OpStore %22 %52
+               OpBranch %31
+         %33 = OpLabel
+         %53 = OpLoad %6 %8
+         %54 = OpAccessChain %18 %14 %16 %16
+         %55 = OpLoad %6 %54
+         %56 = OpFOrdEqual %39 %53 %55
+               OpSelectionMerge %58 None
+               OpBranchConditional %56 %57 %71
+         %57 = OpLabel
+         %63 = OpAccessChain %28 %27 %16 %62
+         %64 = OpLoad %15 %63
+         %65 = OpConvertSToF %6 %64
+         %66 = OpLoad %6 %8
+         %67 = OpAccessChain %28 %27 %16 %16
+         %68 = OpLoad %15 %67
+         %69 = OpConvertSToF %6 %68
+         %70 = OpCompositeConstruct %59 %65 %66 %69 %42
+               OpStore %61 %70
+               OpBranch %58
+         %71 = OpLabel
+               OpStore %61 %72
+               OpBranch %58
+         %58 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 10 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-global-loop-bound-true-logical-or.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-global-loop-bound-true-logical-or.amber
new file mode 100644 (file)
index 0000000..9685311
--- /dev/null
@@ -0,0 +1,213 @@
+#!amber
+
+# Copyright 2021 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 NIR 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_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# const int _GLF_global_loop_bound = 100;
+# int _GLF_global_loop_count = 0;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+#     while (_GLF_global_loop_count < _GLF_global_loop_bound)
+#     {
+#         _GLF_global_loop_count++;
+#
+#         // Always false.
+#         if (!(true || _int_0 == _int_1))
+#         {
+#             break;
+#         }
+#     }
+#
+#     // This loop will not be iterated since the loop bound
+#     // has already been reached with the previous loop.
+#     while (_GLF_global_loop_count < _GLF_global_loop_bound)
+#     {
+#         _GLF_global_loop_count++;
+#         _GLF_color = vec4(_int_0);
+#     }
+#
+#     // The output color still remains red beacuse the loop above
+#     // was not executed.
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 73
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %13
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %8 "_GLF_global_loop_count"
+               OpName %13 "_GLF_color"
+               OpName %17 "buf0"
+               OpMemberName %17 0 "_GLF_uniform_int_values"
+               OpName %19 ""
+               OpDecorate %13 Location 0
+               OpDecorate %16 ArrayStride 16
+               OpMemberDecorate %17 0 Offset 0
+               OpDecorate %17 Block
+               OpDecorate %19 DescriptorSet 0
+               OpDecorate %19 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Private %6
+          %8 = OpVariable %7 Private
+          %9 = OpConstant %6 0
+         %10 = OpTypeFloat 32
+         %11 = OpTypeVector %10 4
+         %12 = OpTypePointer Output %11
+         %13 = OpVariable %12 Output
+         %14 = OpTypeInt 32 0
+         %15 = OpConstant %14 2
+         %16 = OpTypeArray %6 %15
+         %17 = OpTypeStruct %16
+         %18 = OpTypePointer Uniform %17
+         %19 = OpVariable %18 Uniform
+         %20 = OpConstant %6 1
+         %21 = OpTypePointer Uniform %6
+         %41 = OpConstant %6 100
+         %42 = OpTypeBool
+         %46 = OpConstantTrue %42
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+               OpStore %8 %9
+         %22 = OpAccessChain %21 %19 %9 %20
+         %23 = OpLoad %6 %22
+         %24 = OpConvertSToF %10 %23
+         %25 = OpAccessChain %21 %19 %9 %9
+         %26 = OpLoad %6 %25
+         %27 = OpConvertSToF %10 %26
+         %28 = OpAccessChain %21 %19 %9 %9
+         %29 = OpLoad %6 %28
+         %30 = OpConvertSToF %10 %29
+         %31 = OpAccessChain %21 %19 %9 %20
+         %32 = OpLoad %6 %31
+         %33 = OpConvertSToF %10 %32
+         %34 = OpCompositeConstruct %11 %24 %27 %30 %33
+               OpStore %13 %34
+               OpBranch %35
+         %35 = OpLabel
+               OpLoopMerge %37 %38 None
+               OpBranch %39
+         %39 = OpLabel
+         %40 = OpLoad %6 %8
+         %43 = OpSLessThan %42 %40 %41
+               OpBranchConditional %43 %36 %37
+         %36 = OpLabel
+         %44 = OpLoad %6 %8
+         %45 = OpIAdd %6 %44 %20
+               OpStore %8 %45
+         %47 = OpLogicalNot %42 %46
+               OpSelectionMerge %49 None
+               OpBranchConditional %47 %48 %49
+         %48 = OpLabel
+         %50 = OpAccessChain %21 %19 %9 %9
+         %51 = OpLoad %6 %50
+         %52 = OpAccessChain %21 %19 %9 %20
+         %53 = OpLoad %6 %52
+         %54 = OpIEqual %42 %51 %53
+               OpBranch %49
+         %49 = OpLabel
+         %55 = OpPhi %42 %46 %36 %54 %48
+         %56 = OpLogicalNot %42 %55
+               OpSelectionMerge %58 None
+               OpBranchConditional %56 %57 %58
+         %57 = OpLabel
+               OpBranch %37
+         %58 = OpLabel
+               OpBranch %38
+         %38 = OpLabel
+               OpBranch %35
+         %37 = OpLabel
+               OpBranch %60
+         %60 = OpLabel
+               OpLoopMerge %62 %63 None
+               OpBranch %64
+         %64 = OpLabel
+         %65 = OpLoad %6 %8
+         %66 = OpSLessThan %42 %65 %41
+               OpBranchConditional %66 %61 %62
+         %61 = OpLabel
+         %67 = OpLoad %6 %8
+         %68 = OpIAdd %6 %67 %20
+               OpStore %8 %68
+         %69 = OpAccessChain %21 %19 %9 %9
+         %70 = OpLoad %6 %69
+         %71 = OpConvertSToF %10 %70
+         %72 = OpCompositeConstruct %11 %71 %71 %71 %71
+               OpStore %13 %72
+               OpBranch %63
+         %63 = OpLabel
+               OpBranch %60
+         %62 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-global-loop-counter-multiply-one-minus.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-global-loop-counter-multiply-one-minus.amber
new file mode 100644 (file)
index 0000000..41fffe6
--- /dev/null
@@ -0,0 +1,200 @@
+#!amber
+
+# Copyright 2021 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 BRW code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '-O'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# const int _GLF_global_loop_bound = 100;
+# int _GLF_global_loop_count = 0;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = 1;
+#
+#     while (_GLF_global_loop_count < _GLF_global_loop_bound - _int_1)
+#     {
+#         _GLF_global_loop_count++;
+#     }
+#
+#     // Always true.
+#     if (_int_0 == 0)
+#     {
+#         // Iterated once.
+#         while (_GLF_global_loop_count < _GLF_global_loop_bound)
+#         {
+#             _GLF_global_loop_count++;
+#             // a becomes 0.
+#             a *= 1 - a;
+#         }
+#     }
+#
+#     // Always true.
+#     if (a == _int_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 85
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %61
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %23 "buf0"
+               OpMemberName %23 0 "_GLF_uniform_int_values"
+               OpName %25 ""
+               OpName %61 "_GLF_color"
+               OpDecorate %22 ArrayStride 16
+               OpMemberDecorate %23 0 Offset 0
+               OpDecorate %23 Block
+               OpDecorate %25 DescriptorSet 0
+               OpDecorate %25 Binding 0
+               OpDecorate %61 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %9 = OpConstant %6 0
+         %12 = OpConstant %6 1
+         %19 = OpConstant %6 100
+         %20 = OpTypeInt 32 0
+         %21 = OpConstant %20 2
+         %22 = OpTypeArray %6 %21
+         %23 = OpTypeStruct %22
+         %24 = OpTypePointer Uniform %23
+         %25 = OpVariable %24 Uniform
+         %26 = OpTypePointer Uniform %6
+         %30 = OpTypeBool
+         %58 = OpTypeFloat 32
+         %59 = OpTypeVector %58 4
+         %60 = OpTypePointer Output %59
+         %61 = OpVariable %60 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+               OpBranch %13
+         %13 = OpLabel
+         %80 = OpPhi %6 %9 %5 %33 %14
+         %27 = OpAccessChain %26 %25 %9 %12
+         %28 = OpLoad %6 %27
+         %29 = OpISub %6 %19 %28
+         %31 = OpSLessThan %30 %80 %29
+               OpLoopMerge %15 %14 None
+               OpBranchConditional %31 %14 %15
+         %14 = OpLabel
+         %33 = OpIAdd %6 %80 %12
+               OpBranch %13
+         %15 = OpLabel
+         %34 = OpAccessChain %26 %25 %9 %9
+         %35 = OpLoad %6 %34
+         %36 = OpIEqual %30 %35 %9
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %37 %38
+         %37 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
+         %84 = OpPhi %6 %12 %37 %51 %40
+         %81 = OpPhi %6 %80 %37 %47 %40
+         %45 = OpSLessThan %30 %81 %19
+               OpLoopMerge %41 %40 None
+               OpBranchConditional %45 %40 %41
+         %40 = OpLabel
+         %47 = OpIAdd %6 %81 %12
+         %49 = OpISub %6 %12 %84
+         %51 = OpIMul %6 %84 %49
+               OpBranch %39
+         %41 = OpLabel
+               OpBranch %38
+         %38 = OpLabel
+         %82 = OpPhi %6 %12 %15 %84 %41
+         %55 = OpIEqual %30 %82 %35
+               OpSelectionMerge %57 None
+               OpBranchConditional %55 %56 %75
+         %56 = OpLabel
+         %64 = OpConvertSToF %58 %28
+         %67 = OpConvertSToF %58 %35
+         %74 = OpCompositeConstruct %59 %64 %67 %67 %64
+               OpStore %61 %74
+               OpBranch %57
+         %75 = OpLabel
+         %78 = OpConvertSToF %58 %35
+         %79 = OpCompositeConstruct %59 %78 %78 %78 %78
+               OpStore %61 %79
+               OpBranch %57
+         %57 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-condition-double-negate.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-condition-double-negate.amber
new file mode 100644 (file)
index 0000000..c4cf953
--- /dev/null
@@ -0,0 +1,251 @@
+#!amber
+
+# Copyright 2021 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 NIR 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_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_6 _GLF_uniform_int_values[2]
+# #define _int_2 _GLF_uniform_int_values[3]
+# #define _int_5 _GLF_uniform_int_values[4]
+# #define _int_4 _GLF_uniform_int_values[5]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 6, 2, 5, 4]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[6];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int arr[3] = int[3](_int_2, _int_4, _int_6);
+#     int index = 1;
+#
+#     // Iterates once. The condition simplifies to
+#     // _int_1 == 1 && index <= 1.
+#     while (!(true && ! (_int_1 == 1 && index <= 1)))
+#     {
+#         arr[index]++;
+#         index++;
+#     }
+#
+#     // Always true
+#     if (arr[_int_0] == _int_2 && arr[_int_1] == _int_5 && arr[_int_2] == _int_6)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 108
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %89
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %11 "arr"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %30 "index"
+               OpName %89 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %89 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 3
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypePointer Function %9
+         %12 = OpConstant %7 6
+         %13 = OpTypeArray %6 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %6 0
+         %18 = OpConstant %6 3
+         %19 = OpTypePointer Uniform %6
+         %22 = OpConstant %6 5
+         %25 = OpConstant %6 2
+         %29 = OpTypePointer Function %6
+         %31 = OpConstant %6 1
+         %37 = OpTypeBool
+         %38 = OpConstantTrue %37
+         %69 = OpConstant %6 4
+         %86 = OpTypeFloat 32
+         %87 = OpTypeVector %86 4
+         %88 = OpTypePointer Output %87
+         %89 = OpVariable %88 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %30 = OpVariable %29 Function
+         %20 = OpAccessChain %19 %16 %17 %18
+         %21 = OpLoad %6 %20
+         %23 = OpAccessChain %19 %16 %17 %22
+         %24 = OpLoad %6 %23
+         %26 = OpAccessChain %19 %16 %17 %25
+         %27 = OpLoad %6 %26
+         %28 = OpCompositeConstruct %9 %21 %24 %27
+               OpStore %11 %28
+               OpStore %30 %31
+               OpBranch %32
+         %32 = OpLabel
+               OpLoopMerge %34 %35 None
+               OpBranch %36
+         %36 = OpLabel
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %39 %40
+         %39 = OpLabel
+         %41 = OpAccessChain %19 %16 %17 %17
+         %42 = OpLoad %6 %41
+         %43 = OpIEqual %37 %42 %31
+         %44 = OpLoad %6 %30
+         %45 = OpSLessThanEqual %37 %44 %31
+         %46 = OpLogicalAnd %37 %43 %45
+         %47 = OpLogicalNot %37 %46
+               OpBranch %40
+         %40 = OpLabel
+         %48 = OpPhi %37 %38 %36 %47 %39
+         %49 = OpLogicalNot %37 %48
+               OpBranchConditional %49 %33 %34
+         %33 = OpLabel
+         %50 = OpLoad %6 %30
+         %51 = OpAccessChain %29 %11 %50
+         %52 = OpLoad %6 %51
+         %53 = OpIAdd %6 %52 %31
+               OpStore %51 %53
+         %54 = OpLoad %6 %30
+         %55 = OpIAdd %6 %54 %31
+               OpStore %30 %55
+               OpBranch %35
+         %35 = OpLabel
+               OpBranch %32
+         %34 = OpLabel
+         %56 = OpAccessChain %19 %16 %17 %31
+         %57 = OpLoad %6 %56
+         %58 = OpAccessChain %29 %11 %57
+         %59 = OpLoad %6 %58
+         %60 = OpAccessChain %19 %16 %17 %18
+         %61 = OpLoad %6 %60
+         %62 = OpIEqual %37 %59 %61
+               OpSelectionMerge %64 None
+               OpBranchConditional %62 %63 %64
+         %63 = OpLabel
+         %65 = OpAccessChain %19 %16 %17 %17
+         %66 = OpLoad %6 %65
+         %67 = OpAccessChain %29 %11 %66
+         %68 = OpLoad %6 %67
+         %70 = OpAccessChain %19 %16 %17 %69
+         %71 = OpLoad %6 %70
+         %72 = OpIEqual %37 %68 %71
+               OpBranch %64
+         %64 = OpLabel
+         %73 = OpPhi %37 %62 %34 %72 %63
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %74 %75
+         %74 = OpLabel
+         %76 = OpAccessChain %19 %16 %17 %18
+         %77 = OpLoad %6 %76
+         %78 = OpAccessChain %29 %11 %77
+         %79 = OpLoad %6 %78
+         %80 = OpAccessChain %19 %16 %17 %25
+         %81 = OpLoad %6 %80
+         %82 = OpIEqual %37 %79 %81
+               OpBranch %75
+         %75 = OpLabel
+         %83 = OpPhi %37 %73 %64 %82 %74
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %84 %103
+         %84 = OpLabel
+         %90 = OpAccessChain %19 %16 %17 %17
+         %91 = OpLoad %6 %90
+         %92 = OpConvertSToF %86 %91
+         %93 = OpAccessChain %19 %16 %17 %31
+         %94 = OpLoad %6 %93
+         %95 = OpConvertSToF %86 %94
+         %96 = OpAccessChain %19 %16 %17 %31
+         %97 = OpLoad %6 %96
+         %98 = OpConvertSToF %86 %97
+         %99 = OpAccessChain %19 %16 %17 %17
+        %100 = OpLoad %6 %99
+        %101 = OpConvertSToF %86 %100
+        %102 = OpCompositeConstruct %87 %92 %95 %98 %101
+               OpStore %89 %102
+               OpBranch %85
+        %103 = OpLabel
+        %104 = OpAccessChain %19 %16 %17 %31
+        %105 = OpLoad %6 %104
+        %106 = OpConvertSToF %86 %105
+        %107 = OpCompositeConstruct %87 %106 %106 %106 %106
+               OpStore %89 %107
+               OpBranch %85
+         %85 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 6 2 5 4
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-increment-matrix-element-break-after-first-iteration.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-increment-matrix-element-break-after-first-iteration.amber
new file mode 100644 (file)
index 0000000..3a14ca6
--- /dev/null
@@ -0,0 +1,307 @@
+#!amber
+
+# Copyright 2021 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 NIR 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_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_100 _GLF_uniform_int_values[3]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 2, 100]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     mat2x3 m23 = mat2x3(_float_0_0);
+#
+#     // Iterates once because of the break.
+#     for (int i = 1; i < _int_100; i++)
+#     {
+#         m23[_int_1][_int_2] += _float_1_0;
+#
+#         if (gl_FragCoord.y < _float_1_0)
+#         {
+#         }
+#
+#         // Always true.
+#         if (!(true && (gl_FragCoord.x < 0.0)))
+#         {
+#             break;
+#         }
+#     }
+#
+#     // Always true.
+#     if(m23 == mat2x3(_int_0, _int_0, _int_0, _int_0, _int_0, _int_1))
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 139
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %61 %120
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %10 "m23"
+               OpName %14 "buf1"
+               OpMemberName %14 0 "_GLF_uniform_float_values"
+               OpName %16 ""
+               OpName %29 "i"
+               OpName %38 "buf0"
+               OpMemberName %38 0 "_GLF_uniform_int_values"
+               OpName %40 ""
+               OpName %61 "gl_FragCoord"
+               OpName %120 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 1
+               OpDecorate %37 ArrayStride 16
+               OpMemberDecorate %38 0 Offset 0
+               OpDecorate %38 Block
+               OpDecorate %40 DescriptorSet 0
+               OpDecorate %40 Binding 0
+               OpDecorate %61 BuiltIn FragCoord
+               OpDecorate %120 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 3
+          %8 = OpTypeMatrix %7 2
+          %9 = OpTypePointer Function %8
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 2
+         %13 = OpTypeArray %6 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpTypeInt 32 1
+         %18 = OpConstant %17 0
+         %19 = OpConstant %17 1
+         %20 = OpTypePointer Uniform %6
+         %23 = OpConstant %6 1
+         %24 = OpConstant %6 0
+         %28 = OpTypePointer Function %17
+         %36 = OpConstant %11 4
+         %37 = OpTypeArray %17 %36
+         %38 = OpTypeStruct %37
+         %39 = OpTypePointer Uniform %38
+         %40 = OpVariable %39 Uniform
+         %41 = OpConstant %17 3
+         %42 = OpTypePointer Uniform %17
+         %45 = OpTypeBool
+         %49 = OpConstant %17 2
+         %54 = OpTypePointer Function %6
+         %59 = OpTypeVector %6 4
+         %60 = OpTypePointer Input %59
+         %61 = OpVariable %60 Input
+         %62 = OpConstant %11 1
+         %63 = OpTypePointer Input %6
+         %71 = OpConstantTrue %45
+         %74 = OpConstant %11 0
+        %109 = OpTypeVector %45 3
+        %119 = OpTypePointer Output %59
+        %120 = OpVariable %119 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %10 = OpVariable %9 Function
+         %29 = OpVariable %28 Function
+         %21 = OpAccessChain %20 %16 %18 %19
+         %22 = OpLoad %6 %21
+         %25 = OpCompositeConstruct %7 %22 %24 %24
+         %26 = OpCompositeConstruct %7 %24 %22 %24
+         %27 = OpCompositeConstruct %8 %25 %26
+               OpStore %10 %27
+               OpStore %29 %19
+               OpBranch %30
+         %30 = OpLabel
+               OpLoopMerge %32 %33 None
+               OpBranch %34
+         %34 = OpLabel
+         %35 = OpLoad %17 %29
+         %43 = OpAccessChain %42 %40 %18 %41
+         %44 = OpLoad %17 %43
+         %46 = OpSLessThan %45 %35 %44
+               OpBranchConditional %46 %31 %32
+         %31 = OpLabel
+         %47 = OpAccessChain %42 %40 %18 %18
+         %48 = OpLoad %17 %47
+         %50 = OpAccessChain %42 %40 %18 %49
+         %51 = OpLoad %17 %50
+         %52 = OpAccessChain %20 %16 %18 %18
+         %53 = OpLoad %6 %52
+         %55 = OpAccessChain %54 %10 %48 %51
+         %56 = OpLoad %6 %55
+         %57 = OpFAdd %6 %56 %53
+         %58 = OpAccessChain %54 %10 %48 %51
+               OpStore %58 %57
+         %64 = OpAccessChain %63 %61 %62
+         %65 = OpLoad %6 %64
+         %66 = OpAccessChain %20 %16 %18 %18
+         %67 = OpLoad %6 %66
+         %68 = OpFOrdLessThan %45 %65 %67
+               OpSelectionMerge %70 None
+               OpBranchConditional %68 %69 %70
+         %69 = OpLabel
+               OpBranch %70
+         %70 = OpLabel
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %72 %73
+         %72 = OpLabel
+         %75 = OpAccessChain %63 %61 %74
+         %76 = OpLoad %6 %75
+         %77 = OpFOrdLessThan %45 %76 %24
+               OpBranch %73
+         %73 = OpLabel
+         %78 = OpPhi %45 %71 %70 %77 %72
+         %79 = OpLogicalNot %45 %78
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %80 %81
+         %80 = OpLabel
+               OpBranch %32
+         %81 = OpLabel
+               OpBranch %33
+         %33 = OpLabel
+         %83 = OpLoad %17 %29
+         %84 = OpIAdd %17 %83 %19
+               OpStore %29 %84
+               OpBranch %30
+         %32 = OpLabel
+         %85 = OpLoad %8 %10
+         %86 = OpAccessChain %42 %40 %18 %19
+         %87 = OpLoad %17 %86
+         %88 = OpConvertSToF %6 %87
+         %89 = OpAccessChain %42 %40 %18 %19
+         %90 = OpLoad %17 %89
+         %91 = OpConvertSToF %6 %90
+         %92 = OpAccessChain %42 %40 %18 %19
+         %93 = OpLoad %17 %92
+         %94 = OpConvertSToF %6 %93
+         %95 = OpAccessChain %42 %40 %18 %19
+         %96 = OpLoad %17 %95
+         %97 = OpConvertSToF %6 %96
+         %98 = OpAccessChain %42 %40 %18 %19
+         %99 = OpLoad %17 %98
+        %100 = OpConvertSToF %6 %99
+        %101 = OpAccessChain %42 %40 %18 %18
+        %102 = OpLoad %17 %101
+        %103 = OpConvertSToF %6 %102
+        %104 = OpCompositeConstruct %7 %88 %91 %94
+        %105 = OpCompositeConstruct %7 %97 %100 %103
+        %106 = OpCompositeConstruct %8 %104 %105
+        %107 = OpCompositeExtract %7 %85 0
+        %108 = OpCompositeExtract %7 %106 0
+        %110 = OpFOrdEqual %109 %107 %108
+        %111 = OpAll %45 %110
+        %112 = OpCompositeExtract %7 %85 1
+        %113 = OpCompositeExtract %7 %106 1
+        %114 = OpFOrdEqual %109 %112 %113
+        %115 = OpAll %45 %114
+        %116 = OpLogicalAnd %45 %111 %115
+               OpSelectionMerge %118 None
+               OpBranchConditional %116 %117 %134
+        %117 = OpLabel
+        %121 = OpAccessChain %42 %40 %18 %18
+        %122 = OpLoad %17 %121
+        %123 = OpConvertSToF %6 %122
+        %124 = OpAccessChain %42 %40 %18 %19
+        %125 = OpLoad %17 %124
+        %126 = OpConvertSToF %6 %125
+        %127 = OpAccessChain %42 %40 %18 %19
+        %128 = OpLoad %17 %127
+        %129 = OpConvertSToF %6 %128
+        %130 = OpAccessChain %42 %40 %18 %18
+        %131 = OpLoad %17 %130
+        %132 = OpConvertSToF %6 %131
+        %133 = OpCompositeConstruct %59 %123 %126 %129 %132
+               OpStore %120 %133
+               OpBranch %118
+        %134 = OpLabel
+        %135 = OpAccessChain %42 %40 %18 %19
+        %136 = OpLoad %17 %135
+        %137 = OpConvertSToF %6 %136
+        %138 = OpCompositeConstruct %59 %137 %137 %137 %137
+               OpStore %120 %138
+               OpBranch %118
+        %118 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 2 100
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-logical-xor.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-loop-logical-xor.amber
new file mode 100644 (file)
index 0000000..0fa89e3
--- /dev/null
@@ -0,0 +1,165 @@
+#!amber
+
+# Copyright 2021 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 NIR 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_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = _int_1;
+#     _GLF_color = vec4(_int_0);
+#
+#     // Always true.
+#     while((_int_2 == a) ^^ true)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#         break;
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 55
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %22
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %22 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %22 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 3
+         %11 = OpTypeArray %6 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpConstant %6 0
+         %16 = OpTypePointer Uniform %6
+         %19 = OpTypeFloat 32
+         %20 = OpTypeVector %19 4
+         %21 = OpTypePointer Output %20
+         %22 = OpVariable %21 Output
+         %23 = OpConstant %6 1
+         %33 = OpConstant %6 2
+         %37 = OpTypeBool
+         %39 = OpConstantTrue %37
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %17 = OpAccessChain %16 %14 %15 %15
+         %18 = OpLoad %6 %17
+               OpStore %8 %18
+         %24 = OpAccessChain %16 %14 %15 %23
+         %25 = OpLoad %6 %24
+         %26 = OpConvertSToF %19 %25
+         %27 = OpCompositeConstruct %20 %26 %26 %26 %26
+               OpStore %22 %27
+               OpBranch %28
+         %28 = OpLabel
+               OpLoopMerge %30 %31 None
+               OpBranch %32
+         %32 = OpLabel
+         %34 = OpAccessChain %16 %14 %15 %33
+         %35 = OpLoad %6 %34
+         %36 = OpLoad %6 %8
+         %38 = OpIEqual %37 %35 %36
+         %40 = OpLogicalNotEqual %37 %38 %39
+               OpBranchConditional %40 %29 %30
+         %29 = OpLabel
+         %41 = OpAccessChain %16 %14 %15 %15
+         %42 = OpLoad %6 %41
+         %43 = OpConvertSToF %19 %42
+         %44 = OpAccessChain %16 %14 %15 %23
+         %45 = OpLoad %6 %44
+         %46 = OpConvertSToF %19 %45
+         %47 = OpAccessChain %16 %14 %15 %23
+         %48 = OpLoad %6 %47
+         %49 = OpConvertSToF %19 %48
+         %50 = OpAccessChain %16 %14 %15 %15
+         %51 = OpLoad %6 %50
+         %52 = OpConvertSToF %19 %51
+         %53 = OpCompositeConstruct %20 %43 %46 %49 %52
+               OpStore %22 %53
+               OpBranch %30
+         %31 = OpLabel
+               OpBranch %28
+         %30 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 2
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-nested-functions-accumulate-global-matrix.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-nested-functions-accumulate-global-matrix.amber
new file mode 100644 (file)
index 0000000..a3258cd
--- /dev/null
@@ -0,0 +1,399 @@
+#!amber
+
+# Copyright 2021 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 NIR code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '--eliminate-dead-inserts'
+# '--eliminate-dead-branches'
+# '--merge-blocks'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+#
+# #define _GLF_MAKE_IN_BOUNDS_INT(IDX, SZ)  clamp(IDX, 0, SZ - 1)
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_2 _GLF_uniform_int_values[1]
+# #define _int_4 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+# #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: [0, 2, 4, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# // Contents of one: 1.0
+# layout(set = 0, binding = 2) uniform buf2
+# {
+#     float one;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# mat4x2 m = mat4x2(0.0);
+#
+# void func0(int x)
+# {
+#     // Always false.
+#     if (x < 1 || (x > 1 && one > _float_1_0))
+#     {
+#         return;
+#     }
+#
+#     // Always true.
+#     if (one == _float_1_0)
+#     {
+#         for(int i = 0; i < 2; i ++)
+#         {
+#             m[_GLF_MAKE_IN_BOUNDS_INT(x, 4)][i] += _float_1_0;
+#         }
+#     }
+# }
+#
+# void func1()
+# {
+#     // Always false.
+#     if (gl_FragCoord.y < 0.0)
+#     {
+#         return;
+#     }
+#
+#     func0(1);
+# }
+#
+# void main()
+# {
+#     // Called twice causing two of the matrix elements to increase by two.
+#     func1();
+#     func1();
+#
+#     // Always true.
+#     if(m == mat4x2(_int_0, _int_0, _int_2, _int_2, _int_0, _int_0, _int_0, _int_0))
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 176
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %85 %157
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %10 "func0(i1;"
+               OpName %9 "x"
+               OpName %12 "func1("
+               OpName %18 "m"
+               OpName %33 "buf2"
+               OpMemberName %33 0 "one"
+               OpName %35 ""
+               OpName %43 "buf0"
+               OpMemberName %43 0 "_GLF_uniform_float_values"
+               OpName %45 ""
+               OpName %61 "i"
+               OpName %85 "gl_FragCoord"
+               OpName %93 "param"
+               OpName %100 "buf1"
+               OpMemberName %100 0 "_GLF_uniform_int_values"
+               OpName %102 ""
+               OpName %157 "_GLF_color"
+               OpMemberDecorate %33 0 Offset 0
+               OpDecorate %33 Block
+               OpDecorate %35 DescriptorSet 0
+               OpDecorate %35 Binding 2
+               OpDecorate %42 ArrayStride 16
+               OpMemberDecorate %43 0 Offset 0
+               OpDecorate %43 Block
+               OpDecorate %45 DescriptorSet 0
+               OpDecorate %45 Binding 0
+               OpDecorate %85 BuiltIn FragCoord
+               OpDecorate %99 ArrayStride 16
+               OpMemberDecorate %100 0 Offset 0
+               OpDecorate %100 Block
+               OpDecorate %102 DescriptorSet 0
+               OpDecorate %102 Binding 1
+               OpDecorate %157 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %8 = OpTypeFunction %2 %7
+         %14 = OpTypeFloat 32
+         %15 = OpTypeVector %14 2
+         %16 = OpTypeMatrix %15 4
+         %17 = OpTypePointer Private %16
+         %18 = OpVariable %17 Private
+         %19 = OpConstant %14 0
+         %20 = OpConstantComposite %15 %19 %19
+         %21 = OpConstantComposite %16 %20 %20 %20 %20
+         %22 = OpTypeBool
+         %24 = OpConstant %6 1
+         %33 = OpTypeStruct %14
+         %34 = OpTypePointer Uniform %33
+         %35 = OpVariable %34 Uniform
+         %36 = OpConstant %6 0
+         %37 = OpTypePointer Uniform %14
+         %40 = OpTypeInt 32 0
+         %41 = OpConstant %40 1
+         %42 = OpTypeArray %14 %41
+         %43 = OpTypeStruct %42
+         %44 = OpTypePointer Uniform %43
+         %45 = OpVariable %44 Uniform
+         %68 = OpConstant %6 2
+         %71 = OpConstant %6 3
+         %76 = OpTypePointer Private %14
+         %83 = OpTypeVector %14 4
+         %84 = OpTypePointer Input %83
+         %85 = OpVariable %84 Input
+         %86 = OpTypePointer Input %14
+         %98 = OpConstant %40 4
+         %99 = OpTypeArray %6 %98
+        %100 = OpTypeStruct %99
+        %101 = OpTypePointer Uniform %100
+        %102 = OpVariable %101 Uniform
+        %103 = OpTypePointer Uniform %6
+        %128 = OpConstant %14 1
+        %136 = OpTypeVector %22 2
+        %156 = OpTypePointer Output %83
+        %157 = OpVariable %156 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+               OpStore %18 %21
+         %95 = OpFunctionCall %2 %12
+         %96 = OpFunctionCall %2 %12
+         %97 = OpLoad %16 %18
+        %104 = OpAccessChain %103 %102 %36 %36
+        %105 = OpLoad %6 %104
+        %106 = OpConvertSToF %14 %105
+        %107 = OpAccessChain %103 %102 %36 %36
+        %108 = OpLoad %6 %107
+        %109 = OpConvertSToF %14 %108
+        %110 = OpAccessChain %103 %102 %36 %24
+        %111 = OpLoad %6 %110
+        %112 = OpConvertSToF %14 %111
+        %113 = OpAccessChain %103 %102 %36 %24
+        %114 = OpLoad %6 %113
+        %115 = OpConvertSToF %14 %114
+        %116 = OpAccessChain %103 %102 %36 %36
+        %117 = OpLoad %6 %116
+        %118 = OpConvertSToF %14 %117
+        %119 = OpAccessChain %103 %102 %36 %36
+        %120 = OpLoad %6 %119
+        %121 = OpConvertSToF %14 %120
+        %122 = OpAccessChain %103 %102 %36 %36
+        %123 = OpLoad %6 %122
+        %124 = OpConvertSToF %14 %123
+        %125 = OpAccessChain %103 %102 %36 %36
+        %126 = OpLoad %6 %125
+        %127 = OpConvertSToF %14 %126
+        %129 = OpCompositeConstruct %15 %106 %109
+        %130 = OpCompositeConstruct %15 %112 %115
+        %131 = OpCompositeConstruct %15 %118 %121
+        %132 = OpCompositeConstruct %15 %124 %127
+        %133 = OpCompositeConstruct %16 %129 %130 %131 %132
+        %134 = OpCompositeExtract %15 %97 0
+        %135 = OpCompositeExtract %15 %133 0
+        %137 = OpFOrdEqual %136 %134 %135
+        %138 = OpAll %22 %137
+        %139 = OpCompositeExtract %15 %97 1
+        %140 = OpCompositeExtract %15 %133 1
+        %141 = OpFOrdEqual %136 %139 %140
+        %142 = OpAll %22 %141
+        %143 = OpLogicalAnd %22 %138 %142
+        %144 = OpCompositeExtract %15 %97 2
+        %145 = OpCompositeExtract %15 %133 2
+        %146 = OpFOrdEqual %136 %144 %145
+        %147 = OpAll %22 %146
+        %148 = OpLogicalAnd %22 %143 %147
+        %149 = OpCompositeExtract %15 %97 3
+        %150 = OpCompositeExtract %15 %133 3
+        %151 = OpFOrdEqual %136 %149 %150
+        %152 = OpAll %22 %151
+        %153 = OpLogicalAnd %22 %148 %152
+               OpSelectionMerge %155 None
+               OpBranchConditional %153 %154 %171
+        %154 = OpLabel
+        %158 = OpAccessChain %103 %102 %36 %71
+        %159 = OpLoad %6 %158
+        %160 = OpConvertSToF %14 %159
+        %161 = OpAccessChain %103 %102 %36 %36
+        %162 = OpLoad %6 %161
+        %163 = OpConvertSToF %14 %162
+        %164 = OpAccessChain %103 %102 %36 %36
+        %165 = OpLoad %6 %164
+        %166 = OpConvertSToF %14 %165
+        %167 = OpAccessChain %103 %102 %36 %71
+        %168 = OpLoad %6 %167
+        %169 = OpConvertSToF %14 %168
+        %170 = OpCompositeConstruct %83 %160 %163 %166 %169
+               OpStore %157 %170
+               OpBranch %155
+        %171 = OpLabel
+        %172 = OpAccessChain %103 %102 %36 %36
+        %173 = OpLoad %6 %172
+        %174 = OpConvertSToF %14 %173
+        %175 = OpCompositeConstruct %83 %174 %174 %174 %174
+               OpStore %157 %175
+               OpBranch %155
+        %155 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %10 = OpFunction %2 None %8
+          %9 = OpFunctionParameter %7
+         %11 = OpLabel
+         %61 = OpVariable %7 Function
+         %23 = OpLoad %6 %9
+         %25 = OpSLessThan %22 %23 %24
+         %26 = OpLogicalNot %22 %25
+               OpSelectionMerge %28 None
+               OpBranchConditional %26 %27 %28
+         %27 = OpLabel
+         %29 = OpLoad %6 %9
+         %30 = OpSGreaterThan %22 %29 %24
+               OpSelectionMerge %32 None
+               OpBranchConditional %30 %31 %32
+         %31 = OpLabel
+         %38 = OpAccessChain %37 %35 %36
+         %39 = OpLoad %14 %38
+         %46 = OpAccessChain %37 %45 %36 %36
+         %47 = OpLoad %14 %46
+         %48 = OpFOrdGreaterThan %22 %39 %47
+               OpBranch %32
+         %32 = OpLabel
+         %49 = OpPhi %22 %30 %27 %48 %31
+               OpBranch %28
+         %28 = OpLabel
+         %50 = OpPhi %22 %25 %11 %49 %32
+               OpSelectionMerge %52 None
+               OpBranchConditional %50 %51 %52
+         %51 = OpLabel
+               OpReturn
+         %52 = OpLabel
+         %54 = OpAccessChain %37 %35 %36
+         %55 = OpLoad %14 %54
+         %56 = OpAccessChain %37 %45 %36 %36
+         %57 = OpLoad %14 %56
+         %58 = OpFOrdEqual %22 %55 %57
+               OpSelectionMerge %60 None
+               OpBranchConditional %58 %59 %60
+         %59 = OpLabel
+               OpStore %61 %36
+               OpBranch %62
+         %62 = OpLabel
+         %67 = OpLoad %6 %61
+         %69 = OpSLessThan %22 %67 %68
+               OpLoopMerge %64 %63 None
+               OpBranchConditional %69 %63 %64
+         %63 = OpLabel
+         %70 = OpLoad %6 %9
+         %72 = OpExtInst %6 %1 SClamp %70 %36 %71
+         %73 = OpLoad %6 %61
+         %74 = OpAccessChain %37 %45 %36 %36
+         %75 = OpLoad %14 %74
+         %77 = OpAccessChain %76 %18 %72 %73
+         %78 = OpLoad %14 %77
+         %79 = OpFAdd %14 %78 %75
+         %80 = OpAccessChain %76 %18 %72 %73
+               OpStore %80 %79
+         %81 = OpLoad %6 %61
+         %82 = OpIAdd %6 %81 %24
+               OpStore %61 %82
+               OpBranch %62
+         %64 = OpLabel
+               OpBranch %60
+         %60 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %12 = OpFunction %2 None %3
+         %13 = OpLabel
+         %93 = OpVariable %7 Function
+         %87 = OpAccessChain %86 %85 %41
+         %88 = OpLoad %14 %87
+         %89 = OpFOrdLessThan %22 %88 %19
+               OpSelectionMerge %91 None
+               OpBranchConditional %89 %90 %91
+         %90 = OpLabel
+               OpReturn
+         %91 = OpLabel
+               OpStore %93 %24
+         %94 = OpFunctionCall %2 %10 %93
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# one
+BUFFER variant_one DATA_TYPE float STD140 DATA
+ 1.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 2 4 1
+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 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant_one 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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-nested-loop-undefined-smoothstep-never-executed.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-nested-loop-undefined-smoothstep-never-executed.amber
new file mode 100644 (file)
index 0000000..0a2c411
--- /dev/null
@@ -0,0 +1,301 @@
+#!amber
+
+# Copyright 2021 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 BRW 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 _GLF_MAKE_IN_BOUNDS_INT(IDX, SZ)  clamp(IDX, 0, SZ - 1)
+# #define _int_4 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_100 _GLF_uniform_int_values[2]
+# #define _int_0 _GLF_uniform_int_values[3]
+# #define _float_5_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [5.0, 1.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [4, 1, 100, 0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     vec4 v0 = vec4(_float_1_0);
+#     vec4 v1 = vec4(_float_5_0);
+#
+#     for(int a = _int_1; a < _int_4; a++)
+#     {
+#         for(int c = _int_0; c < _int_100; c++)
+#         {
+#             v0[_GLF_MAKE_IN_BOUNDS_INT(c, 4)] -= _float_1_0;
+#
+#             // Always false.
+#             if(_int_1 == _int_0)
+#             {
+#                 // Undefined behavior because edge0.w > edge1.w, but this is never executed.
+#                 v1[a] = smoothstep(vec4(_float_1_0, _float_1_0, _float_1_0, 3.0), vec4(1.0), v0)[a];
+#             }
+#         }
+#     }
+#
+#     // Always true because the x coordinate is never touched.
+#     if(v1.x == _float_5_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 125
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %106
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %9 "v0"
+               OpName %13 "buf0"
+               OpMemberName %13 0 "_GLF_uniform_float_values"
+               OpName %15 ""
+               OpName %23 "v1"
+               OpName %28 "a"
+               OpName %31 "buf1"
+               OpMemberName %31 0 "_GLF_uniform_int_values"
+               OpName %33 ""
+               OpName %47 "c"
+               OpName %106 "_GLF_color"
+               OpDecorate %12 ArrayStride 16
+               OpMemberDecorate %13 0 Offset 0
+               OpDecorate %13 Block
+               OpDecorate %15 DescriptorSet 0
+               OpDecorate %15 Binding 0
+               OpDecorate %30 ArrayStride 16
+               OpMemberDecorate %31 0 Offset 0
+               OpDecorate %31 Block
+               OpDecorate %33 DescriptorSet 0
+               OpDecorate %33 Binding 1
+               OpDecorate %106 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Function %7
+         %10 = OpTypeInt 32 0
+         %11 = OpConstant %10 2
+         %12 = OpTypeArray %6 %11
+         %13 = OpTypeStruct %12
+         %14 = OpTypePointer Uniform %13
+         %15 = OpVariable %14 Uniform
+         %16 = OpTypeInt 32 1
+         %17 = OpConstant %16 0
+         %18 = OpConstant %16 1
+         %19 = OpTypePointer Uniform %6
+         %27 = OpTypePointer Function %16
+         %29 = OpConstant %10 4
+         %30 = OpTypeArray %16 %29
+         %31 = OpTypeStruct %30
+         %32 = OpTypePointer Uniform %31
+         %33 = OpVariable %32 Uniform
+         %34 = OpTypePointer Uniform %16
+         %45 = OpTypeBool
+         %48 = OpConstant %16 3
+         %57 = OpConstant %16 2
+         %65 = OpTypePointer Function %6
+         %84 = OpConstant %6 3
+         %86 = OpConstant %6 1
+         %87 = OpConstantComposite %7 %86 %86 %86 %86
+         %97 = OpConstant %10 0
+        %105 = OpTypePointer Output %7
+        %106 = OpVariable %105 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %9 = OpVariable %8 Function
+         %23 = OpVariable %8 Function
+         %28 = OpVariable %27 Function
+         %47 = OpVariable %27 Function
+         %20 = OpAccessChain %19 %15 %17 %18
+         %21 = OpLoad %6 %20
+         %22 = OpCompositeConstruct %7 %21 %21 %21 %21
+               OpStore %9 %22
+         %24 = OpAccessChain %19 %15 %17 %17
+         %25 = OpLoad %6 %24
+         %26 = OpCompositeConstruct %7 %25 %25 %25 %25
+               OpStore %23 %26
+         %35 = OpAccessChain %34 %33 %17 %18
+         %36 = OpLoad %16 %35
+               OpStore %28 %36
+               OpBranch %37
+         %37 = OpLabel
+               OpLoopMerge %39 %40 None
+               OpBranch %41
+         %41 = OpLabel
+         %42 = OpLoad %16 %28
+         %43 = OpAccessChain %34 %33 %17 %17
+         %44 = OpLoad %16 %43
+         %46 = OpSLessThan %45 %42 %44
+               OpBranchConditional %46 %38 %39
+         %38 = OpLabel
+         %49 = OpAccessChain %34 %33 %17 %48
+         %50 = OpLoad %16 %49
+               OpStore %47 %50
+               OpBranch %51
+         %51 = OpLabel
+               OpLoopMerge %53 %54 None
+               OpBranch %55
+         %55 = OpLabel
+         %56 = OpLoad %16 %47
+         %58 = OpAccessChain %34 %33 %17 %57
+         %59 = OpLoad %16 %58
+         %60 = OpSLessThan %45 %56 %59
+               OpBranchConditional %60 %52 %53
+         %52 = OpLabel
+         %61 = OpLoad %16 %47
+         %62 = OpExtInst %16 %1 SClamp %61 %17 %48
+         %63 = OpAccessChain %19 %15 %17 %18
+         %64 = OpLoad %6 %63
+         %66 = OpAccessChain %65 %9 %62
+         %67 = OpLoad %6 %66
+         %68 = OpFSub %6 %67 %64
+         %69 = OpAccessChain %65 %9 %62
+               OpStore %69 %68
+         %70 = OpAccessChain %34 %33 %17 %18
+         %71 = OpLoad %16 %70
+         %72 = OpAccessChain %34 %33 %17 %48
+         %73 = OpLoad %16 %72
+         %74 = OpIEqual %45 %71 %73
+               OpSelectionMerge %76 None
+               OpBranchConditional %74 %75 %76
+         %75 = OpLabel
+         %77 = OpLoad %16 %28
+         %78 = OpAccessChain %19 %15 %17 %18
+         %79 = OpLoad %6 %78
+         %80 = OpAccessChain %19 %15 %17 %18
+         %81 = OpLoad %6 %80
+         %82 = OpAccessChain %19 %15 %17 %18
+         %83 = OpLoad %6 %82
+         %85 = OpCompositeConstruct %7 %79 %81 %83 %84
+         %88 = OpLoad %7 %9
+         %89 = OpExtInst %7 %1 SmoothStep %85 %87 %88
+         %90 = OpLoad %16 %28
+         %91 = OpVectorExtractDynamic %6 %89 %90
+         %92 = OpAccessChain %65 %23 %77
+               OpStore %92 %91
+               OpBranch %76
+         %76 = OpLabel
+               OpBranch %54
+         %54 = OpLabel
+         %93 = OpLoad %16 %47
+         %94 = OpIAdd %16 %93 %18
+               OpStore %47 %94
+               OpBranch %51
+         %53 = OpLabel
+               OpBranch %40
+         %40 = OpLabel
+         %95 = OpLoad %16 %28
+         %96 = OpIAdd %16 %95 %18
+               OpStore %28 %96
+               OpBranch %37
+         %39 = OpLabel
+         %98 = OpAccessChain %65 %23 %97
+         %99 = OpLoad %6 %98
+        %100 = OpAccessChain %19 %15 %17 %17
+        %101 = OpLoad %6 %100
+        %102 = OpFOrdEqual %45 %99 %101
+               OpSelectionMerge %104 None
+               OpBranchConditional %102 %103 %120
+        %103 = OpLabel
+        %107 = OpAccessChain %34 %33 %17 %18
+        %108 = OpLoad %16 %107
+        %109 = OpConvertSToF %6 %108
+        %110 = OpAccessChain %34 %33 %17 %48
+        %111 = OpLoad %16 %110
+        %112 = OpConvertSToF %6 %111
+        %113 = OpAccessChain %34 %33 %17 %48
+        %114 = OpLoad %16 %113
+        %115 = OpConvertSToF %6 %114
+        %116 = OpAccessChain %34 %33 %17 %18
+        %117 = OpLoad %16 %116
+        %118 = OpConvertSToF %6 %117
+        %119 = OpCompositeConstruct %7 %109 %112 %115 %118
+               OpStore %106 %119
+               OpBranch %104
+        %120 = OpLabel
+        %121 = OpAccessChain %34 %33 %17 %48
+        %122 = OpLoad %16 %121
+        %123 = OpConvertSToF %6 %122
+        %124 = OpCompositeConstruct %7 %123 %123 %123 %123
+               OpStore %106 %124
+               OpBranch %104
+        %104 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 4 1 100 0
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 5.0 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-one-minus-clamp-always-one-cast-to-int.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-one-minus-clamp-always-one-cast-to-int.amber
new file mode 100644 (file)
index 0000000..d5efe6c
--- /dev/null
@@ -0,0 +1,170 @@
+#!amber
+
+# Copyright 2021 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 NIR 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_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float f = 2.0;
+#     // Clamp always returns 1 and a is set to zero.
+#     int a = int(1.0 - clamp(1.0, 1.0, f));
+#
+#
+#     // Always true.
+#     if(a == _int_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _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: 55
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %36
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 320
+               OpName %4 "main"
+               OpName %8 "f"
+               OpName %12 "a"
+               OpName %22 "buf0"
+               OpMemberName %22 0 "_GLF_uniform_int_values"
+               OpName %24 ""
+               OpName %36 "_GLF_color"
+               OpDecorate %21 ArrayStride 16
+               OpMemberDecorate %22 0 Offset 0
+               OpDecorate %22 Block
+               OpDecorate %24 DescriptorSet 0
+               OpDecorate %24 Binding 0
+               OpDecorate %36 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 2
+         %10 = OpTypeInt 32 1
+         %11 = OpTypePointer Function %10
+         %13 = OpConstant %6 1
+         %19 = OpTypeInt 32 0
+         %20 = OpConstant %19 2
+         %21 = OpTypeArray %10 %20
+         %22 = OpTypeStruct %21
+         %23 = OpTypePointer Uniform %22
+         %24 = OpVariable %23 Uniform
+         %25 = OpConstant %10 0
+         %26 = OpConstant %10 1
+         %27 = OpTypePointer Uniform %10
+         %30 = OpTypeBool
+         %34 = OpTypeVector %6 4
+         %35 = OpTypePointer Output %34
+         %36 = OpVariable %35 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %12 = OpVariable %11 Function
+               OpStore %8 %9
+         %14 = OpLoad %6 %8
+         %15 = OpExtInst %6 %1 FClamp %13 %13 %14
+         %16 = OpFSub %6 %13 %15
+         %17 = OpConvertFToS %10 %16
+               OpStore %12 %17
+         %18 = OpLoad %10 %12
+         %28 = OpAccessChain %27 %24 %25 %26
+         %29 = OpLoad %10 %28
+         %31 = OpIEqual %30 %18 %29
+               OpSelectionMerge %33 None
+               OpBranchConditional %31 %32 %50
+         %32 = OpLabel
+         %37 = OpAccessChain %27 %24 %25 %25
+         %38 = OpLoad %10 %37
+         %39 = OpConvertSToF %6 %38
+         %40 = OpAccessChain %27 %24 %25 %26
+         %41 = OpLoad %10 %40
+         %42 = OpConvertSToF %6 %41
+         %43 = OpAccessChain %27 %24 %25 %26
+         %44 = OpLoad %10 %43
+         %45 = OpConvertSToF %6 %44
+         %46 = OpAccessChain %27 %24 %25 %25
+         %47 = OpLoad %10 %46
+         %48 = OpConvertSToF %6 %47
+         %49 = OpCompositeConstruct %34 %39 %42 %45 %48
+               OpStore %36 %49
+               OpBranch %33
+         %50 = OpLabel
+         %51 = OpAccessChain %27 %24 %25 %26
+         %52 = OpLoad %10 %51
+         %53 = OpConvertSToF %6 %52
+         %54 = OpCompositeConstruct %34 %53 %53 %53 %53
+               OpStore %36 %54
+               OpBranch %33
+         %33 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] 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 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_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 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
index 893532d..8ca2a00 100644 (file)
@@ -33,6 +33,7 @@
 {      "cov-apfloat-reflect-denorm.amber",                                                                                                                     "cov-apfloat-reflect-denorm",                                                                                                           "A fragment shader that covers a specific floating point code path"                                     },
 {      "cov-apfloat-unpackunorm-loop.amber",                                                                                                           "cov-apfloat-unpackunorm-loop",                                                                                                         "A fragment shader that covers a specific floating point code path"                                     },
 {      "cov-array-accesses-clamp.amber",                                                                                                                       "cov-array-accesses-clamp",                                                                                                                     "A fragment shader that covers a specific inst combine select path"                                     },
+{      "cov-array-copies-loops-with-limiters.amber",                                                                                           "cov-array-copies-loops-with-limiters",                                                                                         "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-asin-undefined-smoothstep.amber",                                                                                                          "cov-asin-undefined-smoothstep",                                                                                                        "A fragment shader that covers a specific instruction simplify code path"                       },
 {      "cov-atan-trunc-vec4.amber",                                                                                                                            "cov-atan-trunc-vec4",                                                                                                                          "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-basic-block-discard-in-function.amber",                                                                                            "cov-basic-block-discard-in-function",                                                                                          "A fragment shader that covers a specific basic block code path"                                        },
@@ -40,6 +41,7 @@
 {      "cov-bitfieldExtract-undefined.amber",                                                                                                          "cov-bitfieldExtract-undefined",                                                                                                        "A fragment shader that covers a specific constant fold code path"                                      },
 {      "cov-bitfieldinsert-undefined.amber",                                                                                                           "cov-bitfieldinsert-undefined",                                                                                                         "A fragment shader that covers a specific instruction simplify code path"                       },
 {      "cov-bitfieldreverse-left-shift-findmsb.amber",                                                                                         "cov-bitfieldreverse-left-shift-findmsb",                                                                                       "Covers specific DAG combiner and legalize vector ops code paths"                                       },
+{      "cov-bitfieldreverse-loop-limit-underflow.amber",                                                                                       "cov-bitfieldreverse-loop-limit-underflow",                                                                                     "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-bitwise-inverse-uniform-condition.amber",                                                                                          "cov-bitwise-inverse-uniform-condition",                                                                                        "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-blockfrequency-several-for-loops.amber",                                                                                           "cov-blockfrequency-several-for-loops",                                                                                         "A fragment shader that covers a specific block frequency info code path."                      },
 {      "cov-branch-probability-identity-matrix.amber",                                                                                         "cov-branch-probability-identity-matrix",                                                                                       "A fragment shader that covers a specific branch propability path"                                      },
@@ -50,6 +52,7 @@
 {      "cov-clamp-vector-variable-negative-offset.amber",                                                                                      "cov-clamp-vector-variable-negative-offset",                                                                            "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-clear-yz-inside-condition.amber",                                                                                                          "cov-clear-yz-inside-condition",                                                                                                        "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-combine-and-or-xor-gt-lt.amber",                                                                                                           "cov-combine-and-or-xor-gt-lt",                                                                                                         "A fragment shader that covers a specific bitwise operator cobmining code path"         },
+{      "cov-condition-loop-index-bitwise-not.amber",                                                                                           "cov-condition-loop-index-bitwise-not",                                                                                         "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-conditional-discard-inside-loop.amber",                                                                                            "cov-conditional-discard-inside-loop",                                                                                          "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-const-folding-bitfieldinsert-div-one.amber",                                                                                       "cov-const-folding-bitfieldinsert-div-one",                                                                                     "A fragment shader that covers a specific const folding path"                                           },
 {      "cov-color-overwrite-identity-matrix-multiply.amber",                                                                           "cov-color-overwrite-identity-matrix-multiply",                                                                         "A fragment shader that covers a specific DAG code paths"                                                       },
@@ -89,6 +92,7 @@
 {      "cov-dead-branch-func-return-arg.amber",                                                                                                        "cov-dead-branch-func-return-arg",                                                                                                      "A fragment shader that covers a specific dead branch elimination path"                         },
 {      "cov-dead-code-unreachable-merge.amber",                                                                                                        "cov-dead-code-unreachable-merge",                                                                                                      "A fragment shader that covers a specific dead code elimination path."                          },
 {      "cov-derivative-uniform-vector-global-loop-count.amber",                                                                        "cov-derivative-uniform-vector-global-loop-count",                                                                      "A fragment shader that covers specific BRW code paths"                                                         },
+{      "cov-descending-loop-min-max-always-zero.amber",                                                                                        "cov-descending-loop-min-max-always-zero",                                                                                      "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-double-if-true-in-loop.amber",                                                                                                                     "cov-double-if-true-in-loop",                                                                                                           "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-exp2-two.amber",                                                                                                                                           "cov-exp2-two",                                                                                                                                         "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-findlsb-division-by-zero.amber",                                                                                                           "cov-findlsb-division-by-zero",                                                                                                         "A fragment shader that covers a specific instruction simplify code path"                       },
 {      "cov-fragcoord-clamp-array-access.amber",                                                                                                       "cov-fragcoord-clamp-array-access",                                                                                                     "A fragment shader that covers a specific instruction simplify path"                            },
 {      "cov-fragcoord-multiply.amber",                                                                                                                         "cov-fragcoord-multiply",                                                                                                                       "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-function-vec2-never-discard.amber",                                                                                                        "cov-function-vec2-never-discard",                                                                                                      "A fragment shader that covers specific BRW code paths"                                                         },
+{      "cov-global-loop-bound-true-logical-or.amber",                                                                                          "cov-global-loop-bound-true-logical-or",                                                                                        "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-global-loop-counter-float-accumulate-matrix.amber",                                                                        "cov-global-loop-counter-float-accumulate-matrix",                                                                      "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-global-loop-counter-main-function-call.amber",                                                                                     "cov-global-loop-counter-main-function-call",                                                                           "A fragment shader that covers specific NIR code paths"                                                         },
+{      "cov-global-loop-counter-multiply-one-minus.amber",                                                                                     "cov-global-loop-counter-multiply-one-minus",                                                                           "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-if-conversion-identical-branches.amber",                                                                                           "cov-if-conversion-identical-branches",                                                                                         "A fragment shader that covers a specific if condition conversion path."                        },
 {      "cov-if-switch-fallthrough.amber",                                                                                                                      "cov-if-switch-fallthrough",                                                                                                            "A fragment shader that covers a specific inst combine and or xor code path"            },
 {      "cov-if-true-continue.amber",                                                                                                                           "cov-if-true-continue",                                                                                                                         "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-liveinterval-different-dest.amber",                                                                                                        "cov-liveinterval-different-dest",                                                                                                      "A fragment shader that covers a specific live interval code path."                                     },
 {      "cov-loop-abs-multiply-offset.amber",                                                                                                           "cov-loop-abs-multiply-offset",                                                                                                         "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-loop-clamp-to-one-empty-condition.amber",                                                                                          "cov-loop-clamp-to-one-empty-condition",                                                                                        "A fragment shader that covers specific NIR code paths"                                                         },
+{      "cov-loop-condition-double-negate.amber",                                                                                                       "cov-loop-condition-double-negate",                                                                                                     "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-loop-findmsb-findlsb.amber",                                                                                                                       "cov-loop-findmsb-findlsb",                                                                                                                     "A fragment shader that covers specific simplification and value tracking paths"        },
+{      "cov-loop-increment-matrix-element-break-after-first-iteration.amber",                                          "cov-loop-increment-matrix-element-break-after-first-iteration",                                        "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-loop-increment-or-divide-by-loop-index.amber",                                                                                     "cov-loop-increment-or-divide-by-loop-index",                                                                           "A fragment shader that covers specific NIR code paths"                                                         },
+{      "cov-loop-logical-xor.amber",                                                                                                                           "cov-loop-logical-xor",                                                                                                                         "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-loop-returns-behind-true-and-false.amber",                                                                                         "cov-loop-returns-behind-true-and-false",                                                                                       "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-loop-with-two-integers.amber",                                                                                                                     "cov-loop-with-two-integers",                                                                                                           "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-machine-scheduler-for-if-pow.amber",                                                                                                       "cov-machine-scheduler-for-if-pow",                                                                                                     "A fragment shader that covers a specific machine scheduler path"                                       },
 {      "cov-modf-clamp-for.amber",                                                                                                                                     "cov-modf-clamp-for",                                                                                                                           "A fragment shader that covers a specific live intervals code path"                                     },
 {      "cov-modf-integer-to-private.amber",                                                                                                            "cov-modf-integer-to-private",                                                                                                          "A fragment shader that covers a specific private to local path."                                       },
 {      "cov-multiple-one-iteration-loops-global-counter-write-matrices.amber",                                         "cov-multiple-one-iteration-loops-global-counter-write-matrices",                                       "A fragment shader that covers specific BRW code paths"                                                         },
+{      "cov-nested-functions-accumulate-global-matrix.amber",                                                                          "cov-nested-functions-accumulate-global-matrix",                                                                        "A fragment shader that covers specific NIR code paths"                                                         },
+{      "cov-nested-loop-undefined-smoothstep-never-executed.amber",                                                            "cov-nested-loop-undefined-smoothstep-never-executed",                                                          "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-nested-loops-global-loop-counter-do-while-accumulate-float.amber",                                         "cov-nested-loops-global-loop-counter-do-while-accumulate-float",                                       "A fragment shader that covers specific BRW code paths"                                                         },
 {      "cov-nir-array-access.amber",                                                                                                                           "cov-nir-array-access",                                                                                                                         "A fragment shader that covers a specific nir path"                                                                     },
 {      "cov-nir-opt-large-constants-for-clamp-vector-access.amber",                                                            "cov-nir-opt-large-constants-for-clamp-vector-access",                                                          "A fragment shader that covers a specific nir opt large constants path"                         },
 {      "cov-nir-opt-loop-unroll-if-if-if-if-do-while.amber",                                                                           "cov-nir-opt-loop-unroll-if-if-if-if-do-while",                                                                         "A fragment shader that covers a specific nir opt loop unroll path"                                     },
+{      "cov-one-minus-clamp-always-one-cast-to-int.amber",                                                                                     "cov-one-minus-clamp-always-one-cast-to-int",                                                                           "A fragment shader that covers specific NIR code paths"                                                         },
 {      "cov-optimize-phis-for.amber",                                                                                                                          "cov-optimize-phis-for",                                                                                                                        "A fragment shader that cover specific optimize phis code paths"                                        },
 {      "cov-optimize-phis-for-for-do-while-if-if.amber",                                                                                       "cov-optimize-phis-for-for-do-while-if-if",                                                                                     "A fragment shader that covers a specific optimize PHIs code path"                                      },
 {      "cov-not-clamp-matrix-access.amber",                                                                                                            "cov-not-clamp-matrix-access",                                                                                                          "A fragment shader that covers a specific selection dag code path"                                      },
index 13d4215..2b08c42 100644 (file)
@@ -33,6 +33,7 @@ dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
 dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
 dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
 dEQP-VK.graphicsfuzz.cov-array-accesses-clamp
+dEQP-VK.graphicsfuzz.cov-array-copies-loops-with-limiters
 dEQP-VK.graphicsfuzz.cov-asin-undefined-smoothstep
 dEQP-VK.graphicsfuzz.cov-atan-trunc-vec4
 dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
@@ -40,6 +41,7 @@ dEQP-VK.graphicsfuzz.cov-bitcount
 dEQP-VK.graphicsfuzz.cov-bitfieldExtract-undefined
 dEQP-VK.graphicsfuzz.cov-bitfieldinsert-undefined
 dEQP-VK.graphicsfuzz.cov-bitfieldreverse-left-shift-findmsb
+dEQP-VK.graphicsfuzz.cov-bitfieldreverse-loop-limit-underflow
 dEQP-VK.graphicsfuzz.cov-bitwise-inverse-uniform-condition
 dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
 dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
@@ -50,6 +52,7 @@ dEQP-VK.graphicsfuzz.cov-clamp-vector-element-ceil-negative
 dEQP-VK.graphicsfuzz.cov-clamp-vector-variable-negative-offset
 dEQP-VK.graphicsfuzz.cov-clear-yz-inside-condition
 dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
+dEQP-VK.graphicsfuzz.cov-condition-loop-index-bitwise-not
 dEQP-VK.graphicsfuzz.cov-conditional-discard-inside-loop
 dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
 dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
@@ -89,6 +92,7 @@ dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
 dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
 dEQP-VK.graphicsfuzz.cov-dead-code-unreachable-merge
 dEQP-VK.graphicsfuzz.cov-derivative-uniform-vector-global-loop-count
+dEQP-VK.graphicsfuzz.cov-descending-loop-min-max-always-zero
 dEQP-VK.graphicsfuzz.cov-double-if-true-in-loop
 dEQP-VK.graphicsfuzz.cov-exp2-two
 dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
@@ -131,8 +135,10 @@ dEQP-VK.graphicsfuzz.cov-fract-smoothstep-undefined
 dEQP-VK.graphicsfuzz.cov-fragcoord-clamp-array-access
 dEQP-VK.graphicsfuzz.cov-fragcoord-multiply
 dEQP-VK.graphicsfuzz.cov-function-vec2-never-discard
+dEQP-VK.graphicsfuzz.cov-global-loop-bound-true-logical-or
 dEQP-VK.graphicsfuzz.cov-global-loop-counter-float-accumulate-matrix
 dEQP-VK.graphicsfuzz.cov-global-loop-counter-main-function-call
+dEQP-VK.graphicsfuzz.cov-global-loop-counter-multiply-one-minus
 dEQP-VK.graphicsfuzz.cov-if-conversion-identical-branches
 dEQP-VK.graphicsfuzz.cov-if-switch-fallthrough
 dEQP-VK.graphicsfuzz.cov-if-true-continue
@@ -201,8 +207,11 @@ dEQP-VK.graphicsfuzz.cov-left-shift-right-shift-compare
 dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
 dEQP-VK.graphicsfuzz.cov-loop-abs-multiply-offset
 dEQP-VK.graphicsfuzz.cov-loop-clamp-to-one-empty-condition
+dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
 dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
+dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
 dEQP-VK.graphicsfuzz.cov-loop-increment-or-divide-by-loop-index
+dEQP-VK.graphicsfuzz.cov-loop-logical-xor
 dEQP-VK.graphicsfuzz.cov-loop-returns-behind-true-and-false
 dEQP-VK.graphicsfuzz.cov-loop-with-two-integers
 dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
@@ -223,10 +232,13 @@ dEQP-VK.graphicsfuzz.cov-mod-uint-bits-float
 dEQP-VK.graphicsfuzz.cov-modf-clamp-for
 dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
 dEQP-VK.graphicsfuzz.cov-multiple-one-iteration-loops-global-counter-write-matrices
+dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
+dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
 dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-do-while-accumulate-float
 dEQP-VK.graphicsfuzz.cov-nir-array-access
 dEQP-VK.graphicsfuzz.cov-nir-opt-large-constants-for-clamp-vector-access
 dEQP-VK.graphicsfuzz.cov-nir-opt-loop-unroll-if-if-if-if-do-while
+dEQP-VK.graphicsfuzz.cov-one-minus-clamp-always-one-cast-to-int
 dEQP-VK.graphicsfuzz.cov-optimize-phis-for
 dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
 dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access