Add a batch of GraphicsFuzz coverage tests
authorAntto Mäkinen <antto.makinen@siru.fi>
Fri, 16 Oct 2020 10:47:34 +0000 (13:47 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 20 Nov 2020 10:57:09 +0000 (05:57 -0500)
This commit adds a batch of GraphicsFuzz coverage tests.

Components: Vulkan

New Tests:

dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
dEQP-VK.graphicsfuzz.cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop
dEQP-VK.graphicsfuzz.cov-dag-combiner-findmsb-loop
dEQP-VK.graphicsfuzz.cov-dag-combiner-increment-color
dEQP-VK.graphicsfuzz.cov-inst-combine-compares-while-modulo
dEQP-VK.graphicsfuzz.cov-inst-peephole-optimizer-acosh
dEQP-VK.graphicsfuzz.cov-inst-value-tracking-inversesqrt
dEQP-VK.graphicsfuzz.cov-instr-emitter-pow-asinh
dEQP-VK.graphicsfuzz.cov-instruction-simplify-atanh-log-undefined
dEQP-VK.graphicsfuzz.cov-instruction-simplify-bit-shifting
dEQP-VK.graphicsfuzz.cov-instruction-simplify-inclusive-or
dEQP-VK.graphicsfuzz.cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result
dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-acos-undefined
dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-sqrt-undefined
dEQP-VK.graphicsfuzz.cov-instruction-simplify-sqrt
dEQP-VK.graphicsfuzz.cov-instructions-first-value-phi
dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
dEQP-VK.graphicsfuzz.cov-optimize-phis-for
dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
dEQP-VK.graphicsfuzz.cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal
dEQP-VK.graphicsfuzz.cov-value-inst-combine-select-value-tracking-flip-bits
dEQP-VK.graphicsfuzz.cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator
dEQP-VK.graphicsfuzz.cov-value-tracking-constant-fold-refraction-dfxd-determinant
dEQP-VK.graphicsfuzz.cov-value-tracking-known-nonzero
dEQP-VK.graphicsfuzz.cov-value-tracking-max-uintbitstofloat
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop

Change-Id: I62f485332da70e889ffb198551c787e56314e20b

34 files changed:
android/cts/master/vk-master-2020-03-01.txt
android/cts/master/vk-master.txt
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-branch-probability-identity-matrix.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-combine-and-or-xor-gt-lt.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-findmsb-loop.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-increment-color.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-while-modulo.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-peephole-optimizer-acosh.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-value-tracking-inversesqrt.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instr-emitter-pow-asinh.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-atanh-log-undefined.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-bit-shifting.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-inclusive-or.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-mod-acos-undefined.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-mod-sqrt-undefined.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-sqrt.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instructions-first-value-phi.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-optimize-phis-for-for-do-while-if-if.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-optimize-phis-for.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-peephole-optimizer-target-instr-info-for-if-if-if.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-selection-dag-assign-back-and-forth.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-selection-dag-lt-gt.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-inst-combine-select-value-tracking-flip-bits.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-constant-fold-refraction-dfxd-determinant.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-known-nonzero.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-max-uintbitstofloat.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-selection-dag-negation-clamp-loop.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt
external/vulkancts/mustpass/master/vk-default.txt

index 91820ee..d550c86 100644 (file)
@@ -309174,6 +309174,8 @@ dEQP-VK.graphicsfuzz.cov-apfloat-determinant
 dEQP-VK.graphicsfuzz.cov-apfloat-tanh
 dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
 dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
+dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
+dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
 dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
@@ -309193,6 +309195,9 @@ dEQP-VK.graphicsfuzz.cov-constants-mix-uniform
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-func-argument
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-no-stores
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-param-uniform
+dEQP-VK.graphicsfuzz.cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop
+dEQP-VK.graphicsfuzz.cov-dag-combiner-findmsb-loop
+dEQP-VK.graphicsfuzz.cov-dag-combiner-increment-color
 dEQP-VK.graphicsfuzz.cov-dag-combiner-neg-div-pow2
 dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
 dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
@@ -309238,7 +309243,20 @@ dEQP-VK.graphicsfuzz.cov-inline-pass-empty-block
 dEQP-VK.graphicsfuzz.cov-inline-pass-nested-loops
 dEQP-VK.graphicsfuzz.cov-inline-pass-return-in-loop
 dEQP-VK.graphicsfuzz.cov-inline-pass-unreachable-func
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-while-modulo
+dEQP-VK.graphicsfuzz.cov-inst-peephole-optimizer-acosh
+dEQP-VK.graphicsfuzz.cov-inst-value-tracking-inversesqrt
+dEQP-VK.graphicsfuzz.cov-instr-emitter-pow-asinh
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-atanh-log-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-bit-shifting
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-inclusive-or
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-acos-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-sqrt-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-sqrt
+dEQP-VK.graphicsfuzz.cov-instructions-first-value-phi
 dEQP-VK.graphicsfuzz.cov-intervalmap-set-stop
+dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
 dEQP-VK.graphicsfuzz.cov-irbuilder-matrix-cell-uniform
 dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
 dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
@@ -309248,11 +309266,16 @@ dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
 dEQP-VK.graphicsfuzz.cov-mem-pass-unused-component
 dEQP-VK.graphicsfuzz.cov-merge-return-condition-twice
 dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
+dEQP-VK.graphicsfuzz.cov-optimize-phis-for
+dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
 dEQP-VK.graphicsfuzz.cov-pattern-match-signum
 dEQP-VK.graphicsfuzz.cov-pattern-match-single-bit
+dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
 dEQP-VK.graphicsfuzz.cov-reduce-load-replace-extract
 dEQP-VK.graphicsfuzz.cov-replace-copy-object
 dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops
+dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
+dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
 dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
 dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
@@ -309270,10 +309293,17 @@ dEQP-VK.graphicsfuzz.cov-single-block-elim-self-assign
 dEQP-VK.graphicsfuzz.cov-single-store-elim-assume-store
 dEQP-VK.graphicsfuzz.cov-ssa-rewrite-case-with-default
 dEQP-VK.graphicsfuzz.cov-target-lowering-dfdx-cos
+dEQP-VK.graphicsfuzz.cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal
 dEQP-VK.graphicsfuzz.cov-types-return-in-main-never-hit
 dEQP-VK.graphicsfuzz.cov-val-cfg-case-fallthrough
+dEQP-VK.graphicsfuzz.cov-value-inst-combine-select-value-tracking-flip-bits
+dEQP-VK.graphicsfuzz.cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator
 dEQP-VK.graphicsfuzz.cov-value-tracking-const-dfdy
+dEQP-VK.graphicsfuzz.cov-value-tracking-constant-fold-refraction-dfxd-determinant
 dEQP-VK.graphicsfuzz.cov-value-tracking-inclusive-or
+dEQP-VK.graphicsfuzz.cov-value-tracking-known-nonzero
+dEQP-VK.graphicsfuzz.cov-value-tracking-max-uintbitstofloat
+dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
 dEQP-VK.graphicsfuzz.cov-value-tracking-uniform-incident
 dEQP-VK.graphicsfuzz.cov-vector-dce-inc-unused-comp
 dEQP-VK.graphicsfuzz.cov-vector-dce-unused-component
index 0005c40..5dfd16a 100644 (file)
@@ -719367,6 +719367,8 @@ dEQP-VK.graphicsfuzz.cov-apfloat-determinant
 dEQP-VK.graphicsfuzz.cov-apfloat-tanh
 dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
 dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
+dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
+dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
 dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
@@ -719386,6 +719388,9 @@ dEQP-VK.graphicsfuzz.cov-constants-mix-uniform
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-func-argument
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-no-stores
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-param-uniform
+dEQP-VK.graphicsfuzz.cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop
+dEQP-VK.graphicsfuzz.cov-dag-combiner-findmsb-loop
+dEQP-VK.graphicsfuzz.cov-dag-combiner-increment-color
 dEQP-VK.graphicsfuzz.cov-dag-combiner-neg-div-pow2
 dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
 dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
@@ -719431,7 +719436,20 @@ dEQP-VK.graphicsfuzz.cov-inline-pass-empty-block
 dEQP-VK.graphicsfuzz.cov-inline-pass-nested-loops
 dEQP-VK.graphicsfuzz.cov-inline-pass-return-in-loop
 dEQP-VK.graphicsfuzz.cov-inline-pass-unreachable-func
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-while-modulo
+dEQP-VK.graphicsfuzz.cov-inst-peephole-optimizer-acosh
+dEQP-VK.graphicsfuzz.cov-inst-value-tracking-inversesqrt
+dEQP-VK.graphicsfuzz.cov-instr-emitter-pow-asinh
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-atanh-log-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-bit-shifting
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-inclusive-or
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-acos-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-sqrt-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-sqrt
+dEQP-VK.graphicsfuzz.cov-instructions-first-value-phi
 dEQP-VK.graphicsfuzz.cov-intervalmap-set-stop
+dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
 dEQP-VK.graphicsfuzz.cov-irbuilder-matrix-cell-uniform
 dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
 dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
@@ -719441,11 +719459,16 @@ dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
 dEQP-VK.graphicsfuzz.cov-mem-pass-unused-component
 dEQP-VK.graphicsfuzz.cov-merge-return-condition-twice
 dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
+dEQP-VK.graphicsfuzz.cov-optimize-phis-for
+dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
 dEQP-VK.graphicsfuzz.cov-pattern-match-signum
 dEQP-VK.graphicsfuzz.cov-pattern-match-single-bit
+dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
 dEQP-VK.graphicsfuzz.cov-reduce-load-replace-extract
 dEQP-VK.graphicsfuzz.cov-replace-copy-object
 dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops
+dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
+dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
 dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
 dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
@@ -719463,10 +719486,17 @@ dEQP-VK.graphicsfuzz.cov-single-block-elim-self-assign
 dEQP-VK.graphicsfuzz.cov-single-store-elim-assume-store
 dEQP-VK.graphicsfuzz.cov-ssa-rewrite-case-with-default
 dEQP-VK.graphicsfuzz.cov-target-lowering-dfdx-cos
+dEQP-VK.graphicsfuzz.cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal
 dEQP-VK.graphicsfuzz.cov-types-return-in-main-never-hit
 dEQP-VK.graphicsfuzz.cov-val-cfg-case-fallthrough
+dEQP-VK.graphicsfuzz.cov-value-inst-combine-select-value-tracking-flip-bits
+dEQP-VK.graphicsfuzz.cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator
 dEQP-VK.graphicsfuzz.cov-value-tracking-const-dfdy
+dEQP-VK.graphicsfuzz.cov-value-tracking-constant-fold-refraction-dfxd-determinant
 dEQP-VK.graphicsfuzz.cov-value-tracking-inclusive-or
+dEQP-VK.graphicsfuzz.cov-value-tracking-known-nonzero
+dEQP-VK.graphicsfuzz.cov-value-tracking-max-uintbitstofloat
+dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
 dEQP-VK.graphicsfuzz.cov-value-tracking-uniform-incident
 dEQP-VK.graphicsfuzz.cov-vector-dce-inc-unused-comp
 dEQP-VK.graphicsfuzz.cov-vector-dce-unused-component
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-branch-probability-identity-matrix.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-branch-probability-identity-matrix.amber
new file mode 100644 (file)
index 0000000..e8b6d9b
--- /dev/null
@@ -0,0 +1,406 @@
+#!amber
+
+# Copyright 2020 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 a specific branch propability path
+
+# 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 310 es
+# #define _int_2 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _int_3 _GLF_uniform_int_values[3]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0, 2.0]
+# layout(set = 0, binding = 0) uniform buf0 {
+#     float _GLF_uniform_float_values[3];
+# };
+# // Contents of _GLF_uniform_int_values: [2, 0, 1, 3]
+# layout(set = 0, binding = 1) uniform buf1 {
+#     int _GLF_uniform_int_values[4];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float sums[2];
+#     sums[_int_0] = - _float_1_0;
+#     sums[_int_1] = - _float_1_0;
+#     for(int a = _int_0; a < _int_2; a ++)
+#     {
+#         for(int b = _int_0; b < _int_3; b ++)
+#         {
+#             for(int c = _int_0; c <= a; c ++)
+#             {
+#                 for(int d = _int_0; d < _int_3; d ++)
+#                 {
+#                     sums[a] = mat2(_int_1)[c][_int_1];
+#                     sums[a] += mat2(_int_1)[c][_int_1];
+#                 }
+#             }
+#         }
+#     }
+#     if(sums[_int_0] == _float_0_0 && sums[_int_1] == _float_2_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; 8
+; Bound: 175
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %156
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "sums"
+               OpName %15 "buf1"
+               OpMemberName %15 0 "_GLF_uniform_int_values"
+               OpName %17 ""
+               OpName %25 "buf0"
+               OpMemberName %25 0 "_GLF_uniform_float_values"
+               OpName %27 ""
+               OpName %42 "a"
+               OpName %55 "b"
+               OpName %68 "c"
+               OpName %79 "d"
+               OpName %106 "indexable"
+               OpName %120 "indexable"
+               OpName %156 "_GLF_color"
+               OpDecorate %14 ArrayStride 16
+               OpMemberDecorate %15 0 RelaxedPrecision
+               OpMemberDecorate %15 0 Offset 0
+               OpDecorate %15 Block
+               OpDecorate %17 DescriptorSet 0
+               OpDecorate %17 Binding 1
+               OpDecorate %22 RelaxedPrecision
+               OpDecorate %24 ArrayStride 16
+               OpMemberDecorate %25 0 Offset 0
+               OpDecorate %25 Block
+               OpDecorate %27 DescriptorSet 0
+               OpDecorate %27 Binding 0
+               OpDecorate %36 RelaxedPrecision
+               OpDecorate %42 RelaxedPrecision
+               OpDecorate %44 RelaxedPrecision
+               OpDecorate %50 RelaxedPrecision
+               OpDecorate %52 RelaxedPrecision
+               OpDecorate %55 RelaxedPrecision
+               OpDecorate %57 RelaxedPrecision
+               OpDecorate %63 RelaxedPrecision
+               OpDecorate %66 RelaxedPrecision
+               OpDecorate %68 RelaxedPrecision
+               OpDecorate %70 RelaxedPrecision
+               OpDecorate %76 RelaxedPrecision
+               OpDecorate %77 RelaxedPrecision
+               OpDecorate %79 RelaxedPrecision
+               OpDecorate %81 RelaxedPrecision
+               OpDecorate %87 RelaxedPrecision
+               OpDecorate %89 RelaxedPrecision
+               OpDecorate %91 RelaxedPrecision
+               OpDecorate %93 RelaxedPrecision
+               OpDecorate %102 RelaxedPrecision
+               OpDecorate %104 RelaxedPrecision
+               OpDecorate %110 RelaxedPrecision
+               OpDecorate %112 RelaxedPrecision
+               OpDecorate %117 RelaxedPrecision
+               OpDecorate %119 RelaxedPrecision
+               OpDecorate %127 RelaxedPrecision
+               OpDecorate %128 RelaxedPrecision
+               OpDecorate %129 RelaxedPrecision
+               OpDecorate %130 RelaxedPrecision
+               OpDecorate %131 RelaxedPrecision
+               OpDecorate %132 RelaxedPrecision
+               OpDecorate %133 RelaxedPrecision
+               OpDecorate %134 RelaxedPrecision
+               OpDecorate %136 RelaxedPrecision
+               OpDecorate %145 RelaxedPrecision
+               OpDecorate %156 Location 0
+               OpDecorate %158 RelaxedPrecision
+               OpDecorate %161 RelaxedPrecision
+               OpDecorate %164 RelaxedPrecision
+               OpDecorate %167 RelaxedPrecision
+               OpDecorate %172 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 2
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypePointer Function %9
+         %12 = OpTypeInt 32 1
+         %13 = OpConstant %7 4
+         %14 = OpTypeArray %12 %13
+         %15 = OpTypeStruct %14
+         %16 = OpTypePointer Uniform %15
+         %17 = OpVariable %16 Uniform
+         %18 = OpConstant %12 0
+         %19 = OpConstant %12 1
+         %20 = OpTypePointer Uniform %12
+         %23 = OpConstant %7 3
+         %24 = OpTypeArray %6 %23
+         %25 = OpTypeStruct %24
+         %26 = OpTypePointer Uniform %25
+         %27 = OpVariable %26 Uniform
+         %28 = OpTypePointer Uniform %6
+         %32 = OpTypePointer Function %6
+         %34 = OpConstant %12 2
+         %41 = OpTypePointer Function %12
+         %53 = OpTypeBool
+         %64 = OpConstant %12 3
+         %95 = OpTypeVector %6 2
+         %96 = OpTypeMatrix %95 2
+         %97 = OpConstant %6 1
+         %98 = OpConstant %6 0
+        %105 = OpTypePointer Function %96
+        %154 = OpTypeVector %6 4
+        %155 = OpTypePointer Output %154
+        %156 = OpVariable %155 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %42 = OpVariable %41 Function
+         %55 = OpVariable %41 Function
+         %68 = OpVariable %41 Function
+         %79 = OpVariable %41 Function
+        %106 = OpVariable %105 Function
+        %120 = OpVariable %105 Function
+         %21 = OpAccessChain %20 %17 %18 %19
+         %22 = OpLoad %12 %21
+         %29 = OpAccessChain %28 %27 %18 %18
+         %30 = OpLoad %6 %29
+         %31 = OpFNegate %6 %30
+         %33 = OpAccessChain %32 %11 %22
+               OpStore %33 %31
+         %35 = OpAccessChain %20 %17 %18 %34
+         %36 = OpLoad %12 %35
+         %37 = OpAccessChain %28 %27 %18 %18
+         %38 = OpLoad %6 %37
+         %39 = OpFNegate %6 %38
+         %40 = OpAccessChain %32 %11 %36
+               OpStore %40 %39
+         %43 = OpAccessChain %20 %17 %18 %19
+         %44 = OpLoad %12 %43
+               OpStore %42 %44
+               OpBranch %45
+         %45 = OpLabel
+               OpLoopMerge %47 %48 None
+               OpBranch %49
+         %49 = OpLabel
+         %50 = OpLoad %12 %42
+         %51 = OpAccessChain %20 %17 %18 %18
+         %52 = OpLoad %12 %51
+         %54 = OpSLessThan %53 %50 %52
+               OpBranchConditional %54 %46 %47
+         %46 = OpLabel
+         %56 = OpAccessChain %20 %17 %18 %19
+         %57 = OpLoad %12 %56
+               OpStore %55 %57
+               OpBranch %58
+         %58 = OpLabel
+               OpLoopMerge %60 %61 None
+               OpBranch %62
+         %62 = OpLabel
+         %63 = OpLoad %12 %55
+         %65 = OpAccessChain %20 %17 %18 %64
+         %66 = OpLoad %12 %65
+         %67 = OpSLessThan %53 %63 %66
+               OpBranchConditional %67 %59 %60
+         %59 = OpLabel
+         %69 = OpAccessChain %20 %17 %18 %19
+         %70 = OpLoad %12 %69
+               OpStore %68 %70
+               OpBranch %71
+         %71 = OpLabel
+               OpLoopMerge %73 %74 None
+               OpBranch %75
+         %75 = OpLabel
+         %76 = OpLoad %12 %68
+         %77 = OpLoad %12 %42
+         %78 = OpSLessThanEqual %53 %76 %77
+               OpBranchConditional %78 %72 %73
+         %72 = OpLabel
+         %80 = OpAccessChain %20 %17 %18 %19
+         %81 = OpLoad %12 %80
+               OpStore %79 %81
+               OpBranch %82
+         %82 = OpLabel
+               OpLoopMerge %84 %85 None
+               OpBranch %86
+         %86 = OpLabel
+         %87 = OpLoad %12 %79
+         %88 = OpAccessChain %20 %17 %18 %64
+         %89 = OpLoad %12 %88
+         %90 = OpSLessThan %53 %87 %89
+               OpBranchConditional %90 %83 %84
+         %83 = OpLabel
+         %91 = OpLoad %12 %42
+         %92 = OpAccessChain %20 %17 %18 %34
+         %93 = OpLoad %12 %92
+         %94 = OpConvertSToF %6 %93
+         %99 = OpCompositeConstruct %95 %94 %98
+        %100 = OpCompositeConstruct %95 %98 %94
+        %101 = OpCompositeConstruct %96 %99 %100
+        %102 = OpLoad %12 %68
+        %103 = OpAccessChain %20 %17 %18 %34
+        %104 = OpLoad %12 %103
+               OpStore %106 %101
+        %107 = OpAccessChain %32 %106 %102 %104
+        %108 = OpLoad %6 %107
+        %109 = OpAccessChain %32 %11 %91
+               OpStore %109 %108
+        %110 = OpLoad %12 %42
+        %111 = OpAccessChain %20 %17 %18 %34
+        %112 = OpLoad %12 %111
+        %113 = OpConvertSToF %6 %112
+        %114 = OpCompositeConstruct %95 %113 %98
+        %115 = OpCompositeConstruct %95 %98 %113
+        %116 = OpCompositeConstruct %96 %114 %115
+        %117 = OpLoad %12 %68
+        %118 = OpAccessChain %20 %17 %18 %34
+        %119 = OpLoad %12 %118
+               OpStore %120 %116
+        %121 = OpAccessChain %32 %120 %117 %119
+        %122 = OpLoad %6 %121
+        %123 = OpAccessChain %32 %11 %110
+        %124 = OpLoad %6 %123
+        %125 = OpFAdd %6 %124 %122
+        %126 = OpAccessChain %32 %11 %110
+               OpStore %126 %125
+               OpBranch %85
+         %85 = OpLabel
+        %127 = OpLoad %12 %79
+        %128 = OpIAdd %12 %127 %19
+               OpStore %79 %128
+               OpBranch %82
+         %84 = OpLabel
+               OpBranch %74
+         %74 = OpLabel
+        %129 = OpLoad %12 %68
+        %130 = OpIAdd %12 %129 %19
+               OpStore %68 %130
+               OpBranch %71
+         %73 = OpLabel
+               OpBranch %61
+         %61 = OpLabel
+        %131 = OpLoad %12 %55
+        %132 = OpIAdd %12 %131 %19
+               OpStore %55 %132
+               OpBranch %58
+         %60 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+        %133 = OpLoad %12 %42
+        %134 = OpIAdd %12 %133 %19
+               OpStore %42 %134
+               OpBranch %45
+         %47 = OpLabel
+        %135 = OpAccessChain %20 %17 %18 %19
+        %136 = OpLoad %12 %135
+        %137 = OpAccessChain %32 %11 %136
+        %138 = OpLoad %6 %137
+        %139 = OpAccessChain %28 %27 %18 %19
+        %140 = OpLoad %6 %139
+        %141 = OpFOrdEqual %53 %138 %140
+               OpSelectionMerge %143 None
+               OpBranchConditional %141 %142 %143
+        %142 = OpLabel
+        %144 = OpAccessChain %20 %17 %18 %34
+        %145 = OpLoad %12 %144
+        %146 = OpAccessChain %32 %11 %145
+        %147 = OpLoad %6 %146
+        %148 = OpAccessChain %28 %27 %18 %34
+        %149 = OpLoad %6 %148
+        %150 = OpFOrdEqual %53 %147 %149
+               OpBranch %143
+        %143 = OpLabel
+        %151 = OpPhi %53 %141 %47 %150 %142
+               OpSelectionMerge %153 None
+               OpBranchConditional %151 %152 %170
+        %152 = OpLabel
+        %157 = OpAccessChain %20 %17 %18 %34
+        %158 = OpLoad %12 %157
+        %159 = OpConvertSToF %6 %158
+        %160 = OpAccessChain %20 %17 %18 %19
+        %161 = OpLoad %12 %160
+        %162 = OpConvertSToF %6 %161
+        %163 = OpAccessChain %20 %17 %18 %19
+        %164 = OpLoad %12 %163
+        %165 = OpConvertSToF %6 %164
+        %166 = OpAccessChain %20 %17 %18 %34
+        %167 = OpLoad %12 %166
+        %168 = OpConvertSToF %6 %167
+        %169 = OpCompositeConstruct %154 %159 %162 %165 %168
+               OpStore %156 %169
+               OpBranch %153
+        %170 = OpLabel
+        %171 = OpAccessChain %20 %17 %18 %19
+        %172 = OpLoad %12 %171
+        %173 = OpConvertSToF %6 %172
+        %174 = OpCompositeConstruct %154 %173 %173 %173 %173
+               OpStore %156 %174
+               OpBranch %153
+        %153 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 2 0 1 3
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.0 2.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-combine-and-or-xor-gt-lt.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-combine-and-or-xor-gt-lt.amber
new file mode 100644 (file)
index 0000000..a4682f4
--- /dev/null
@@ -0,0 +1,215 @@
+#!amber
+
+# Copyright 2020 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 a specific bitwise operator cobmining code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of v1: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     vec2 v1;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     bool b = true;
+#
+#     // Always true.
+#     if (v1.x > v1.y)
+#     {
+#         // Always false.
+#         if (v1.x < v1.y)
+#         {
+#             b = false;
+#         }
+#     }
+#     if (b)
+#     {
+#         _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; 8
+; Bound: 67
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %41
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "b"
+               OpName %12 "buf1"
+               OpMemberName %12 0 "v1"
+               OpName %14 ""
+               OpName %41 "_GLF_color"
+               OpName %44 "buf0"
+               OpMemberName %44 0 "_GLF_uniform_int_values"
+               OpName %46 ""
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %41 Location 0
+               OpDecorate %43 ArrayStride 16
+               OpMemberDecorate %44 0 RelaxedPrecision
+               OpMemberDecorate %44 0 Offset 0
+               OpDecorate %44 Block
+               OpDecorate %46 DescriptorSet 0
+               OpDecorate %46 Binding 0
+               OpDecorate %49 RelaxedPrecision
+               OpDecorate %53 RelaxedPrecision
+               OpDecorate %56 RelaxedPrecision
+               OpDecorate %59 RelaxedPrecision
+               OpDecorate %64 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeBool
+          %7 = OpTypePointer Function %6
+          %9 = OpConstantTrue %6
+         %10 = OpTypeFloat 32
+         %11 = OpTypeVector %10 2
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpTypeInt 32 1
+         %16 = OpConstant %15 0
+         %17 = OpTypeInt 32 0
+         %18 = OpConstant %17 0
+         %19 = OpTypePointer Uniform %10
+         %22 = OpConstant %17 1
+         %35 = OpConstantFalse %6
+         %39 = OpTypeVector %10 4
+         %40 = OpTypePointer Output %39
+         %41 = OpVariable %40 Output
+         %42 = OpConstant %17 2
+         %43 = OpTypeArray %15 %42
+         %44 = OpTypeStruct %43
+         %45 = OpTypePointer Uniform %44
+         %46 = OpVariable %45 Uniform
+         %47 = OpTypePointer Uniform %15
+         %51 = OpConstant %15 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpStore %8 %9
+         %20 = OpAccessChain %19 %14 %16 %18
+         %21 = OpLoad %10 %20
+         %23 = OpAccessChain %19 %14 %16 %22
+         %24 = OpLoad %10 %23
+         %25 = OpFOrdGreaterThan %6 %21 %24
+               OpSelectionMerge %27 None
+               OpBranchConditional %25 %26 %27
+         %26 = OpLabel
+         %28 = OpAccessChain %19 %14 %16 %18
+         %29 = OpLoad %10 %28
+         %30 = OpAccessChain %19 %14 %16 %22
+         %31 = OpLoad %10 %30
+         %32 = OpFOrdLessThan %6 %29 %31
+               OpSelectionMerge %34 None
+               OpBranchConditional %32 %33 %34
+         %33 = OpLabel
+               OpStore %8 %35
+               OpBranch %34
+         %34 = OpLabel
+               OpBranch %27
+         %27 = OpLabel
+         %36 = OpLoad %6 %8
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %37 %62
+         %37 = OpLabel
+         %48 = OpAccessChain %47 %46 %16 %16
+         %49 = OpLoad %15 %48
+         %50 = OpConvertSToF %10 %49
+         %52 = OpAccessChain %47 %46 %16 %51
+         %53 = OpLoad %15 %52
+         %54 = OpConvertSToF %10 %53
+         %55 = OpAccessChain %47 %46 %16 %51
+         %56 = OpLoad %15 %55
+         %57 = OpConvertSToF %10 %56
+         %58 = OpAccessChain %47 %46 %16 %16
+         %59 = OpLoad %15 %58
+         %60 = OpConvertSToF %10 %59
+         %61 = OpCompositeConstruct %39 %50 %54 %57 %60
+               OpStore %41 %61
+               OpBranch %38
+         %62 = OpLabel
+         %63 = OpAccessChain %47 %46 %16 %51
+         %64 = OpLoad %15 %63
+         %65 = OpConvertSToF %10 %64
+         %66 = OpCompositeConstruct %39 %65 %65 %65 %65
+               OpStore %41 %66
+               OpBranch %38
+         %38 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# v1
+BUFFER variant_v1 DATA_TYPE vec2<float> STD140 DATA
+ 0.0 1.0
+END
+# _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_v1 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-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop.amber
new file mode 100644 (file)
index 0000000..f927c31
--- /dev/null
@@ -0,0 +1,218 @@
+#!amber
+
+# Copyright 2020 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: Covers DAG combiner, cast combining and legalize vector types 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_3 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 2, 3]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     vec4 v = vec4(_int_3);
+#     for (int i = _int_0; i < _int_3; i++)
+#     {
+#         v.xyz[i] = float(i);
+#     }
+#     if (v == vec4(_int_0, _int_1, _int_2, _int_3))
+#     {
+#         _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; 8
+; Bound: 93
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %74
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "v"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %25 "i"
+               OpName %74 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %74 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Function %7
+         %10 = OpTypeInt 32 1
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 4
+         %13 = OpTypeArray %10 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %10 0
+         %18 = OpConstant %10 3
+         %19 = OpTypePointer Uniform %10
+         %24 = OpTypePointer Function %10
+         %36 = OpTypeBool
+         %39 = OpTypeVector %6 3
+         %42 = OpConstant %11 0
+         %43 = OpConstant %11 1
+         %44 = OpConstant %11 2
+         %45 = OpTypeVector %11 3
+         %46 = OpConstantComposite %45 %42 %43 %44
+         %48 = OpTypePointer Function %6
+         %51 = OpConstant %10 1
+         %60 = OpConstant %10 2
+         %68 = OpTypeVector %36 4
+         %73 = OpTypePointer Output %7
+         %74 = OpVariable %73 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %9 = OpVariable %8 Function
+         %25 = OpVariable %24 Function
+         %20 = OpAccessChain %19 %16 %17 %18
+         %21 = OpLoad %10 %20
+         %22 = OpConvertSToF %6 %21
+         %23 = OpCompositeConstruct %7 %22 %22 %22 %22
+               OpStore %9 %23
+         %26 = OpAccessChain %19 %16 %17 %17
+         %27 = OpLoad %10 %26
+               OpStore %25 %27
+               OpBranch %28
+         %28 = OpLabel
+               OpLoopMerge %30 %31 None
+               OpBranch %32
+         %32 = OpLabel
+         %33 = OpLoad %10 %25
+         %34 = OpAccessChain %19 %16 %17 %18
+         %35 = OpLoad %10 %34
+         %37 = OpSLessThan %36 %33 %35
+               OpBranchConditional %37 %29 %30
+         %29 = OpLabel
+         %38 = OpLoad %10 %25
+         %40 = OpLoad %10 %25
+         %41 = OpConvertSToF %6 %40
+         %47 = OpVectorExtractDynamic %11 %46 %38
+         %49 = OpAccessChain %48 %9 %47
+               OpStore %49 %41
+               OpBranch %31
+         %31 = OpLabel
+         %50 = OpLoad %10 %25
+         %52 = OpIAdd %10 %50 %51
+               OpStore %25 %52
+               OpBranch %28
+         %30 = OpLabel
+         %53 = OpLoad %7 %9
+         %54 = OpAccessChain %19 %16 %17 %17
+         %55 = OpLoad %10 %54
+         %56 = OpConvertSToF %6 %55
+         %57 = OpAccessChain %19 %16 %17 %51
+         %58 = OpLoad %10 %57
+         %59 = OpConvertSToF %6 %58
+         %61 = OpAccessChain %19 %16 %17 %60
+         %62 = OpLoad %10 %61
+         %63 = OpConvertSToF %6 %62
+         %64 = OpAccessChain %19 %16 %17 %18
+         %65 = OpLoad %10 %64
+         %66 = OpConvertSToF %6 %65
+         %67 = OpCompositeConstruct %7 %56 %59 %63 %66
+         %69 = OpFOrdEqual %68 %53 %67
+         %70 = OpAll %36 %69
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %71 %88
+         %71 = OpLabel
+         %75 = OpAccessChain %19 %16 %17 %51
+         %76 = OpLoad %10 %75
+         %77 = OpConvertSToF %6 %76
+         %78 = OpAccessChain %19 %16 %17 %17
+         %79 = OpLoad %10 %78
+         %80 = OpConvertSToF %6 %79
+         %81 = OpAccessChain %19 %16 %17 %17
+         %82 = OpLoad %10 %81
+         %83 = OpConvertSToF %6 %82
+         %84 = OpAccessChain %19 %16 %17 %51
+         %85 = OpLoad %10 %84
+         %86 = OpConvertSToF %6 %85
+         %87 = OpCompositeConstruct %7 %77 %80 %83 %86
+               OpStore %74 %87
+               OpBranch %72
+         %88 = OpLabel
+         %89 = OpAccessChain %19 %16 %17 %17
+         %90 = OpLoad %10 %89
+         %91 = OpConvertSToF %6 %90
+         %92 = OpCompositeConstruct %7 %91 %91 %91 %91
+               OpStore %74 %92
+               OpBranch %72
+         %72 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 2 3
+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-dag-combiner-findmsb-loop.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-findmsb-loop.amber
new file mode 100644 (file)
index 0000000..2ceacaf
--- /dev/null
@@ -0,0 +1,216 @@
+#!amber
+
+# Copyright 2020 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 a specific DAG combiner code path
+
+# 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 310 es
+# #define _int_3 _GLF_uniform_int_values[0]
+# #define _int_4 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [3, 4, 0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = _int_1;
+#
+#     // i = 0: a = 0 -> 2
+#     // i = 1: a = 2 -> 3
+#     // i = 2: a = 3 -> 4
+#     for (int i = _int_0; i < _int_3; i++)
+#     {
+#         do
+#         {
+#             a++;
+#         } while (findMSB(a) < _int_1);
+#     }
+#     if (a == _int_4)
+#     {
+#         _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; 8
+; Bound: 76
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %57
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %20 "i"
+               OpName %57 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %57 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 4
+         %11 = OpTypeArray %6 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpConstant %6 0
+         %16 = OpConstant %6 3
+         %17 = OpTypePointer Uniform %6
+         %21 = OpConstant %6 2
+         %32 = OpTypeBool
+         %39 = OpConstant %6 1
+         %54 = OpTypeFloat 32
+         %55 = OpTypeVector %54 4
+         %56 = OpTypePointer Output %55
+         %57 = OpVariable %56 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
+         %22 = OpAccessChain %17 %14 %15 %21
+         %23 = OpLoad %6 %22
+               OpStore %20 %23
+               OpBranch %24
+         %24 = OpLabel
+               OpLoopMerge %26 %27 None
+               OpBranch %28
+         %28 = OpLabel
+         %29 = OpLoad %6 %20
+         %30 = OpAccessChain %17 %14 %15 %15
+         %31 = OpLoad %6 %30
+         %33 = OpSLessThan %32 %29 %31
+               OpBranchConditional %33 %25 %26
+         %25 = OpLabel
+               OpBranch %34
+         %34 = OpLabel
+               OpLoopMerge %36 %37 None
+               OpBranch %35
+         %35 = OpLabel
+         %38 = OpLoad %6 %8
+         %40 = OpIAdd %6 %38 %39
+               OpStore %8 %40
+               OpBranch %37
+         %37 = OpLabel
+         %41 = OpLoad %6 %8
+         %42 = OpExtInst %6 %1 FindSMsb %41
+         %43 = OpAccessChain %17 %14 %15 %16
+         %44 = OpLoad %6 %43
+         %45 = OpSLessThan %32 %42 %44
+               OpBranchConditional %45 %34 %36
+         %36 = OpLabel
+               OpBranch %27
+         %27 = OpLabel
+         %46 = OpLoad %6 %20
+         %47 = OpIAdd %6 %46 %39
+               OpStore %20 %47
+               OpBranch %24
+         %26 = OpLabel
+         %48 = OpLoad %6 %8
+         %49 = OpAccessChain %17 %14 %15 %39
+         %50 = OpLoad %6 %49
+         %51 = OpIEqual %32 %48 %50
+               OpSelectionMerge %53 None
+               OpBranchConditional %51 %52 %71
+         %52 = OpLabel
+         %58 = OpAccessChain %17 %14 %15 %16
+         %59 = OpLoad %6 %58
+         %60 = OpConvertSToF %54 %59
+         %61 = OpAccessChain %17 %14 %15 %21
+         %62 = OpLoad %6 %61
+         %63 = OpConvertSToF %54 %62
+         %64 = OpAccessChain %17 %14 %15 %21
+         %65 = OpLoad %6 %64
+         %66 = OpConvertSToF %54 %65
+         %67 = OpAccessChain %17 %14 %15 %16
+         %68 = OpLoad %6 %67
+         %69 = OpConvertSToF %54 %68
+         %70 = OpCompositeConstruct %55 %60 %63 %66 %69
+               OpStore %57 %70
+               OpBranch %53
+         %71 = OpLabel
+         %72 = OpAccessChain %17 %14 %15 %21
+         %73 = OpLoad %6 %72
+         %74 = OpConvertSToF %54 %73
+         %75 = OpCompositeConstruct %55 %74 %74 %74 %74
+               OpStore %57 %75
+               OpBranch %53
+         %53 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32 DATA
+ 3 0 0 0
+ 4 0 0 0
+ 0 0 0 0
+ 1 0 0 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
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-increment-color.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-increment-color.amber
new file mode 100644 (file)
index 0000000..4d3297a
--- /dev/null
@@ -0,0 +1,179 @@
+#!amber
+
+# Copyright 2020 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 a specific DAG combiner code path
+
+# 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 310 es
+# #define _float_0_5 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _float_0_2 _GLF_uniform_float_values[2]
+# #define _float_1_0 _GLF_uniform_float_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [0.5, 0.0, 0.2, 1.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float a = _float_0_0;
+#     if (_float_1_0 > _float_0_5)
+#     {
+#         a += _float_0_5;
+#         _GLF_color = vec4(a);
+#         if (_float_1_0 > _float_0_0)
+#         {
+#             a += _GLF_color.x;
+#             _GLF_color = vec4(_float_0_2);
+#         }
+#     }
+#     _GLF_color = vec4(a, 0, 0, 1);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 60
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %36
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_float_values"
+               OpName %14 ""
+               OpName %36 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %36 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 4
+         %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 = OpConstant %15 3
+         %26 = OpTypeBool
+         %34 = OpTypeVector %6 4
+         %35 = OpTypePointer Output %34
+         %36 = OpVariable %35 Output
+         %46 = OpConstant %9 0
+         %47 = OpTypePointer Output %6
+         %52 = OpConstant %15 2
+         %57 = OpConstant %6 0
+         %58 = OpConstant %6 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %19 = OpAccessChain %18 %14 %16 %17
+         %20 = OpLoad %6 %19
+               OpStore %8 %20
+         %22 = OpAccessChain %18 %14 %16 %21
+         %23 = OpLoad %6 %22
+         %24 = OpAccessChain %18 %14 %16 %16
+         %25 = OpLoad %6 %24
+         %27 = OpFOrdGreaterThan %26 %23 %25
+               OpSelectionMerge %29 None
+               OpBranchConditional %27 %28 %29
+         %28 = OpLabel
+         %30 = OpAccessChain %18 %14 %16 %16
+         %31 = OpLoad %6 %30
+         %32 = OpLoad %6 %8
+         %33 = OpFAdd %6 %32 %31
+               OpStore %8 %33
+         %37 = OpLoad %6 %8
+         %38 = OpCompositeConstruct %34 %37 %37 %37 %37
+               OpStore %36 %38
+         %39 = OpAccessChain %18 %14 %16 %21
+         %40 = OpLoad %6 %39
+         %41 = OpAccessChain %18 %14 %16 %17
+         %42 = OpLoad %6 %41
+         %43 = OpFOrdGreaterThan %26 %40 %42
+               OpSelectionMerge %45 None
+               OpBranchConditional %43 %44 %45
+         %44 = OpLabel
+         %48 = OpAccessChain %47 %36 %46
+         %49 = OpLoad %6 %48
+         %50 = OpLoad %6 %8
+         %51 = OpFAdd %6 %50 %49
+               OpStore %8 %51
+         %53 = OpAccessChain %18 %14 %16 %52
+         %54 = OpLoad %6 %53
+         %55 = OpCompositeConstruct %34 %54 %54 %54 %54
+               OpStore %36 %55
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %29
+         %29 = OpLabel
+         %56 = OpLoad %6 %8
+         %59 = OpCompositeConstruct %34 %56 %57 %57 %58
+               OpStore %36 %59
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.5 0.0 0.2 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_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-inst-combine-compares-while-modulo.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-while-modulo.amber
new file mode 100644 (file)
index 0000000..8f1d5e8
--- /dev/null
@@ -0,0 +1,201 @@
+#!amber
+
+# Copyright 2020 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 a specific inst combine compares code path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_10 _GLF_uniform_int_values[2]
+# #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, 1, 10]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int i = _int_10;
+#     while (i >= 0)
+#     {
+#         if ((i % 2) == 0)
+#         {
+#             _GLF_color = vec4(1, _int_0, _int_0, _int_1);
+#         }
+#         else
+#         {
+#             _GLF_color = vec4(_float_1_0);
+#         }
+#         i--;
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 61
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %36
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "i"
+               OpName %12 "buf1"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %36 "_GLF_color"
+               OpName %52 "buf0"
+               OpMemberName %52 0 "_GLF_uniform_float_values"
+               OpName %54 ""
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %36 Location 0
+               OpDecorate %51 ArrayStride 16
+               OpMemberDecorate %52 0 Offset 0
+               OpDecorate %52 Block
+               OpDecorate %54 DescriptorSet 0
+               OpDecorate %54 Binding 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 2
+         %17 = OpTypePointer Uniform %6
+         %26 = OpTypeBool
+         %33 = OpTypeFloat 32
+         %34 = OpTypeVector %33 4
+         %35 = OpTypePointer Output %34
+         %36 = OpVariable %35 Output
+         %37 = OpConstant %33 1
+         %44 = OpConstant %6 1
+         %50 = OpConstant %9 1
+         %51 = OpTypeArray %33 %50
+         %52 = OpTypeStruct %51
+         %53 = OpTypePointer Uniform %52
+         %54 = OpVariable %53 Uniform
+         %55 = OpTypePointer Uniform %33
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %14 %15 %16
+         %19 = OpLoad %6 %18
+               OpStore %8 %19
+               OpBranch %20
+         %20 = OpLabel
+               OpLoopMerge %22 %23 None
+               OpBranch %24
+         %24 = OpLabel
+         %25 = OpLoad %6 %8
+         %27 = OpSGreaterThanEqual %26 %25 %15
+               OpBranchConditional %27 %21 %22
+         %21 = OpLabel
+         %28 = OpLoad %6 %8
+         %29 = OpSMod %6 %28 %16
+         %30 = OpIEqual %26 %29 %15
+               OpSelectionMerge %32 None
+               OpBranchConditional %30 %31 %49
+         %31 = OpLabel
+         %38 = OpAccessChain %17 %14 %15 %15
+         %39 = OpLoad %6 %38
+         %40 = OpConvertSToF %33 %39
+         %41 = OpAccessChain %17 %14 %15 %15
+         %42 = OpLoad %6 %41
+         %43 = OpConvertSToF %33 %42
+         %45 = OpAccessChain %17 %14 %15 %44
+         %46 = OpLoad %6 %45
+         %47 = OpConvertSToF %33 %46
+         %48 = OpCompositeConstruct %34 %37 %40 %43 %47
+               OpStore %36 %48
+               OpBranch %32
+         %49 = OpLabel
+         %56 = OpAccessChain %55 %54 %15 %15
+         %57 = OpLoad %33 %56
+         %58 = OpCompositeConstruct %34 %57 %57 %57 %57
+               OpStore %36 %58
+               OpBranch %32
+         %32 = OpLabel
+         %59 = OpLoad %6 %8
+         %60 = OpISub %6 %59 %44
+               OpStore %8 %60
+               OpBranch %23
+         %23 = OpLabel
+               OpBranch %20
+         %22 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 10
+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__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-inst-peephole-optimizer-acosh.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-peephole-optimizer-acosh.amber
new file mode 100644 (file)
index 0000000..0a5590c
--- /dev/null
@@ -0,0 +1,218 @@
+#!amber
+
+# Copyright 2020 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 a specific peephole optimizer code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _float_1_2 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: 1
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[1];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.2, 0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float a = _float_1_2;
+#
+#     // Always true.
+#     if (!(gl_FragCoord.x < _float_0_0))
+#     {
+#         // Always true.
+#         if (!(gl_FragCoord.x < _float_0_0))
+#         {
+#             // Always false.
+#             if (!(gl_FragCoord.x > _float_0_0))
+#             {
+#                 discard;
+#             }
+#             a = _float_1_0;
+#         }
+#     }
+#     _GLF_color = vec4(_int_1, acosh(a), acosh(a), _int_1);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 74
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %22 %56
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf1"
+               OpMemberName %12 0 "_GLF_uniform_float_values"
+               OpName %14 ""
+               OpName %22 "gl_FragCoord"
+               OpName %56 "_GLF_color"
+               OpName %59 "buf0"
+               OpMemberName %59 0 "_GLF_uniform_int_values"
+               OpName %61 ""
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %22 BuiltIn FragCoord
+               OpDecorate %56 Location 0
+               OpDecorate %58 ArrayStride 16
+               OpMemberDecorate %59 0 Offset 0
+               OpDecorate %59 Block
+               OpDecorate %61 DescriptorSet 0
+               OpDecorate %61 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %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 = OpTypeInt 32 1
+         %16 = OpConstant %15 0
+         %17 = OpTypePointer Uniform %6
+         %20 = OpTypeVector %6 4
+         %21 = OpTypePointer Input %20
+         %22 = OpVariable %21 Input
+         %23 = OpConstant %9 0
+         %24 = OpTypePointer Input %6
+         %27 = OpConstant %15 1
+         %30 = OpTypeBool
+         %52 = OpConstant %15 2
+         %55 = OpTypePointer Output %20
+         %56 = OpVariable %55 Output
+         %57 = OpConstant %9 1
+         %58 = OpTypeArray %15 %57
+         %59 = OpTypeStruct %58
+         %60 = OpTypePointer Uniform %59
+         %61 = OpVariable %60 Uniform
+         %62 = OpTypePointer Uniform %15
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %14 %16 %16
+         %19 = OpLoad %6 %18
+               OpStore %8 %19
+         %25 = OpAccessChain %24 %22 %23
+         %26 = OpLoad %6 %25
+         %28 = OpAccessChain %17 %14 %16 %27
+         %29 = OpLoad %6 %28
+         %31 = OpFOrdLessThan %30 %26 %29
+         %32 = OpLogicalNot %30 %31
+               OpSelectionMerge %34 None
+               OpBranchConditional %32 %33 %34
+         %33 = OpLabel
+         %35 = OpAccessChain %24 %22 %23
+         %36 = OpLoad %6 %35
+         %37 = OpAccessChain %17 %14 %16 %27
+         %38 = OpLoad %6 %37
+         %39 = OpFOrdLessThan %30 %36 %38
+         %40 = OpLogicalNot %30 %39
+               OpSelectionMerge %42 None
+               OpBranchConditional %40 %41 %42
+         %41 = OpLabel
+         %43 = OpAccessChain %24 %22 %23
+         %44 = OpLoad %6 %43
+         %45 = OpAccessChain %17 %14 %16 %27
+         %46 = OpLoad %6 %45
+         %47 = OpFOrdGreaterThan %30 %44 %46
+         %48 = OpLogicalNot %30 %47
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %50
+         %49 = OpLabel
+               OpKill
+         %50 = OpLabel
+         %53 = OpAccessChain %17 %14 %16 %52
+         %54 = OpLoad %6 %53
+               OpStore %8 %54
+               OpBranch %42
+         %42 = OpLabel
+               OpBranch %34
+         %34 = OpLabel
+         %63 = OpAccessChain %62 %61 %16 %16
+         %64 = OpLoad %15 %63
+         %65 = OpConvertSToF %6 %64
+         %66 = OpLoad %6 %8
+         %67 = OpExtInst %6 %1 Acosh %66
+         %68 = OpLoad %6 %8
+         %69 = OpExtInst %6 %1 Acosh %68
+         %70 = OpAccessChain %62 %61 %16 %16
+         %71 = OpLoad %15 %70
+         %72 = OpConvertSToF %6 %71
+         %73 = OpCompositeConstruct %20 %65 %67 %69 %72
+               OpStore %56 %73
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.2 0.0 1.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 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_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-inst-value-tracking-inversesqrt.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-value-tracking-inversesqrt.amber
new file mode 100644 (file)
index 0000000..e9fd249
--- /dev/null
@@ -0,0 +1,146 @@
+#!amber
+
+# Copyright 2020 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 a specific value tracking path
+
+# 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 310 es
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# 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];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     // Always false.
+#     if (inversesqrt(_float_1_0) < -1.0)
+#     {
+#         _GLF_color = vec4(_float_0_0);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_float_1_0, _float_0_0, _float_0_0, _float_1_0);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 41
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %27
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %10 "buf0"
+               OpMemberName %10 0 "_GLF_uniform_float_values"
+               OpName %12 ""
+               OpName %27 "_GLF_color"
+               OpDecorate %9 ArrayStride 16
+               OpMemberDecorate %10 0 Offset 0
+               OpDecorate %10 Block
+               OpDecorate %12 DescriptorSet 0
+               OpDecorate %12 Binding 0
+               OpDecorate %27 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 2
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypeStruct %9
+         %11 = OpTypePointer Uniform %10
+         %12 = OpVariable %11 Uniform
+         %13 = OpTypeInt 32 1
+         %14 = OpConstant %13 0
+         %15 = OpConstant %13 1
+         %16 = OpTypePointer Uniform %6
+         %20 = OpConstant %6 -1
+         %21 = OpTypeBool
+         %25 = OpTypeVector %6 4
+         %26 = OpTypePointer Output %25
+         %27 = OpVariable %26 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %17 = OpAccessChain %16 %12 %14 %15
+         %18 = OpLoad %6 %17
+         %19 = OpExtInst %6 %1 InverseSqrt %18
+         %22 = OpFOrdLessThan %21 %19 %20
+               OpSelectionMerge %24 None
+               OpBranchConditional %22 %23 %31
+         %23 = OpLabel
+         %28 = OpAccessChain %16 %12 %14 %14
+         %29 = OpLoad %6 %28
+         %30 = OpCompositeConstruct %25 %29 %29 %29 %29
+               OpStore %27 %30
+               OpBranch %24
+         %31 = OpLabel
+         %32 = OpAccessChain %16 %12 %14 %15
+         %33 = OpLoad %6 %32
+         %34 = OpAccessChain %16 %12 %14 %14
+         %35 = OpLoad %6 %34
+         %36 = OpAccessChain %16 %12 %14 %14
+         %37 = OpLoad %6 %36
+         %38 = OpAccessChain %16 %12 %14 %15
+         %39 = OpLoad %6 %38
+         %40 = OpCompositeConstruct %25 %33 %35 %37 %39
+               OpStore %27 %40
+               OpBranch %24
+         %24 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _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_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-instr-emitter-pow-asinh.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instr-emitter-pow-asinh.amber
new file mode 100644 (file)
index 0000000..5d0b736
--- /dev/null
@@ -0,0 +1,202 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction emitter code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_0_01 _GLF_uniform_float_values[0]
+# #define _float_3_0 _GLF_uniform_float_values[1]
+# #define _float_2_63 _GLF_uniform_float_values[2]
+# #define _float_1_0 _GLF_uniform_float_values[3]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.01, 3.0, 2.63, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float f = pow(_float_3_0, asinh(_float_1_0));
+#     if (abs(f - _float_2_63) < _float_0_01)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(abs(f - _float_2_63));
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 67
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %40
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "f"
+               OpName %12 "buf1"
+               OpMemberName %12 0 "_GLF_uniform_float_values"
+               OpName %14 ""
+               OpName %40 "_GLF_color"
+               OpName %43 "buf0"
+               OpMemberName %43 0 "_GLF_uniform_int_values"
+               OpName %45 ""
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %40 Location 0
+               OpDecorate %42 ArrayStride 16
+               OpMemberDecorate %43 0 RelaxedPrecision
+               OpMemberDecorate %43 0 Offset 0
+               OpDecorate %43 Block
+               OpDecorate %45 DescriptorSet 0
+               OpDecorate %45 Binding 0
+               OpDecorate %48 RelaxedPrecision
+               OpDecorate %51 RelaxedPrecision
+               OpDecorate %54 RelaxedPrecision
+               OpDecorate %57 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 4
+         %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 = OpConstant %15 3
+         %27 = OpConstant %15 2
+         %34 = OpTypeBool
+         %38 = OpTypeVector %6 4
+         %39 = OpTypePointer Output %38
+         %40 = OpVariable %39 Output
+         %41 = OpConstant %9 2
+         %42 = OpTypeArray %15 %41
+         %43 = OpTypeStruct %42
+         %44 = OpTypePointer Uniform %43
+         %45 = OpVariable %44 Uniform
+         %46 = OpTypePointer Uniform %15
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %19 = OpAccessChain %18 %14 %16 %17
+         %20 = OpLoad %6 %19
+         %22 = OpAccessChain %18 %14 %16 %21
+         %23 = OpLoad %6 %22
+         %24 = OpExtInst %6 %1 Asinh %23
+         %25 = OpExtInst %6 %1 Pow %20 %24
+               OpStore %8 %25
+         %26 = OpLoad %6 %8
+         %28 = OpAccessChain %18 %14 %16 %27
+         %29 = OpLoad %6 %28
+         %30 = OpFSub %6 %26 %29
+         %31 = OpExtInst %6 %1 FAbs %30
+         %32 = OpAccessChain %18 %14 %16 %16
+         %33 = OpLoad %6 %32
+         %35 = OpFOrdLessThan %34 %31 %33
+               OpSelectionMerge %37 None
+               OpBranchConditional %35 %36 %60
+         %36 = OpLabel
+         %47 = OpAccessChain %46 %45 %16 %16
+         %48 = OpLoad %15 %47
+         %49 = OpConvertSToF %6 %48
+         %50 = OpAccessChain %46 %45 %16 %17
+         %51 = OpLoad %15 %50
+         %52 = OpConvertSToF %6 %51
+         %53 = OpAccessChain %46 %45 %16 %17
+         %54 = OpLoad %15 %53
+         %55 = OpConvertSToF %6 %54
+         %56 = OpAccessChain %46 %45 %16 %16
+         %57 = OpLoad %15 %56
+         %58 = OpConvertSToF %6 %57
+         %59 = OpCompositeConstruct %38 %49 %52 %55 %58
+               OpStore %40 %59
+               OpBranch %37
+         %60 = OpLabel
+         %61 = OpLoad %6 %8
+         %62 = OpAccessChain %18 %14 %16 %27
+         %63 = OpLoad %6 %62
+         %64 = OpFSub %6 %61 %63
+         %65 = OpExtInst %6 %1 FAbs %64
+         %66 = OpCompositeConstruct %38 %65 %65 %65 %65
+               OpStore %40 %66
+               OpBranch %37
+         %37 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.01 3.0 2.63 1.0
+END
+# _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_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-instruction-simplify-atanh-log-undefined.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-atanh-log-undefined.amber
new file mode 100644 (file)
index 0000000..52fe7d5
--- /dev/null
@@ -0,0 +1,187 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+#     float a = atanh(_float_1_0) - log(-1.0);
+#     if (a != _float_0_0)
+#     {
+#         _GLF_color.g = _float_0_0;
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 57
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "_GLF_color"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %34 "a"
+               OpName %36 "buf1"
+               OpMemberName %36 0 "_GLF_uniform_float_values"
+               OpName %38 ""
+               OpDecorate %9 Location 0
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 RelaxedPrecision
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %20 RelaxedPrecision
+               OpDecorate %24 RelaxedPrecision
+               OpDecorate %27 RelaxedPrecision
+               OpDecorate %30 RelaxedPrecision
+               OpDecorate %35 ArrayStride 16
+               OpMemberDecorate %36 0 Offset 0
+               OpDecorate %36 Block
+               OpDecorate %38 DescriptorSet 0
+               OpDecorate %38 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpTypeInt 32 1
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 2
+         %13 = OpTypeArray %10 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %10 0
+         %18 = OpTypePointer Uniform %10
+         %22 = OpConstant %10 1
+         %33 = OpTypePointer Function %6
+         %35 = OpTypeArray %6 %12
+         %36 = OpTypeStruct %35
+         %37 = OpTypePointer Uniform %36
+         %38 = OpVariable %37 Uniform
+         %39 = OpTypePointer Uniform %6
+         %43 = OpConstant %6 0x1.8p+128
+         %48 = OpTypeBool
+         %54 = OpConstant %11 1
+         %55 = OpTypePointer Output %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %34 = OpVariable %33 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %10 %19
+         %21 = OpConvertSToF %6 %20
+         %23 = OpAccessChain %18 %16 %17 %22
+         %24 = OpLoad %10 %23
+         %25 = OpConvertSToF %6 %24
+         %26 = OpAccessChain %18 %16 %17 %22
+         %27 = OpLoad %10 %26
+         %28 = OpConvertSToF %6 %27
+         %29 = OpAccessChain %18 %16 %17 %17
+         %30 = OpLoad %10 %29
+         %31 = OpConvertSToF %6 %30
+         %32 = OpCompositeConstruct %7 %21 %25 %28 %31
+               OpStore %9 %32
+         %40 = OpAccessChain %39 %38 %17 %22
+         %41 = OpLoad %6 %40
+         %42 = OpExtInst %6 %1 Atanh %41
+         %44 = OpFSub %6 %42 %43
+               OpStore %34 %44
+         %45 = OpLoad %6 %34
+         %46 = OpAccessChain %39 %38 %17 %17
+         %47 = OpLoad %6 %46
+         %49 = OpFOrdNotEqual %48 %45 %47
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %50 %51
+         %50 = OpLabel
+         %52 = OpAccessChain %39 %38 %17 %17
+         %53 = OpLoad %6 %52
+         %56 = OpAccessChain %55 %9 %54
+               OpStore %56 %53
+               OpBranch %51
+         %51 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+# _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_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-instruction-simplify-bit-shifting.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-bit-shifting.amber
new file mode 100644 (file)
index 0000000..f23fe7b
--- /dev/null
@@ -0,0 +1,161 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification path
+
+# 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 310 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];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = 1 >> (_int_0 << 5) >> _int_0;
+#     if (a == 1)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(a);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 52
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %34
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %13 "buf0"
+               OpMemberName %13 0 "_GLF_uniform_int_values"
+               OpName %15 ""
+               OpName %34 "_GLF_color"
+               OpDecorate %12 ArrayStride 16
+               OpMemberDecorate %13 0 Offset 0
+               OpDecorate %13 Block
+               OpDecorate %15 DescriptorSet 0
+               OpDecorate %15 Binding 0
+               OpDecorate %34 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpTypeInt 32 0
+         %11 = OpConstant %10 2
+         %12 = OpTypeArray %6 %11
+         %13 = OpTypeStruct %12
+         %14 = OpTypePointer Uniform %13
+         %15 = OpVariable %14 Uniform
+         %16 = OpConstant %6 0
+         %17 = OpTypePointer Uniform %6
+         %20 = OpConstant %6 5
+         %27 = OpTypeBool
+         %31 = OpTypeFloat 32
+         %32 = OpTypeVector %31 4
+         %33 = OpTypePointer Output %32
+         %34 = OpVariable %33 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %15 %16 %16
+         %19 = OpLoad %6 %18
+         %21 = OpShiftLeftLogical %6 %19 %20
+         %22 = OpShiftRightArithmetic %6 %9 %21
+         %23 = OpAccessChain %17 %15 %16 %16
+         %24 = OpLoad %6 %23
+         %25 = OpShiftRightArithmetic %6 %22 %24
+               OpStore %8 %25
+         %26 = OpLoad %6 %8
+         %28 = OpIEqual %27 %26 %9
+               OpSelectionMerge %30 None
+               OpBranchConditional %28 %29 %48
+         %29 = OpLabel
+         %35 = OpAccessChain %17 %15 %16 %9
+         %36 = OpLoad %6 %35
+         %37 = OpConvertSToF %31 %36
+         %38 = OpAccessChain %17 %15 %16 %16
+         %39 = OpLoad %6 %38
+         %40 = OpConvertSToF %31 %39
+         %41 = OpAccessChain %17 %15 %16 %16
+         %42 = OpLoad %6 %41
+         %43 = OpConvertSToF %31 %42
+         %44 = OpAccessChain %17 %15 %16 %9
+         %45 = OpLoad %6 %44
+         %46 = OpConvertSToF %31 %45
+         %47 = OpCompositeConstruct %32 %37 %40 %43 %46
+               OpStore %34 %47
+               OpBranch %30
+         %48 = OpLabel
+         %49 = OpLoad %6 %8
+         %50 = OpConvertSToF %31 %49
+         %51 = OpCompositeConstruct %32 %50 %50 %50 %50
+               OpStore %34 %51
+               OpBranch %30
+         %30 = 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-instruction-simplify-inclusive-or.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-inclusive-or.amber
new file mode 100644 (file)
index 0000000..df7205c
--- /dev/null
@@ -0,0 +1,188 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+#
+# 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];
+# };
+#
+# // Contents of _GLF_uniform_float_values: 1.0
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float a = vec2(_int_0, _int_1)[_int_0 | 1];
+#     if (a == _float_1_0)
+#     {
+#         _GLF_color = vec4(a, _int_0, _int_0, a);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(a);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 59
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %46
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %13 "buf0"
+               OpMemberName %13 0 "_GLF_uniform_int_values"
+               OpName %15 ""
+               OpName %34 "buf1"
+               OpMemberName %34 0 "_GLF_uniform_float_values"
+               OpName %36 ""
+               OpName %46 "_GLF_color"
+               OpDecorate %12 ArrayStride 16
+               OpMemberDecorate %13 0 Offset 0
+               OpDecorate %13 Block
+               OpDecorate %15 DescriptorSet 0
+               OpDecorate %15 Binding 0
+               OpDecorate %33 ArrayStride 16
+               OpMemberDecorate %34 0 Offset 0
+               OpDecorate %34 Block
+               OpDecorate %36 DescriptorSet 0
+               OpDecorate %36 Binding 1
+               OpDecorate %46 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 1
+         %10 = OpTypeInt 32 0
+         %11 = OpConstant %10 2
+         %12 = OpTypeArray %9 %11
+         %13 = OpTypeStruct %12
+         %14 = OpTypePointer Uniform %13
+         %15 = OpVariable %14 Uniform
+         %16 = OpConstant %9 0
+         %17 = OpTypePointer Uniform %9
+         %21 = OpConstant %9 1
+         %25 = OpTypeVector %6 2
+         %32 = OpConstant %10 1
+         %33 = OpTypeArray %6 %32
+         %34 = OpTypeStruct %33
+         %35 = OpTypePointer Uniform %34
+         %36 = OpVariable %35 Uniform
+         %37 = OpTypePointer Uniform %6
+         %40 = OpTypeBool
+         %44 = OpTypeVector %6 4
+         %45 = OpTypePointer Output %44
+         %46 = OpVariable %45 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %15 %16 %16
+         %19 = OpLoad %9 %18
+         %20 = OpConvertSToF %6 %19
+         %22 = OpAccessChain %17 %15 %16 %21
+         %23 = OpLoad %9 %22
+         %24 = OpConvertSToF %6 %23
+         %26 = OpCompositeConstruct %25 %20 %24
+         %27 = OpAccessChain %17 %15 %16 %16
+         %28 = OpLoad %9 %27
+         %29 = OpBitwiseOr %9 %28 %21
+         %30 = OpVectorExtractDynamic %6 %26 %29
+               OpStore %8 %30
+         %31 = OpLoad %6 %8
+         %38 = OpAccessChain %37 %36 %16 %16
+         %39 = OpLoad %6 %38
+         %41 = OpFOrdEqual %40 %31 %39
+               OpSelectionMerge %43 None
+               OpBranchConditional %41 %42 %56
+         %42 = OpLabel
+         %47 = OpLoad %6 %8
+         %48 = OpAccessChain %17 %15 %16 %16
+         %49 = OpLoad %9 %48
+         %50 = OpConvertSToF %6 %49
+         %51 = OpAccessChain %17 %15 %16 %16
+         %52 = OpLoad %9 %51
+         %53 = OpConvertSToF %6 %52
+         %54 = OpLoad %6 %8
+         %55 = OpCompositeConstruct %44 %47 %50 %53 %54
+               OpStore %46 %55
+               OpBranch %43
+         %56 = OpLabel
+         %57 = OpLoad %6 %8
+         %58 = OpCompositeConstruct %44 %57 %57 %57 %57
+               OpStore %46 %58
+               OpBranch %43
+         %43 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0
+END
+# _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_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-instruction-simplify-inst-combine-calls-for-compare-function-call-result.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result.amber
new file mode 100644 (file)
index 0000000..c9439ee
--- /dev/null
@@ -0,0 +1,558 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_2 _GLF_uniform_int_values[1]
+# #define _int_3 _GLF_uniform_int_values[2]
+# #define _int_4 _GLF_uniform_int_values[3]
+# #define _int_5 _GLF_uniform_int_values[4]
+# #define _int_6 _GLF_uniform_int_values[5]
+# #define _int_10 _GLF_uniform_int_values[6]
+# #define _int_11 _GLF_uniform_int_values[7]
+# #define _int_7 _GLF_uniform_int_values[8]
+# #define _int_8 _GLF_uniform_int_values[9]
+# #define _int_9 _GLF_uniform_int_values[10]
+# #define _int_1 _GLF_uniform_int_values[11]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [0, 2, 3, 4, 5, 6, 10, 11, 7, 8, 9, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[12];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# // Always returns a.
+# int f(int a)
+# {
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         if (i > _int_3)
+#         {
+#             return a;
+#         }
+#     }
+#     return _int_0;
+# }
+# void main()
+# {
+#     int a[10];
+#     int ref[10];
+#     ref[_int_0] = _int_2;
+#     ref[_int_1] = _int_3;
+#     ref[_int_2] = _int_4;
+#     ref[_int_3] = _int_5;
+#     ref[_int_4] = _int_6;
+#
+#     ref[_int_5] = _int_10;
+#     ref[_int_6] = _int_11;
+#
+#     ref[_int_7] = _int_7;
+#     ref[_int_8] = _int_8;
+#     ref[_int_9] = _int_9;
+#
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         a[i] = i;
+#
+#         // True for i = 0..4.
+#         if (i < _int_10 / _int_2)
+#         {
+#             a[i] = i + _int_2;
+#
+#             // Always true.
+#             if (i < _int_10)
+#             {
+#                 continue;
+#             }
+#
+#             // Unreachable code below.
+#             a[i] = i + _int_7;
+#
+#             if (f(a[i]) < _int_7)
+#             {
+#                 a[i]--;
+#             }
+#         }
+#         else
+#         {
+#             // True for i = 5..6.
+#             if (f(a[i]) < _int_7)
+#             {
+#                 a[i] += _int_5;
+#             }
+#         }
+#     }
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         if (a[i] != ref[i])
+#         {
+#             _GLF_color = vec4(_int_0);
+#             return;
+#         }
+#     }
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 235
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %214
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %10 "f(i1;"
+               OpName %9 "a"
+               OpName %12 "i"
+               OpName %16 "buf0"
+               OpMemberName %16 0 "_GLF_uniform_int_values"
+               OpName %18 ""
+               OpName %53 "ref"
+               OpName %112 "i"
+               OpName %124 "a"
+               OpName %157 "param"
+               OpName %172 "param"
+               OpName %190 "i"
+               OpName %214 "_GLF_color"
+               OpDecorate %10 RelaxedPrecision
+               OpDecorate %9 RelaxedPrecision
+               OpDecorate %12 RelaxedPrecision
+               OpDecorate %15 ArrayStride 16
+               OpMemberDecorate %16 0 RelaxedPrecision
+               OpMemberDecorate %16 0 Offset 0
+               OpDecorate %16 Block
+               OpDecorate %18 DescriptorSet 0
+               OpDecorate %18 Binding 0
+               OpDecorate %22 RelaxedPrecision
+               OpDecorate %28 RelaxedPrecision
+               OpDecorate %31 RelaxedPrecision
+               OpDecorate %34 RelaxedPrecision
+               OpDecorate %37 RelaxedPrecision
+               OpDecorate %41 RelaxedPrecision
+               OpDecorate %43 RelaxedPrecision
+               OpDecorate %45 RelaxedPrecision
+               OpDecorate %47 RelaxedPrecision
+               OpDecorate %53 RelaxedPrecision
+               OpDecorate %55 RelaxedPrecision
+               OpDecorate %57 RelaxedPrecision
+               OpDecorate %61 RelaxedPrecision
+               OpDecorate %63 RelaxedPrecision
+               OpDecorate %66 RelaxedPrecision
+               OpDecorate %69 RelaxedPrecision
+               OpDecorate %72 RelaxedPrecision
+               OpDecorate %75 RelaxedPrecision
+               OpDecorate %78 RelaxedPrecision
+               OpDecorate %81 RelaxedPrecision
+               OpDecorate %84 RelaxedPrecision
+               OpDecorate %86 RelaxedPrecision
+               OpDecorate %89 RelaxedPrecision
+               OpDecorate %92 RelaxedPrecision
+               OpDecorate %96 RelaxedPrecision
+               OpDecorate %98 RelaxedPrecision
+               OpDecorate %102 RelaxedPrecision
+               OpDecorate %104 RelaxedPrecision
+               OpDecorate %108 RelaxedPrecision
+               OpDecorate %110 RelaxedPrecision
+               OpDecorate %112 RelaxedPrecision
+               OpDecorate %114 RelaxedPrecision
+               OpDecorate %120 RelaxedPrecision
+               OpDecorate %122 RelaxedPrecision
+               OpDecorate %124 RelaxedPrecision
+               OpDecorate %125 RelaxedPrecision
+               OpDecorate %126 RelaxedPrecision
+               OpDecorate %128 RelaxedPrecision
+               OpDecorate %130 RelaxedPrecision
+               OpDecorate %132 RelaxedPrecision
+               OpDecorate %133 RelaxedPrecision
+               OpDecorate %137 RelaxedPrecision
+               OpDecorate %138 RelaxedPrecision
+               OpDecorate %140 RelaxedPrecision
+               OpDecorate %141 RelaxedPrecision
+               OpDecorate %143 RelaxedPrecision
+               OpDecorate %145 RelaxedPrecision
+               OpDecorate %150 RelaxedPrecision
+               OpDecorate %151 RelaxedPrecision
+               OpDecorate %153 RelaxedPrecision
+               OpDecorate %154 RelaxedPrecision
+               OpDecorate %156 RelaxedPrecision
+               OpDecorate %159 RelaxedPrecision
+               OpDecorate %160 RelaxedPrecision
+               OpDecorate %162 RelaxedPrecision
+               OpDecorate %166 RelaxedPrecision
+               OpDecorate %168 RelaxedPrecision
+               OpDecorate %169 RelaxedPrecision
+               OpDecorate %171 RelaxedPrecision
+               OpDecorate %174 RelaxedPrecision
+               OpDecorate %175 RelaxedPrecision
+               OpDecorate %177 RelaxedPrecision
+               OpDecorate %181 RelaxedPrecision
+               OpDecorate %183 RelaxedPrecision
+               OpDecorate %185 RelaxedPrecision
+               OpDecorate %186 RelaxedPrecision
+               OpDecorate %188 RelaxedPrecision
+               OpDecorate %189 RelaxedPrecision
+               OpDecorate %190 RelaxedPrecision
+               OpDecorate %192 RelaxedPrecision
+               OpDecorate %198 RelaxedPrecision
+               OpDecorate %200 RelaxedPrecision
+               OpDecorate %202 RelaxedPrecision
+               OpDecorate %204 RelaxedPrecision
+               OpDecorate %205 RelaxedPrecision
+               OpDecorate %207 RelaxedPrecision
+               OpDecorate %214 Location 0
+               OpDecorate %216 RelaxedPrecision
+               OpDecorate %220 RelaxedPrecision
+               OpDecorate %221 RelaxedPrecision
+               OpDecorate %223 RelaxedPrecision
+               OpDecorate %226 RelaxedPrecision
+               OpDecorate %229 RelaxedPrecision
+               OpDecorate %232 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %8 = OpTypeFunction %6 %7
+         %13 = OpTypeInt 32 0
+         %14 = OpConstant %13 12
+         %15 = OpTypeArray %6 %14
+         %16 = OpTypeStruct %15
+         %17 = OpTypePointer Uniform %16
+         %18 = OpVariable %17 Uniform
+         %19 = OpConstant %6 0
+         %20 = OpTypePointer Uniform %6
+         %29 = OpConstant %6 6
+         %32 = OpTypeBool
+         %35 = OpConstant %6 2
+         %44 = OpConstant %6 1
+         %50 = OpConstant %13 10
+         %51 = OpTypeArray %6 %50
+         %52 = OpTypePointer Function %51
+         %59 = OpConstant %6 11
+         %67 = OpConstant %6 3
+         %73 = OpConstant %6 4
+         %79 = OpConstant %6 5
+         %90 = OpConstant %6 7
+         %94 = OpConstant %6 8
+        %100 = OpConstant %6 9
+        %106 = OpConstant %6 10
+        %211 = OpTypeFloat 32
+        %212 = OpTypeVector %211 4
+        %213 = OpTypePointer Output %212
+        %214 = OpVariable %213 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %53 = OpVariable %52 Function
+        %112 = OpVariable %7 Function
+        %124 = OpVariable %52 Function
+        %157 = OpVariable %7 Function
+        %172 = OpVariable %7 Function
+        %190 = OpVariable %7 Function
+         %54 = OpAccessChain %20 %18 %19 %19
+         %55 = OpLoad %6 %54
+         %56 = OpAccessChain %20 %18 %19 %44
+         %57 = OpLoad %6 %56
+         %58 = OpAccessChain %7 %53 %55
+               OpStore %58 %57
+         %60 = OpAccessChain %20 %18 %19 %59
+         %61 = OpLoad %6 %60
+         %62 = OpAccessChain %20 %18 %19 %35
+         %63 = OpLoad %6 %62
+         %64 = OpAccessChain %7 %53 %61
+               OpStore %64 %63
+         %65 = OpAccessChain %20 %18 %19 %44
+         %66 = OpLoad %6 %65
+         %68 = OpAccessChain %20 %18 %19 %67
+         %69 = OpLoad %6 %68
+         %70 = OpAccessChain %7 %53 %66
+               OpStore %70 %69
+         %71 = OpAccessChain %20 %18 %19 %35
+         %72 = OpLoad %6 %71
+         %74 = OpAccessChain %20 %18 %19 %73
+         %75 = OpLoad %6 %74
+         %76 = OpAccessChain %7 %53 %72
+               OpStore %76 %75
+         %77 = OpAccessChain %20 %18 %19 %67
+         %78 = OpLoad %6 %77
+         %80 = OpAccessChain %20 %18 %19 %79
+         %81 = OpLoad %6 %80
+         %82 = OpAccessChain %7 %53 %78
+               OpStore %82 %81
+         %83 = OpAccessChain %20 %18 %19 %73
+         %84 = OpLoad %6 %83
+         %85 = OpAccessChain %20 %18 %19 %29
+         %86 = OpLoad %6 %85
+         %87 = OpAccessChain %7 %53 %84
+               OpStore %87 %86
+         %88 = OpAccessChain %20 %18 %19 %79
+         %89 = OpLoad %6 %88
+         %91 = OpAccessChain %20 %18 %19 %90
+         %92 = OpLoad %6 %91
+         %93 = OpAccessChain %7 %53 %89
+               OpStore %93 %92
+         %95 = OpAccessChain %20 %18 %19 %94
+         %96 = OpLoad %6 %95
+         %97 = OpAccessChain %20 %18 %19 %94
+         %98 = OpLoad %6 %97
+         %99 = OpAccessChain %7 %53 %96
+               OpStore %99 %98
+        %101 = OpAccessChain %20 %18 %19 %100
+        %102 = OpLoad %6 %101
+        %103 = OpAccessChain %20 %18 %19 %100
+        %104 = OpLoad %6 %103
+        %105 = OpAccessChain %7 %53 %102
+               OpStore %105 %104
+        %107 = OpAccessChain %20 %18 %19 %106
+        %108 = OpLoad %6 %107
+        %109 = OpAccessChain %20 %18 %19 %106
+        %110 = OpLoad %6 %109
+        %111 = OpAccessChain %7 %53 %108
+               OpStore %111 %110
+        %113 = OpAccessChain %20 %18 %19 %19
+        %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 %20 %18 %19 %29
+        %122 = OpLoad %6 %121
+        %123 = OpSLessThan %32 %120 %122
+               OpBranchConditional %123 %116 %117
+        %116 = OpLabel
+        %125 = OpLoad %6 %112
+        %126 = OpLoad %6 %112
+        %127 = OpAccessChain %7 %124 %125
+               OpStore %127 %126
+        %128 = OpLoad %6 %112
+        %129 = OpAccessChain %20 %18 %19 %29
+        %130 = OpLoad %6 %129
+        %131 = OpAccessChain %20 %18 %19 %44
+        %132 = OpLoad %6 %131
+        %133 = OpSDiv %6 %130 %132
+        %134 = OpSLessThan %32 %128 %133
+               OpSelectionMerge %136 None
+               OpBranchConditional %134 %135 %170
+        %135 = OpLabel
+        %137 = OpLoad %6 %112
+        %138 = OpLoad %6 %112
+        %139 = OpAccessChain %20 %18 %19 %44
+        %140 = OpLoad %6 %139
+        %141 = OpIAdd %6 %138 %140
+        %142 = OpAccessChain %7 %124 %137
+               OpStore %142 %141
+        %143 = OpLoad %6 %112
+        %144 = OpAccessChain %20 %18 %19 %29
+        %145 = OpLoad %6 %144
+        %146 = OpSLessThan %32 %143 %145
+               OpSelectionMerge %148 None
+               OpBranchConditional %146 %147 %148
+        %147 = OpLabel
+               OpBranch %118
+        %148 = OpLabel
+        %150 = OpLoad %6 %112
+        %151 = OpLoad %6 %112
+        %152 = OpAccessChain %20 %18 %19 %94
+        %153 = OpLoad %6 %152
+        %154 = OpIAdd %6 %151 %153
+        %155 = OpAccessChain %7 %124 %150
+               OpStore %155 %154
+        %156 = OpLoad %6 %112
+        %158 = OpAccessChain %7 %124 %156
+        %159 = OpLoad %6 %158
+               OpStore %157 %159
+        %160 = OpFunctionCall %6 %10 %157
+        %161 = OpAccessChain %20 %18 %19 %94
+        %162 = OpLoad %6 %161
+        %163 = OpSLessThan %32 %160 %162
+               OpSelectionMerge %165 None
+               OpBranchConditional %163 %164 %165
+        %164 = OpLabel
+        %166 = OpLoad %6 %112
+        %167 = OpAccessChain %7 %124 %166
+        %168 = OpLoad %6 %167
+        %169 = OpISub %6 %168 %44
+               OpStore %167 %169
+               OpBranch %165
+        %165 = OpLabel
+               OpBranch %136
+        %170 = OpLabel
+        %171 = OpLoad %6 %112
+        %173 = OpAccessChain %7 %124 %171
+        %174 = OpLoad %6 %173
+               OpStore %172 %174
+        %175 = OpFunctionCall %6 %10 %172
+        %176 = OpAccessChain %20 %18 %19 %94
+        %177 = OpLoad %6 %176
+        %178 = OpSLessThan %32 %175 %177
+               OpSelectionMerge %180 None
+               OpBranchConditional %178 %179 %180
+        %179 = OpLabel
+        %181 = OpLoad %6 %112
+        %182 = OpAccessChain %20 %18 %19 %73
+        %183 = OpLoad %6 %182
+        %184 = OpAccessChain %7 %124 %181
+        %185 = OpLoad %6 %184
+        %186 = OpIAdd %6 %185 %183
+        %187 = OpAccessChain %7 %124 %181
+               OpStore %187 %186
+               OpBranch %180
+        %180 = OpLabel
+               OpBranch %136
+        %136 = OpLabel
+               OpBranch %118
+        %118 = OpLabel
+        %188 = OpLoad %6 %112
+        %189 = OpIAdd %6 %188 %44
+               OpStore %112 %189
+               OpBranch %115
+        %117 = OpLabel
+        %191 = OpAccessChain %20 %18 %19 %19
+        %192 = OpLoad %6 %191
+               OpStore %190 %192
+               OpBranch %193
+        %193 = OpLabel
+               OpLoopMerge %195 %196 None
+               OpBranch %197
+        %197 = OpLabel
+        %198 = OpLoad %6 %190
+        %199 = OpAccessChain %20 %18 %19 %29
+        %200 = OpLoad %6 %199
+        %201 = OpSLessThan %32 %198 %200
+               OpBranchConditional %201 %194 %195
+        %194 = OpLabel
+        %202 = OpLoad %6 %190
+        %203 = OpAccessChain %7 %124 %202
+        %204 = OpLoad %6 %203
+        %205 = OpLoad %6 %190
+        %206 = OpAccessChain %7 %53 %205
+        %207 = OpLoad %6 %206
+        %208 = OpINotEqual %32 %204 %207
+               OpSelectionMerge %210 None
+               OpBranchConditional %208 %209 %210
+        %209 = OpLabel
+        %215 = OpAccessChain %20 %18 %19 %19
+        %216 = OpLoad %6 %215
+        %217 = OpConvertSToF %211 %216
+        %218 = OpCompositeConstruct %212 %217 %217 %217 %217
+               OpStore %214 %218
+               OpReturn
+        %210 = OpLabel
+               OpBranch %196
+        %196 = OpLabel
+        %220 = OpLoad %6 %190
+        %221 = OpIAdd %6 %220 %44
+               OpStore %190 %221
+               OpBranch %193
+        %195 = OpLabel
+        %222 = OpAccessChain %20 %18 %19 %59
+        %223 = OpLoad %6 %222
+        %224 = OpConvertSToF %211 %223
+        %225 = OpAccessChain %20 %18 %19 %19
+        %226 = OpLoad %6 %225
+        %227 = OpConvertSToF %211 %226
+        %228 = OpAccessChain %20 %18 %19 %19
+        %229 = OpLoad %6 %228
+        %230 = OpConvertSToF %211 %229
+        %231 = OpAccessChain %20 %18 %19 %59
+        %232 = OpLoad %6 %231
+        %233 = OpConvertSToF %211 %232
+        %234 = OpCompositeConstruct %212 %224 %227 %230 %233
+               OpStore %214 %234
+               OpReturn
+               OpFunctionEnd
+         %10 = OpFunction %6 None %8
+          %9 = OpFunctionParameter %7
+         %11 = OpLabel
+         %12 = OpVariable %7 Function
+         %21 = OpAccessChain %20 %18 %19 %19
+         %22 = OpLoad %6 %21
+               OpStore %12 %22
+               OpBranch %23
+         %23 = OpLabel
+               OpLoopMerge %25 %26 None
+               OpBranch %27
+         %27 = OpLabel
+         %28 = OpLoad %6 %12
+         %30 = OpAccessChain %20 %18 %19 %29
+         %31 = OpLoad %6 %30
+         %33 = OpSLessThan %32 %28 %31
+               OpBranchConditional %33 %24 %25
+         %24 = OpLabel
+         %34 = OpLoad %6 %12
+         %36 = OpAccessChain %20 %18 %19 %35
+         %37 = OpLoad %6 %36
+         %38 = OpSGreaterThan %32 %34 %37
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %39 %40
+         %39 = OpLabel
+         %41 = OpLoad %6 %9
+               OpReturnValue %41
+         %40 = OpLabel
+               OpBranch %26
+         %26 = OpLabel
+         %43 = OpLoad %6 %12
+         %45 = OpIAdd %6 %43 %44
+               OpStore %12 %45
+               OpBranch %23
+         %25 = OpLabel
+         %46 = OpAccessChain %20 %18 %19 %19
+         %47 = OpLoad %6 %46
+               OpReturnValue %47
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 2 3 4 5 6 10 11 7 8 9 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-instruction-simplify-mod-acos-undefined.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-mod-acos-undefined.amber
new file mode 100644 (file)
index 0000000..a25ff29
--- /dev/null
@@ -0,0 +1,185 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     float a = mod(_float_1_0, acos(1.01));
+#     if (a != _float_0_0)
+#     {
+#         _GLF_color.g = _float_0_0;
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 56
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "_GLF_color"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %34 "a"
+               OpName %36 "buf1"
+               OpMemberName %36 0 "_GLF_uniform_float_values"
+               OpName %38 ""
+               OpDecorate %9 Location 0
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 RelaxedPrecision
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %20 RelaxedPrecision
+               OpDecorate %24 RelaxedPrecision
+               OpDecorate %27 RelaxedPrecision
+               OpDecorate %30 RelaxedPrecision
+               OpDecorate %35 ArrayStride 16
+               OpMemberDecorate %36 0 Offset 0
+               OpDecorate %36 Block
+               OpDecorate %38 DescriptorSet 0
+               OpDecorate %38 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpTypeInt 32 1
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 2
+         %13 = OpTypeArray %10 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %10 0
+         %18 = OpTypePointer Uniform %10
+         %22 = OpConstant %10 1
+         %33 = OpTypePointer Function %6
+         %35 = OpTypeArray %6 %12
+         %36 = OpTypeStruct %35
+         %37 = OpTypePointer Uniform %36
+         %38 = OpVariable %37 Uniform
+         %39 = OpTypePointer Uniform %6
+         %42 = OpConstant %6 0x1.8p+128
+         %47 = OpTypeBool
+         %53 = OpConstant %11 1
+         %54 = OpTypePointer Output %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %34 = OpVariable %33 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %10 %19
+         %21 = OpConvertSToF %6 %20
+         %23 = OpAccessChain %18 %16 %17 %22
+         %24 = OpLoad %10 %23
+         %25 = OpConvertSToF %6 %24
+         %26 = OpAccessChain %18 %16 %17 %22
+         %27 = OpLoad %10 %26
+         %28 = OpConvertSToF %6 %27
+         %29 = OpAccessChain %18 %16 %17 %17
+         %30 = OpLoad %10 %29
+         %31 = OpConvertSToF %6 %30
+         %32 = OpCompositeConstruct %7 %21 %25 %28 %31
+               OpStore %9 %32
+         %40 = OpAccessChain %39 %38 %17 %22
+         %41 = OpLoad %6 %40
+         %43 = OpFMod %6 %41 %42
+               OpStore %34 %43
+         %44 = OpLoad %6 %34
+         %45 = OpAccessChain %39 %38 %17 %17
+         %46 = OpLoad %6 %45
+         %48 = OpFOrdNotEqual %47 %44 %46
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %50
+         %49 = OpLabel
+         %51 = OpAccessChain %39 %38 %17 %17
+         %52 = OpLoad %6 %51
+         %55 = OpAccessChain %54 %9 %53
+               OpStore %55 %52
+               OpBranch %50
+         %50 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+# _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_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-instruction-simplify-mod-sqrt-undefined.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-mod-sqrt-undefined.amber
new file mode 100644 (file)
index 0000000..720d331
--- /dev/null
@@ -0,0 +1,185 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+#     float a = mod(sqrt(-1.), _float_1_0);
+#     if (a != _float_0_0)
+#     {
+#         _GLF_color.g = _float_0_0;
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 56
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "_GLF_color"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %34 "a"
+               OpName %37 "buf1"
+               OpMemberName %37 0 "_GLF_uniform_float_values"
+               OpName %39 ""
+               OpDecorate %9 Location 0
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 RelaxedPrecision
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %20 RelaxedPrecision
+               OpDecorate %24 RelaxedPrecision
+               OpDecorate %27 RelaxedPrecision
+               OpDecorate %30 RelaxedPrecision
+               OpDecorate %36 ArrayStride 16
+               OpMemberDecorate %37 0 Offset 0
+               OpDecorate %37 Block
+               OpDecorate %39 DescriptorSet 0
+               OpDecorate %39 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpTypeInt 32 1
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 2
+         %13 = OpTypeArray %10 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %10 0
+         %18 = OpTypePointer Uniform %10
+         %22 = OpConstant %10 1
+         %33 = OpTypePointer Function %6
+         %35 = OpConstant %6 -0x1.8p+128
+         %36 = OpTypeArray %6 %12
+         %37 = OpTypeStruct %36
+         %38 = OpTypePointer Uniform %37
+         %39 = OpVariable %38 Uniform
+         %40 = OpTypePointer Uniform %6
+         %47 = OpTypeBool
+         %53 = OpConstant %11 1
+         %54 = OpTypePointer Output %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %34 = OpVariable %33 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %10 %19
+         %21 = OpConvertSToF %6 %20
+         %23 = OpAccessChain %18 %16 %17 %22
+         %24 = OpLoad %10 %23
+         %25 = OpConvertSToF %6 %24
+         %26 = OpAccessChain %18 %16 %17 %22
+         %27 = OpLoad %10 %26
+         %28 = OpConvertSToF %6 %27
+         %29 = OpAccessChain %18 %16 %17 %17
+         %30 = OpLoad %10 %29
+         %31 = OpConvertSToF %6 %30
+         %32 = OpCompositeConstruct %7 %21 %25 %28 %31
+               OpStore %9 %32
+         %41 = OpAccessChain %40 %39 %17 %22
+         %42 = OpLoad %6 %41
+         %43 = OpFMod %6 %35 %42
+               OpStore %34 %43
+         %44 = OpLoad %6 %34
+         %45 = OpAccessChain %40 %39 %17 %17
+         %46 = OpLoad %6 %45
+         %48 = OpFOrdNotEqual %47 %44 %46
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %50
+         %49 = OpLabel
+         %51 = OpAccessChain %40 %39 %17 %17
+         %52 = OpLoad %6 %51
+         %55 = OpAccessChain %54 %9 %53
+               OpStore %55 %52
+               OpBranch %50
+         %50 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+# _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_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-instruction-simplify-sqrt.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-sqrt.amber
new file mode 100644 (file)
index 0000000..8743e6f
--- /dev/null
@@ -0,0 +1,182 @@
+#!amber
+
+# Copyright 2020 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 a specific instruction simplify code path
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '-O'
+# spirv-opt commit hash: a187dd58a0485988841d325a85c8e6063f53500a
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float a = _float_1_0;
+#     a = -1.;
+#     if (sqrt(_float_0_0) < a)
+#     {
+#         _GLF_color = vec4(_int_0);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 56
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %31
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_float_values"
+               OpName %14 ""
+               OpName %31 "_GLF_color"
+               OpName %33 "buf1"
+               OpMemberName %33 0 "_GLF_uniform_int_values"
+               OpName %35 ""
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %31 Location 0
+               OpDecorate %32 ArrayStride 16
+               OpMemberDecorate %33 0 RelaxedPrecision
+               OpMemberDecorate %33 0 Offset 0
+               OpDecorate %33 Block
+               OpDecorate %35 DescriptorSet 0
+               OpDecorate %35 Binding 1
+               OpDecorate %39 RelaxedPrecision
+               OpDecorate %44 RelaxedPrecision
+               OpDecorate %47 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %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 = OpTypePointer Uniform %6
+         %20 = OpConstant %6 -1
+         %25 = OpTypeBool
+         %29 = OpTypeVector %6 4
+         %30 = OpTypePointer Output %29
+         %31 = OpVariable %30 Output
+         %32 = OpTypeArray %15 %10
+         %33 = OpTypeStruct %32
+         %34 = OpTypePointer Uniform %33
+         %35 = OpVariable %34 Uniform
+         %36 = OpConstant %15 1
+         %37 = OpTypePointer Uniform %15
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %21 = OpAccessChain %17 %14 %16 %16
+         %22 = OpLoad %6 %21
+         %23 = OpExtInst %6 %1 Sqrt %22
+         %26 = OpFOrdLessThan %25 %23 %20
+               OpSelectionMerge %28 None
+               OpBranchConditional %26 %27 %42
+         %27 = OpLabel
+         %38 = OpAccessChain %37 %35 %16 %36
+         %39 = OpLoad %15 %38
+         %40 = OpConvertSToF %6 %39
+         %41 = OpCompositeConstruct %29 %40 %40 %40 %40
+               OpStore %31 %41
+               OpBranch %28
+         %42 = OpLabel
+         %43 = OpAccessChain %37 %35 %16 %16
+         %44 = OpLoad %15 %43
+         %45 = OpConvertSToF %6 %44
+         %46 = OpAccessChain %37 %35 %16 %36
+         %47 = OpLoad %15 %46
+         %48 = OpConvertSToF %6 %47
+         %55 = OpCompositeConstruct %29 %45 %48 %48 %45
+               OpStore %31 %55
+               OpBranch %28
+         %28 = 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
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.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-instructions-first-value-phi.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instructions-first-value-phi.amber
new file mode 100644 (file)
index 0000000..4bd7faf
--- /dev/null
@@ -0,0 +1,403 @@
+#!amber
+
+# Copyright 2020 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 a specific instructions code path
+
+# 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 310 es
+# #define _int_3 _GLF_uniform_int_values[0]
+# #define _int_2 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+# #define _int_5 _GLF_uniform_int_values[4]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [3, 2, 0, 1, 5]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[5];
+# };
+#
+# // Contents of v1: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     vec2 v1;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# struct S {
+#     int data;
+# };
+#
+# void func(inout S s)
+# {
+#     // Always false.
+#     if (v1.x > v1.y)
+#     {
+#         return;
+#     }
+#     s.data = _int_3;
+# }
+# void main()
+# {
+#     S arr[3];
+#     for (int i = _int_0; i < _int_3; i++)
+#     {
+#         arr[i].data = i;
+#     }
+#     for (int i = _int_0; i < _int_3; i++)
+#     {
+#         // Always false.
+#         if (v1.x > v1.y)
+#         {
+#             break;
+#         }
+#         // True for i == 1.
+#         if (arr[i].data == _int_1)
+#         {
+#             func(arr[i]);
+#         }
+#         else
+#         {
+#             for (int j = _int_0; j < _int_3; j++)
+#             {
+#                 // Always false.
+#                 if (arr[j].data > _int_5)
+#                 {
+#                     discard;
+#                 }
+#             }
+#         }
+#     }
+#     if (arr[_int_0].data == _int_0 && arr[_int_1].data == _int_3 &&
+#         arr[_int_2].data == _int_2)
+#     {
+#         _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; 8
+; Bound: 178
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %159
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %7 "S"
+               OpMemberName %7 0 "data"
+               OpName %11 "func(struct-S-i11;"
+               OpName %10 "s"
+               OpName %15 "buf1"
+               OpMemberName %15 0 "v1"
+               OpName %17 ""
+               OpName %34 "buf0"
+               OpMemberName %34 0 "_GLF_uniform_int_values"
+               OpName %36 ""
+               OpName %42 "i"
+               OpName %58 "arr"
+               OpName %65 "i"
+               OpName %95 "param"
+               OpName %102 "j"
+               OpName %159 "_GLF_color"
+               OpMemberDecorate %15 0 Offset 0
+               OpDecorate %15 Block
+               OpDecorate %17 DescriptorSet 0
+               OpDecorate %17 Binding 1
+               OpDecorate %33 ArrayStride 16
+               OpMemberDecorate %34 0 Offset 0
+               OpDecorate %34 Block
+               OpDecorate %36 DescriptorSet 0
+               OpDecorate %36 Binding 0
+               OpDecorate %159 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeStruct %6
+          %8 = OpTypePointer Function %7
+          %9 = OpTypeFunction %2 %8
+         %13 = OpTypeFloat 32
+         %14 = OpTypeVector %13 2
+         %15 = OpTypeStruct %14
+         %16 = OpTypePointer Uniform %15
+         %17 = OpVariable %16 Uniform
+         %18 = OpConstant %6 0
+         %19 = OpTypeInt 32 0
+         %20 = OpConstant %19 0
+         %21 = OpTypePointer Uniform %13
+         %24 = OpConstant %19 1
+         %27 = OpTypeBool
+         %32 = OpConstant %19 5
+         %33 = OpTypeArray %6 %32
+         %34 = OpTypeStruct %33
+         %35 = OpTypePointer Uniform %34
+         %36 = OpVariable %35 Uniform
+         %37 = OpTypePointer Uniform %6
+         %40 = OpTypePointer Function %6
+         %43 = OpConstant %6 2
+         %55 = OpConstant %19 3
+         %56 = OpTypeArray %7 %55
+         %57 = OpTypePointer Function %56
+         %63 = OpConstant %6 1
+         %88 = OpConstant %6 3
+        %117 = OpConstant %6 4
+        %157 = OpTypeVector %13 4
+        %158 = OpTypePointer Output %157
+        %159 = OpVariable %158 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %42 = OpVariable %40 Function
+         %58 = OpVariable %57 Function
+         %65 = OpVariable %40 Function
+         %95 = OpVariable %8 Function
+        %102 = OpVariable %40 Function
+         %44 = OpAccessChain %37 %36 %18 %43
+         %45 = OpLoad %6 %44
+               OpStore %42 %45
+               OpBranch %46
+         %46 = OpLabel
+               OpLoopMerge %48 %49 None
+               OpBranch %50
+         %50 = OpLabel
+         %51 = OpLoad %6 %42
+         %52 = OpAccessChain %37 %36 %18 %18
+         %53 = OpLoad %6 %52
+         %54 = OpSLessThan %27 %51 %53
+               OpBranchConditional %54 %47 %48
+         %47 = OpLabel
+         %59 = OpLoad %6 %42
+         %60 = OpLoad %6 %42
+         %61 = OpAccessChain %40 %58 %59 %18
+               OpStore %61 %60
+               OpBranch %49
+         %49 = OpLabel
+         %62 = OpLoad %6 %42
+         %64 = OpIAdd %6 %62 %63
+               OpStore %42 %64
+               OpBranch %46
+         %48 = OpLabel
+         %66 = OpAccessChain %37 %36 %18 %43
+         %67 = OpLoad %6 %66
+               OpStore %65 %67
+               OpBranch %68
+         %68 = OpLabel
+               OpLoopMerge %70 %71 None
+               OpBranch %72
+         %72 = OpLabel
+         %73 = OpLoad %6 %65
+         %74 = OpAccessChain %37 %36 %18 %18
+         %75 = OpLoad %6 %74
+         %76 = OpSLessThan %27 %73 %75
+               OpBranchConditional %76 %69 %70
+         %69 = OpLabel
+         %77 = OpAccessChain %21 %17 %18 %20
+         %78 = OpLoad %13 %77
+         %79 = OpAccessChain %21 %17 %18 %24
+         %80 = OpLoad %13 %79
+         %81 = OpFOrdGreaterThan %27 %78 %80
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %82 %83
+         %82 = OpLabel
+               OpBranch %70
+         %83 = OpLabel
+         %85 = OpLoad %6 %65
+         %86 = OpAccessChain %40 %58 %85 %18
+         %87 = OpLoad %6 %86
+         %89 = OpAccessChain %37 %36 %18 %88
+         %90 = OpLoad %6 %89
+         %91 = OpIEqual %27 %87 %90
+               OpSelectionMerge %93 None
+               OpBranchConditional %91 %92 %101
+         %92 = OpLabel
+         %94 = OpLoad %6 %65
+         %96 = OpAccessChain %8 %58 %94
+         %97 = OpLoad %7 %96
+               OpStore %95 %97
+         %98 = OpFunctionCall %2 %11 %95
+         %99 = OpLoad %7 %95
+        %100 = OpAccessChain %8 %58 %94
+               OpStore %100 %99
+               OpBranch %93
+        %101 = OpLabel
+        %103 = OpAccessChain %37 %36 %18 %43
+        %104 = OpLoad %6 %103
+               OpStore %102 %104
+               OpBranch %105
+        %105 = OpLabel
+               OpLoopMerge %107 %108 None
+               OpBranch %109
+        %109 = OpLabel
+        %110 = OpLoad %6 %102
+        %111 = OpAccessChain %37 %36 %18 %18
+        %112 = OpLoad %6 %111
+        %113 = OpSLessThan %27 %110 %112
+               OpBranchConditional %113 %106 %107
+        %106 = OpLabel
+        %114 = OpLoad %6 %102
+        %115 = OpAccessChain %40 %58 %114 %18
+        %116 = OpLoad %6 %115
+        %118 = OpAccessChain %37 %36 %18 %117
+        %119 = OpLoad %6 %118
+        %120 = OpSGreaterThan %27 %116 %119
+               OpSelectionMerge %122 None
+               OpBranchConditional %120 %121 %122
+        %121 = OpLabel
+               OpKill
+        %122 = OpLabel
+               OpBranch %108
+        %108 = OpLabel
+        %124 = OpLoad %6 %102
+        %125 = OpIAdd %6 %124 %63
+               OpStore %102 %125
+               OpBranch %105
+        %107 = OpLabel
+               OpBranch %93
+         %93 = OpLabel
+               OpBranch %71
+         %71 = OpLabel
+        %126 = OpLoad %6 %65
+        %127 = OpIAdd %6 %126 %63
+               OpStore %65 %127
+               OpBranch %68
+         %70 = OpLabel
+        %128 = OpAccessChain %37 %36 %18 %43
+        %129 = OpLoad %6 %128
+        %130 = OpAccessChain %40 %58 %129 %18
+        %131 = OpLoad %6 %130
+        %132 = OpAccessChain %37 %36 %18 %43
+        %133 = OpLoad %6 %132
+        %134 = OpIEqual %27 %131 %133
+               OpSelectionMerge %136 None
+               OpBranchConditional %134 %135 %136
+        %135 = OpLabel
+        %137 = OpAccessChain %37 %36 %18 %88
+        %138 = OpLoad %6 %137
+        %139 = OpAccessChain %40 %58 %138 %18
+        %140 = OpLoad %6 %139
+        %141 = OpAccessChain %37 %36 %18 %18
+        %142 = OpLoad %6 %141
+        %143 = OpIEqual %27 %140 %142
+               OpBranch %136
+        %136 = OpLabel
+        %144 = OpPhi %27 %134 %70 %143 %135
+               OpSelectionMerge %146 None
+               OpBranchConditional %144 %145 %146
+        %145 = OpLabel
+        %147 = OpAccessChain %37 %36 %18 %63
+        %148 = OpLoad %6 %147
+        %149 = OpAccessChain %40 %58 %148 %18
+        %150 = OpLoad %6 %149
+        %151 = OpAccessChain %37 %36 %18 %63
+        %152 = OpLoad %6 %151
+        %153 = OpIEqual %27 %150 %152
+               OpBranch %146
+        %146 = OpLabel
+        %154 = OpPhi %27 %144 %136 %153 %145
+               OpSelectionMerge %156 None
+               OpBranchConditional %154 %155 %173
+        %155 = OpLabel
+        %160 = OpAccessChain %37 %36 %18 %88
+        %161 = OpLoad %6 %160
+        %162 = OpConvertSToF %13 %161
+        %163 = OpAccessChain %37 %36 %18 %43
+        %164 = OpLoad %6 %163
+        %165 = OpConvertSToF %13 %164
+        %166 = OpAccessChain %37 %36 %18 %43
+        %167 = OpLoad %6 %166
+        %168 = OpConvertSToF %13 %167
+        %169 = OpAccessChain %37 %36 %18 %88
+        %170 = OpLoad %6 %169
+        %171 = OpConvertSToF %13 %170
+        %172 = OpCompositeConstruct %157 %162 %165 %168 %171
+               OpStore %159 %172
+               OpBranch %156
+        %173 = OpLabel
+        %174 = OpAccessChain %37 %36 %18 %43
+        %175 = OpLoad %6 %174
+        %176 = OpConvertSToF %13 %175
+        %177 = OpCompositeConstruct %157 %176 %176 %176 %176
+               OpStore %159 %177
+               OpBranch %156
+        %156 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %11 = OpFunction %2 None %9
+         %10 = OpFunctionParameter %8
+         %12 = OpLabel
+         %22 = OpAccessChain %21 %17 %18 %20
+         %23 = OpLoad %13 %22
+         %25 = OpAccessChain %21 %17 %18 %24
+         %26 = OpLoad %13 %25
+         %28 = OpFOrdGreaterThan %27 %23 %26
+               OpSelectionMerge %30 None
+               OpBranchConditional %28 %29 %30
+         %29 = OpLabel
+               OpReturn
+         %30 = OpLabel
+         %38 = OpAccessChain %37 %36 %18 %18
+         %39 = OpLoad %6 %38
+         %41 = OpAccessChain %40 %10 %18
+               OpStore %41 %39
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# v1
+BUFFER variant_v1 DATA_TYPE vec2<float> STD140 DATA
+ 0.0 1.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 2 0 1 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_v1 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-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if.amber
new file mode 100644 (file)
index 0000000..8fa06bc
--- /dev/null
@@ -0,0 +1,250 @@
+#!amber
+
+# Copyright 2020 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: Covers IR builder, constant fold, inst combine calls and value tracking 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 310 es
+# #define _int_3 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_2 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [3, 1, 0, 2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = 0;
+#
+#     // Always false.
+#     if (mix(vec2(1), vec2(2), bvec2(true, _int_1 == _int_2)) == vec2(1))
+#     {
+#         for (int i = _int_1; findMSB(i) < 5; i++)
+#         {
+#             a++;
+#         }
+#     }
+#     else
+#     {
+#         for (int i = _int_1; findMSB(i) < _int_3; i++)
+#         {
+#             a++;
+#         }
+#     }
+#     if (a == 7)
+#     {
+#         _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; 8
+; Bound: 100
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %80
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %21 "buf0"
+               OpMemberName %21 0 "_GLF_uniform_int_values"
+               OpName %23 ""
+               OpName %39 "i"
+               OpName %56 "i"
+               OpName %80 "_GLF_color"
+               OpDecorate %20 ArrayStride 16
+               OpMemberDecorate %21 0 Offset 0
+               OpDecorate %21 Block
+               OpDecorate %23 DescriptorSet 0
+               OpDecorate %23 Binding 0
+               OpDecorate %80 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 0
+         %10 = OpTypeFloat 32
+         %11 = OpTypeVector %10 2
+         %12 = OpConstant %10 1
+         %13 = OpConstantComposite %11 %12 %12
+         %14 = OpConstant %10 2
+         %15 = OpConstantComposite %11 %14 %14
+         %16 = OpTypeBool
+         %17 = OpConstantTrue %16
+         %18 = OpTypeInt 32 0
+         %19 = OpConstant %18 4
+         %20 = OpTypeArray %6 %19
+         %21 = OpTypeStruct %20
+         %22 = OpTypePointer Uniform %21
+         %23 = OpVariable %22 Uniform
+         %24 = OpConstant %6 1
+         %25 = OpTypePointer Uniform %6
+         %28 = OpConstant %6 3
+         %32 = OpTypeVector %16 2
+         %49 = OpConstant %6 5
+         %74 = OpConstant %6 7
+         %78 = OpTypeVector %10 4
+         %79 = OpTypePointer Output %78
+         %80 = OpVariable %79 Output
+         %84 = OpConstant %6 2
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %39 = OpVariable %7 Function
+         %56 = OpVariable %7 Function
+               OpStore %8 %9
+         %26 = OpAccessChain %25 %23 %9 %24
+         %27 = OpLoad %6 %26
+         %29 = OpAccessChain %25 %23 %9 %28
+         %30 = OpLoad %6 %29
+         %31 = OpIEqual %16 %27 %30
+         %33 = OpCompositeConstruct %32 %17 %31
+         %34 = OpSelect %11 %33 %15 %13
+         %35 = OpFOrdEqual %32 %34 %13
+         %36 = OpAll %16 %35
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %37 %55
+         %37 = OpLabel
+         %40 = OpAccessChain %25 %23 %9 %24
+         %41 = OpLoad %6 %40
+               OpStore %39 %41
+               OpBranch %42
+         %42 = OpLabel
+               OpLoopMerge %44 %45 None
+               OpBranch %46
+         %46 = OpLabel
+         %47 = OpLoad %6 %39
+         %48 = OpExtInst %6 %1 FindSMsb %47
+         %50 = OpSLessThan %16 %48 %49
+               OpBranchConditional %50 %43 %44
+         %43 = OpLabel
+         %51 = OpLoad %6 %8
+         %52 = OpIAdd %6 %51 %24
+               OpStore %8 %52
+               OpBranch %45
+         %45 = OpLabel
+         %53 = OpLoad %6 %39
+         %54 = OpIAdd %6 %53 %24
+               OpStore %39 %54
+               OpBranch %42
+         %44 = OpLabel
+               OpBranch %38
+         %55 = OpLabel
+         %57 = OpAccessChain %25 %23 %9 %24
+         %58 = OpLoad %6 %57
+               OpStore %56 %58
+               OpBranch %59
+         %59 = OpLabel
+               OpLoopMerge %61 %62 None
+               OpBranch %63
+         %63 = OpLabel
+         %64 = OpLoad %6 %56
+         %65 = OpExtInst %6 %1 FindSMsb %64
+         %66 = OpAccessChain %25 %23 %9 %9
+         %67 = OpLoad %6 %66
+         %68 = OpSLessThan %16 %65 %67
+               OpBranchConditional %68 %60 %61
+         %60 = OpLabel
+         %69 = OpLoad %6 %8
+         %70 = OpIAdd %6 %69 %24
+               OpStore %8 %70
+               OpBranch %62
+         %62 = OpLabel
+         %71 = OpLoad %6 %56
+         %72 = OpIAdd %6 %71 %24
+               OpStore %56 %72
+               OpBranch %59
+         %61 = OpLabel
+               OpBranch %38
+         %38 = OpLabel
+         %73 = OpLoad %6 %8
+         %75 = OpIEqual %16 %73 %74
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %76 %95
+         %76 = OpLabel
+         %81 = OpAccessChain %25 %23 %9 %24
+         %82 = OpLoad %6 %81
+         %83 = OpConvertSToF %10 %82
+         %85 = OpAccessChain %25 %23 %9 %84
+         %86 = OpLoad %6 %85
+         %87 = OpConvertSToF %10 %86
+         %88 = OpAccessChain %25 %23 %9 %84
+         %89 = OpLoad %6 %88
+         %90 = OpConvertSToF %10 %89
+         %91 = OpAccessChain %25 %23 %9 %24
+         %92 = OpLoad %6 %91
+         %93 = OpConvertSToF %10 %92
+         %94 = OpCompositeConstruct %78 %83 %87 %90 %93
+               OpStore %80 %94
+               OpBranch %77
+         %95 = OpLabel
+         %96 = OpAccessChain %25 %23 %9 %84
+         %97 = OpLoad %6 %96
+         %98 = OpConvertSToF %10 %97
+         %99 = OpCompositeConstruct %78 %98 %98 %98 %98
+               OpStore %80 %99
+               OpBranch %77
+         %77 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 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-optimize-phis-for-for-do-while-if-if.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-optimize-phis-for-for-do-while-if-if.amber
new file mode 100644 (file)
index 0000000..3e32bb9
--- /dev/null
@@ -0,0 +1,291 @@
+#!amber
+
+# Copyright 2020 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 a specific optimize PHIs code path
+
+# 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 310 es
+# #define _int_10 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: 0.0
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [10, 1, 0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     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_10; i++)
+#     {
+#         for (int j = _int_0; j < _int_10; j++)
+#         {
+#             do
+#             {
+#                 a = _int_1;
+#                 if (gl_FragCoord.y < _float_0_0)
+#                 {
+#                     discard;
+#                 }
+#             } while (a < _int_1);
+#
+#             // Always false.
+#             if (gl_FragCoord.y < _float_0_0)
+#             {
+#                 break;
+#             }
+#         }
+#     }
+#     if (a == _int_1)
+#     {
+#         _GLF_color = vec4(a, _int_0, _int_0, a);
+#     }
+#     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; 8
+; Bound: 111
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %55 %94
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf1"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %20 "i"
+               OpName %33 "j"
+               OpName %55 "gl_FragCoord"
+               OpName %61 "buf0"
+               OpMemberName %61 0 "_GLF_uniform_float_values"
+               OpName %63 ""
+               OpName %94 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %55 BuiltIn FragCoord
+               OpDecorate %60 ArrayStride 16
+               OpMemberDecorate %61 0 Offset 0
+               OpDecorate %61 Block
+               OpDecorate %63 DescriptorSet 0
+               OpDecorate %63 Binding 0
+               OpDecorate %94 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 2
+         %17 = OpTypePointer Uniform %6
+         %31 = OpTypeBool
+         %49 = OpConstant %6 1
+         %52 = OpTypeFloat 32
+         %53 = OpTypeVector %52 4
+         %54 = OpTypePointer Input %53
+         %55 = OpVariable %54 Input
+         %56 = OpConstant %9 1
+         %57 = OpTypePointer Input %52
+         %60 = OpTypeArray %52 %56
+         %61 = OpTypeStruct %60
+         %62 = OpTypePointer Uniform %61
+         %63 = OpVariable %62 Uniform
+         %64 = OpTypePointer Uniform %52
+         %93 = OpTypePointer Output %53
+         %94 = OpVariable %93 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %20 = OpVariable %7 Function
+         %33 = 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
+         %29 = OpAccessChain %17 %14 %15 %15
+         %30 = OpLoad %6 %29
+         %32 = OpSLessThan %31 %28 %30
+               OpBranchConditional %32 %24 %25
+         %24 = OpLabel
+         %34 = OpAccessChain %17 %14 %15 %16
+         %35 = OpLoad %6 %34
+               OpStore %33 %35
+               OpBranch %36
+         %36 = OpLabel
+               OpLoopMerge %38 %39 None
+               OpBranch %40
+         %40 = OpLabel
+         %41 = OpLoad %6 %33
+         %42 = OpAccessChain %17 %14 %15 %15
+         %43 = OpLoad %6 %42
+         %44 = OpSLessThan %31 %41 %43
+               OpBranchConditional %44 %37 %38
+         %37 = OpLabel
+               OpBranch %45
+         %45 = OpLabel
+               OpLoopMerge %47 %48 None
+               OpBranch %46
+         %46 = OpLabel
+         %50 = OpAccessChain %17 %14 %15 %49
+         %51 = OpLoad %6 %50
+               OpStore %8 %51
+         %58 = OpAccessChain %57 %55 %56
+         %59 = OpLoad %52 %58
+         %65 = OpAccessChain %64 %63 %15 %15
+         %66 = OpLoad %52 %65
+         %67 = OpFOrdLessThan %31 %59 %66
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %68 %69
+         %68 = OpLabel
+               OpKill
+         %69 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %71 = OpLoad %6 %8
+         %72 = OpAccessChain %17 %14 %15 %49
+         %73 = OpLoad %6 %72
+         %74 = OpSLessThan %31 %71 %73
+               OpBranchConditional %74 %45 %47
+         %47 = OpLabel
+         %75 = OpAccessChain %57 %55 %56
+         %76 = OpLoad %52 %75
+         %77 = OpAccessChain %64 %63 %15 %15
+         %78 = OpLoad %52 %77
+         %79 = OpFOrdLessThan %31 %76 %78
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %80 %81
+         %80 = OpLabel
+               OpBranch %38
+         %81 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
+         %83 = OpLoad %6 %33
+         %84 = OpIAdd %6 %83 %49
+               OpStore %33 %84
+               OpBranch %36
+         %38 = OpLabel
+               OpBranch %26
+         %26 = OpLabel
+         %85 = OpLoad %6 %20
+         %86 = OpIAdd %6 %85 %49
+               OpStore %20 %86
+               OpBranch %23
+         %25 = OpLabel
+         %87 = OpLoad %6 %8
+         %88 = OpAccessChain %17 %14 %15 %49
+         %89 = OpLoad %6 %88
+         %90 = OpIEqual %31 %87 %89
+               OpSelectionMerge %92 None
+               OpBranchConditional %90 %91 %106
+         %91 = OpLabel
+         %95 = OpLoad %6 %8
+         %96 = OpConvertSToF %52 %95
+         %97 = OpAccessChain %17 %14 %15 %16
+         %98 = OpLoad %6 %97
+         %99 = OpConvertSToF %52 %98
+        %100 = OpAccessChain %17 %14 %15 %16
+        %101 = OpLoad %6 %100
+        %102 = OpConvertSToF %52 %101
+        %103 = OpLoad %6 %8
+        %104 = OpConvertSToF %52 %103
+        %105 = OpCompositeConstruct %53 %96 %99 %102 %104
+               OpStore %94 %105
+               OpBranch %92
+        %106 = OpLabel
+        %107 = OpAccessChain %17 %14 %15 %16
+        %108 = OpLoad %6 %107
+        %109 = OpConvertSToF %52 %108
+        %110 = OpCompositeConstruct %53 %109 %109 %109 %109
+               OpStore %94 %110
+               OpBranch %92
+         %92 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 1 0
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.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-optimize-phis-for.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-optimize-phis-for.amber
new file mode 100644 (file)
index 0000000..6cac09f
--- /dev/null
@@ -0,0 +1,545 @@
+#!amber
+
+# Copyright 2020 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 cover specific optimize phis 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 310 es
+# #define _int_2 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [2, 0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float a = _float_1_0;
+#     float b = _float_0_0;
+#
+#     for (int i = _int_0; i < _int_2; i++)
+#     {
+#         for (int i = _int_0; i < _int_2; i++)
+#         {
+#             for (int i = _int_0; i < _int_2; i++)
+#             {
+#                 for (int i = _int_1; i < _int_2; i++)
+#                 {
+#                     for (int i = _int_1; i < _int_2; i++)
+#                     {
+#                         for (int i = _int_0; i < _int_2; i++)
+#                         {
+#                             for (int i = _int_0; i < _int_2; i++)
+#                             {
+#                                 for (int i = _int_0; i < _int_2; i++)
+#                                 {
+#                                     for (int i = _int_0; i < _int_2; i++)
+#                                     {
+#                                         for (int i = _int_0; i < _int_2; i++)
+#                                         {
+#                                             for (int i = _int_0; i < _int_2;
+#                                                  i++)
+#                                             {
+#                                                 a = _float_0_0;
+#                                                 if (gl_FragCoord.y > _float_0_0)
+#                                                 {
+#                                                     break;
+#                                                 }
+#                                             }
+#                                         }
+#                                     }
+#                                 }
+#                             }
+#                         }
+#                     }
+#                 }
+#             }
+#         }
+#         b++;
+#     }
+#     _GLF_color = vec4(b, a, a, b);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 212
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %169 %206
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_float_values"
+               OpName %14 ""
+               OpName %20 "b"
+               OpName %25 "i"
+               OpName %28 "buf1"
+               OpMemberName %28 0 "_GLF_uniform_int_values"
+               OpName %30 ""
+               OpName %44 "i"
+               OpName %56 "i"
+               OpName %68 "i"
+               OpName %81 "i"
+               OpName %93 "i"
+               OpName %105 "i"
+               OpName %117 "i"
+               OpName %129 "i"
+               OpName %141 "i"
+               OpName %153 "i"
+               OpName %169 "gl_FragCoord"
+               OpName %206 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %25 RelaxedPrecision
+               OpDecorate %27 ArrayStride 16
+               OpMemberDecorate %28 0 RelaxedPrecision
+               OpMemberDecorate %28 0 Offset 0
+               OpDecorate %28 Block
+               OpDecorate %30 DescriptorSet 0
+               OpDecorate %30 Binding 1
+               OpDecorate %33 RelaxedPrecision
+               OpDecorate %39 RelaxedPrecision
+               OpDecorate %41 RelaxedPrecision
+               OpDecorate %44 RelaxedPrecision
+               OpDecorate %46 RelaxedPrecision
+               OpDecorate %52 RelaxedPrecision
+               OpDecorate %54 RelaxedPrecision
+               OpDecorate %56 RelaxedPrecision
+               OpDecorate %58 RelaxedPrecision
+               OpDecorate %64 RelaxedPrecision
+               OpDecorate %66 RelaxedPrecision
+               OpDecorate %68 RelaxedPrecision
+               OpDecorate %71 RelaxedPrecision
+               OpDecorate %77 RelaxedPrecision
+               OpDecorate %79 RelaxedPrecision
+               OpDecorate %81 RelaxedPrecision
+               OpDecorate %83 RelaxedPrecision
+               OpDecorate %89 RelaxedPrecision
+               OpDecorate %91 RelaxedPrecision
+               OpDecorate %93 RelaxedPrecision
+               OpDecorate %95 RelaxedPrecision
+               OpDecorate %101 RelaxedPrecision
+               OpDecorate %103 RelaxedPrecision
+               OpDecorate %105 RelaxedPrecision
+               OpDecorate %107 RelaxedPrecision
+               OpDecorate %113 RelaxedPrecision
+               OpDecorate %115 RelaxedPrecision
+               OpDecorate %117 RelaxedPrecision
+               OpDecorate %119 RelaxedPrecision
+               OpDecorate %125 RelaxedPrecision
+               OpDecorate %127 RelaxedPrecision
+               OpDecorate %129 RelaxedPrecision
+               OpDecorate %131 RelaxedPrecision
+               OpDecorate %137 RelaxedPrecision
+               OpDecorate %139 RelaxedPrecision
+               OpDecorate %141 RelaxedPrecision
+               OpDecorate %143 RelaxedPrecision
+               OpDecorate %149 RelaxedPrecision
+               OpDecorate %151 RelaxedPrecision
+               OpDecorate %153 RelaxedPrecision
+               OpDecorate %155 RelaxedPrecision
+               OpDecorate %161 RelaxedPrecision
+               OpDecorate %163 RelaxedPrecision
+               OpDecorate %169 BuiltIn FragCoord
+               OpDecorate %180 RelaxedPrecision
+               OpDecorate %181 RelaxedPrecision
+               OpDecorate %182 RelaxedPrecision
+               OpDecorate %183 RelaxedPrecision
+               OpDecorate %184 RelaxedPrecision
+               OpDecorate %185 RelaxedPrecision
+               OpDecorate %186 RelaxedPrecision
+               OpDecorate %187 RelaxedPrecision
+               OpDecorate %188 RelaxedPrecision
+               OpDecorate %189 RelaxedPrecision
+               OpDecorate %190 RelaxedPrecision
+               OpDecorate %191 RelaxedPrecision
+               OpDecorate %192 RelaxedPrecision
+               OpDecorate %193 RelaxedPrecision
+               OpDecorate %194 RelaxedPrecision
+               OpDecorate %195 RelaxedPrecision
+               OpDecorate %196 RelaxedPrecision
+               OpDecorate %197 RelaxedPrecision
+               OpDecorate %198 RelaxedPrecision
+               OpDecorate %199 RelaxedPrecision
+               OpDecorate %203 RelaxedPrecision
+               OpDecorate %204 RelaxedPrecision
+               OpDecorate %206 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 = OpTypePointer Uniform %6
+         %21 = OpConstant %15 1
+         %24 = OpTypePointer Function %15
+         %26 = OpConstant %9 3
+         %27 = OpTypeArray %15 %26
+         %28 = OpTypeStruct %27
+         %29 = OpTypePointer Uniform %28
+         %30 = OpVariable %29 Uniform
+         %31 = OpTypePointer Uniform %15
+         %42 = OpTypeBool
+         %69 = OpConstant %15 2
+        %167 = OpTypeVector %6 4
+        %168 = OpTypePointer Input %167
+        %169 = OpVariable %168 Input
+        %170 = OpConstant %9 1
+        %171 = OpTypePointer Input %6
+        %201 = OpConstant %6 1
+        %205 = OpTypePointer Output %167
+        %206 = OpVariable %205 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %20 = OpVariable %7 Function
+         %25 = OpVariable %24 Function
+         %44 = OpVariable %24 Function
+         %56 = OpVariable %24 Function
+         %68 = OpVariable %24 Function
+         %81 = OpVariable %24 Function
+         %93 = OpVariable %24 Function
+        %105 = OpVariable %24 Function
+        %117 = OpVariable %24 Function
+        %129 = OpVariable %24 Function
+        %141 = OpVariable %24 Function
+        %153 = OpVariable %24 Function
+         %18 = OpAccessChain %17 %14 %16 %16
+         %19 = OpLoad %6 %18
+               OpStore %8 %19
+         %22 = OpAccessChain %17 %14 %16 %21
+         %23 = OpLoad %6 %22
+               OpStore %20 %23
+         %32 = OpAccessChain %31 %30 %16 %21
+         %33 = OpLoad %15 %32
+               OpStore %25 %33
+               OpBranch %34
+         %34 = OpLabel
+               OpLoopMerge %36 %37 None
+               OpBranch %38
+         %38 = OpLabel
+         %39 = OpLoad %15 %25
+         %40 = OpAccessChain %31 %30 %16 %16
+         %41 = OpLoad %15 %40
+         %43 = OpSLessThan %42 %39 %41
+               OpBranchConditional %43 %35 %36
+         %35 = OpLabel
+         %45 = OpAccessChain %31 %30 %16 %21
+         %46 = OpLoad %15 %45
+               OpStore %44 %46
+               OpBranch %47
+         %47 = OpLabel
+               OpLoopMerge %49 %50 None
+               OpBranch %51
+         %51 = OpLabel
+         %52 = OpLoad %15 %44
+         %53 = OpAccessChain %31 %30 %16 %16
+         %54 = OpLoad %15 %53
+         %55 = OpSLessThan %42 %52 %54
+               OpBranchConditional %55 %48 %49
+         %48 = OpLabel
+         %57 = OpAccessChain %31 %30 %16 %21
+         %58 = OpLoad %15 %57
+               OpStore %56 %58
+               OpBranch %59
+         %59 = OpLabel
+               OpLoopMerge %61 %62 None
+               OpBranch %63
+         %63 = OpLabel
+         %64 = OpLoad %15 %56
+         %65 = OpAccessChain %31 %30 %16 %16
+         %66 = OpLoad %15 %65
+         %67 = OpSLessThan %42 %64 %66
+               OpBranchConditional %67 %60 %61
+         %60 = OpLabel
+         %70 = OpAccessChain %31 %30 %16 %69
+         %71 = OpLoad %15 %70
+               OpStore %68 %71
+               OpBranch %72
+         %72 = OpLabel
+               OpLoopMerge %74 %75 None
+               OpBranch %76
+         %76 = OpLabel
+         %77 = OpLoad %15 %68
+         %78 = OpAccessChain %31 %30 %16 %16
+         %79 = OpLoad %15 %78
+         %80 = OpSLessThan %42 %77 %79
+               OpBranchConditional %80 %73 %74
+         %73 = OpLabel
+         %82 = OpAccessChain %31 %30 %16 %69
+         %83 = OpLoad %15 %82
+               OpStore %81 %83
+               OpBranch %84
+         %84 = OpLabel
+               OpLoopMerge %86 %87 None
+               OpBranch %88
+         %88 = OpLabel
+         %89 = OpLoad %15 %81
+         %90 = OpAccessChain %31 %30 %16 %16
+         %91 = OpLoad %15 %90
+         %92 = OpSLessThan %42 %89 %91
+               OpBranchConditional %92 %85 %86
+         %85 = OpLabel
+         %94 = OpAccessChain %31 %30 %16 %21
+         %95 = OpLoad %15 %94
+               OpStore %93 %95
+               OpBranch %96
+         %96 = OpLabel
+               OpLoopMerge %98 %99 None
+               OpBranch %100
+        %100 = OpLabel
+        %101 = OpLoad %15 %93
+        %102 = OpAccessChain %31 %30 %16 %16
+        %103 = OpLoad %15 %102
+        %104 = OpSLessThan %42 %101 %103
+               OpBranchConditional %104 %97 %98
+         %97 = OpLabel
+        %106 = OpAccessChain %31 %30 %16 %21
+        %107 = OpLoad %15 %106
+               OpStore %105 %107
+               OpBranch %108
+        %108 = OpLabel
+               OpLoopMerge %110 %111 None
+               OpBranch %112
+        %112 = OpLabel
+        %113 = OpLoad %15 %105
+        %114 = OpAccessChain %31 %30 %16 %16
+        %115 = OpLoad %15 %114
+        %116 = OpSLessThan %42 %113 %115
+               OpBranchConditional %116 %109 %110
+        %109 = OpLabel
+        %118 = OpAccessChain %31 %30 %16 %21
+        %119 = OpLoad %15 %118
+               OpStore %117 %119
+               OpBranch %120
+        %120 = OpLabel
+               OpLoopMerge %122 %123 None
+               OpBranch %124
+        %124 = OpLabel
+        %125 = OpLoad %15 %117
+        %126 = OpAccessChain %31 %30 %16 %16
+        %127 = OpLoad %15 %126
+        %128 = OpSLessThan %42 %125 %127
+               OpBranchConditional %128 %121 %122
+        %121 = OpLabel
+        %130 = OpAccessChain %31 %30 %16 %21
+        %131 = OpLoad %15 %130
+               OpStore %129 %131
+               OpBranch %132
+        %132 = OpLabel
+               OpLoopMerge %134 %135 None
+               OpBranch %136
+        %136 = OpLabel
+        %137 = OpLoad %15 %129
+        %138 = OpAccessChain %31 %30 %16 %16
+        %139 = OpLoad %15 %138
+        %140 = OpSLessThan %42 %137 %139
+               OpBranchConditional %140 %133 %134
+        %133 = OpLabel
+        %142 = OpAccessChain %31 %30 %16 %21
+        %143 = OpLoad %15 %142
+               OpStore %141 %143
+               OpBranch %144
+        %144 = OpLabel
+               OpLoopMerge %146 %147 None
+               OpBranch %148
+        %148 = OpLabel
+        %149 = OpLoad %15 %141
+        %150 = OpAccessChain %31 %30 %16 %16
+        %151 = OpLoad %15 %150
+        %152 = OpSLessThan %42 %149 %151
+               OpBranchConditional %152 %145 %146
+        %145 = OpLabel
+        %154 = OpAccessChain %31 %30 %16 %21
+        %155 = OpLoad %15 %154
+               OpStore %153 %155
+               OpBranch %156
+        %156 = OpLabel
+               OpLoopMerge %158 %159 None
+               OpBranch %160
+        %160 = OpLabel
+        %161 = OpLoad %15 %153
+        %162 = OpAccessChain %31 %30 %16 %16
+        %163 = OpLoad %15 %162
+        %164 = OpSLessThan %42 %161 %163
+               OpBranchConditional %164 %157 %158
+        %157 = OpLabel
+        %165 = OpAccessChain %17 %14 %16 %21
+        %166 = OpLoad %6 %165
+               OpStore %8 %166
+        %172 = OpAccessChain %171 %169 %170
+        %173 = OpLoad %6 %172
+        %174 = OpAccessChain %17 %14 %16 %21
+        %175 = OpLoad %6 %174
+        %176 = OpFOrdGreaterThan %42 %173 %175
+               OpSelectionMerge %178 None
+               OpBranchConditional %176 %177 %178
+        %177 = OpLabel
+               OpBranch %158
+        %178 = OpLabel
+               OpBranch %159
+        %159 = OpLabel
+        %180 = OpLoad %15 %153
+        %181 = OpIAdd %15 %180 %21
+               OpStore %153 %181
+               OpBranch %156
+        %158 = OpLabel
+               OpBranch %147
+        %147 = OpLabel
+        %182 = OpLoad %15 %141
+        %183 = OpIAdd %15 %182 %21
+               OpStore %141 %183
+               OpBranch %144
+        %146 = OpLabel
+               OpBranch %135
+        %135 = OpLabel
+        %184 = OpLoad %15 %129
+        %185 = OpIAdd %15 %184 %21
+               OpStore %129 %185
+               OpBranch %132
+        %134 = OpLabel
+               OpBranch %123
+        %123 = OpLabel
+        %186 = OpLoad %15 %117
+        %187 = OpIAdd %15 %186 %21
+               OpStore %117 %187
+               OpBranch %120
+        %122 = OpLabel
+               OpBranch %111
+        %111 = OpLabel
+        %188 = OpLoad %15 %105
+        %189 = OpIAdd %15 %188 %21
+               OpStore %105 %189
+               OpBranch %108
+        %110 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %190 = OpLoad %15 %93
+        %191 = OpIAdd %15 %190 %21
+               OpStore %93 %191
+               OpBranch %96
+         %98 = OpLabel
+               OpBranch %87
+         %87 = OpLabel
+        %192 = OpLoad %15 %81
+        %193 = OpIAdd %15 %192 %21
+               OpStore %81 %193
+               OpBranch %84
+         %86 = OpLabel
+               OpBranch %75
+         %75 = OpLabel
+        %194 = OpLoad %15 %68
+        %195 = OpIAdd %15 %194 %21
+               OpStore %68 %195
+               OpBranch %72
+         %74 = OpLabel
+               OpBranch %62
+         %62 = OpLabel
+        %196 = OpLoad %15 %56
+        %197 = OpIAdd %15 %196 %21
+               OpStore %56 %197
+               OpBranch %59
+         %61 = OpLabel
+               OpBranch %50
+         %50 = OpLabel
+        %198 = OpLoad %15 %44
+        %199 = OpIAdd %15 %198 %21
+               OpStore %44 %199
+               OpBranch %47
+         %49 = OpLabel
+        %200 = OpLoad %6 %20
+        %202 = OpFAdd %6 %200 %201
+               OpStore %20 %202
+               OpBranch %37
+         %37 = OpLabel
+        %203 = OpLoad %15 %25
+        %204 = OpIAdd %15 %203 %21
+               OpStore %25 %204
+               OpBranch %34
+         %36 = OpLabel
+        %207 = OpLoad %6 %20
+        %208 = OpLoad %6 %8
+        %209 = OpLoad %6 %8
+        %210 = OpLoad %6 %20
+        %211 = OpCompositeConstruct %167 %207 %208 %209 %210
+               OpStore %206 %211
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 2 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.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-peephole-optimizer-target-instr-info-for-if-if-if.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-peephole-optimizer-target-instr-info-for-if-if-if.amber
new file mode 100644 (file)
index 0000000..87cf13b
--- /dev/null
@@ -0,0 +1,274 @@
+#!amber
+
+# Copyright 2020 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: Covers peephole optimizer and instr info 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_10 _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 float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 10]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     _GLF_color = vec4(_int_0);
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         // Always false.
+#         if (gl_FragCoord.y < _float_0_0)
+#         {
+#             // Always false.
+#             if (gl_FragCoord.x < _float_0_0)
+#             {
+#                 return;
+#             }
+#
+#             // Always false.
+#             if (_float_1_0 > _float_1_0)
+#             {
+#                 return;
+#             }
+#             discard;
+#         }
+#
+#         // Always true.
+#         if (_float_1_0 > _float_0_0)
+#         {
+#             _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#             break;
+#         }
+#
+#         // Always false.
+#         if (_float_0_0 < 0.0)
+#         {
+#             discard;
+#         }
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 104
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9 %40
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "_GLF_color"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %25 "i"
+               OpName %40 "gl_FragCoord"
+               OpName %47 "buf1"
+               OpMemberName %47 0 "_GLF_uniform_float_values"
+               OpName %49 ""
+               OpDecorate %9 Location 0
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %40 BuiltIn FragCoord
+               OpDecorate %46 ArrayStride 16
+               OpMemberDecorate %47 0 Offset 0
+               OpDecorate %47 Block
+               OpDecorate %49 DescriptorSet 0
+               OpDecorate %49 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpTypeInt 32 1
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 3
+         %13 = OpTypeArray %10 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %10 0
+         %18 = OpConstant %10 1
+         %19 = OpTypePointer Uniform %10
+         %24 = OpTypePointer Function %10
+         %34 = OpConstant %10 2
+         %37 = OpTypeBool
+         %39 = OpTypePointer Input %7
+         %40 = OpVariable %39 Input
+         %41 = OpConstant %11 1
+         %42 = OpTypePointer Input %6
+         %45 = OpConstant %11 2
+         %46 = OpTypeArray %6 %45
+         %47 = OpTypeStruct %46
+         %48 = OpTypePointer Uniform %47
+         %49 = OpVariable %48 Uniform
+         %50 = OpTypePointer Uniform %6
+         %56 = OpConstant %11 0
+         %97 = OpConstant %6 0
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %25 = OpVariable %24 Function
+         %20 = OpAccessChain %19 %16 %17 %18
+         %21 = OpLoad %10 %20
+         %22 = OpConvertSToF %6 %21
+         %23 = OpCompositeConstruct %7 %22 %22 %22 %22
+               OpStore %9 %23
+         %26 = OpAccessChain %19 %16 %17 %18
+         %27 = OpLoad %10 %26
+               OpStore %25 %27
+               OpBranch %28
+         %28 = OpLabel
+               OpLoopMerge %30 %31 None
+               OpBranch %32
+         %32 = OpLabel
+         %33 = OpLoad %10 %25
+         %35 = OpAccessChain %19 %16 %17 %34
+         %36 = OpLoad %10 %35
+         %38 = OpSLessThan %37 %33 %36
+               OpBranchConditional %38 %29 %30
+         %29 = OpLabel
+         %43 = OpAccessChain %42 %40 %41
+         %44 = OpLoad %6 %43
+         %51 = OpAccessChain %50 %49 %17 %17
+         %52 = OpLoad %6 %51
+         %53 = OpFOrdLessThan %37 %44 %52
+               OpSelectionMerge %55 None
+               OpBranchConditional %53 %54 %55
+         %54 = OpLabel
+         %57 = OpAccessChain %42 %40 %56
+         %58 = OpLoad %6 %57
+         %59 = OpAccessChain %50 %49 %17 %17
+         %60 = OpLoad %6 %59
+         %61 = OpFOrdLessThan %37 %58 %60
+               OpSelectionMerge %63 None
+               OpBranchConditional %61 %62 %63
+         %62 = OpLabel
+               OpReturn
+         %63 = OpLabel
+         %65 = OpAccessChain %50 %49 %17 %18
+         %66 = OpLoad %6 %65
+         %67 = OpAccessChain %50 %49 %17 %18
+         %68 = OpLoad %6 %67
+         %69 = OpFOrdGreaterThan %37 %66 %68
+               OpSelectionMerge %71 None
+               OpBranchConditional %69 %70 %71
+         %70 = OpLabel
+               OpReturn
+         %71 = OpLabel
+               OpKill
+         %55 = OpLabel
+         %74 = OpAccessChain %50 %49 %17 %18
+         %75 = OpLoad %6 %74
+         %76 = OpAccessChain %50 %49 %17 %17
+         %77 = OpLoad %6 %76
+         %78 = OpFOrdGreaterThan %37 %75 %77
+               OpSelectionMerge %80 None
+               OpBranchConditional %78 %79 %80
+         %79 = OpLabel
+         %81 = OpAccessChain %19 %16 %17 %17
+         %82 = OpLoad %10 %81
+         %83 = OpConvertSToF %6 %82
+         %84 = OpAccessChain %19 %16 %17 %18
+         %85 = OpLoad %10 %84
+         %86 = OpConvertSToF %6 %85
+         %87 = OpAccessChain %19 %16 %17 %18
+         %88 = OpLoad %10 %87
+         %89 = OpConvertSToF %6 %88
+         %90 = OpAccessChain %19 %16 %17 %17
+         %91 = OpLoad %10 %90
+         %92 = OpConvertSToF %6 %91
+         %93 = OpCompositeConstruct %7 %83 %86 %89 %92
+               OpStore %9 %93
+               OpBranch %30
+         %80 = OpLabel
+         %95 = OpAccessChain %50 %49 %17 %17
+         %96 = OpLoad %6 %95
+         %98 = OpFOrdLessThan %37 %96 %97
+               OpSelectionMerge %100 None
+               OpBranchConditional %98 %99 %100
+         %99 = OpLabel
+               OpKill
+        %100 = OpLabel
+               OpBranch %31
+         %31 = OpLabel
+        %102 = OpLoad %10 %25
+        %103 = OpIAdd %10 %102 %18
+               OpStore %25 %103
+               OpBranch %28
+         %30 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 10
+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-selection-dag-assign-back-and-forth.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-selection-dag-assign-back-and-forth.amber
new file mode 100644 (file)
index 0000000..9b9b837
--- /dev/null
@@ -0,0 +1,139 @@
+#!amber
+
+# Copyright 2020 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 a specific selection DAG code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // 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()
+# {
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     vec4 v = _GLF_color;
+#     _GLF_color = vec4(0);
+#     _GLF_color = v;
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 39
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "_GLF_color"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %34 "v"
+               OpDecorate %9 Location 0
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpTypeInt 32 1
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 2
+         %13 = OpTypeArray %10 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %10 0
+         %18 = OpTypePointer Uniform %10
+         %22 = OpConstant %10 1
+         %33 = OpTypePointer Function %7
+         %36 = OpConstant %6 0
+         %37 = OpConstantComposite %7 %36 %36 %36 %36
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %34 = OpVariable %33 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %10 %19
+         %21 = OpConvertSToF %6 %20
+         %23 = OpAccessChain %18 %16 %17 %22
+         %24 = OpLoad %10 %23
+         %25 = OpConvertSToF %6 %24
+         %26 = OpAccessChain %18 %16 %17 %22
+         %27 = OpLoad %10 %26
+         %28 = OpConvertSToF %6 %27
+         %29 = OpAccessChain %18 %16 %17 %17
+         %30 = OpLoad %10 %29
+         %31 = OpConvertSToF %6 %30
+         %32 = OpCompositeConstruct %7 %21 %25 %28 %31
+               OpStore %9 %32
+         %35 = OpLoad %7 %9
+               OpStore %34 %35
+               OpStore %9 %37
+         %38 = OpLoad %7 %34
+               OpStore %9 %38
+               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
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-selection-dag-lt-gt.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-selection-dag-lt-gt.amber
new file mode 100644 (file)
index 0000000..e26ab99
--- /dev/null
@@ -0,0 +1,198 @@
+#!amber
+
+# Copyright 2020 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 a specific selection DAG code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+# // Contents of v1: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     vec2 v1;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     // Always true.
+#     if (v1.x < v1.y)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+#         // Always false.
+#         if (v1.x > v1.y)
+#         {
+#             _GLF_color = vec4(_int_1);
+#         }
+#         return;
+#     }
+#     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; 8
+; Bound: 65
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %27
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "buf1"
+               OpMemberName %8 0 "v1"
+               OpName %10 ""
+               OpName %27 "_GLF_color"
+               OpName %30 "buf0"
+               OpMemberName %30 0 "_GLF_uniform_int_values"
+               OpName %32 ""
+               OpMemberDecorate %8 0 Offset 0
+               OpDecorate %8 Block
+               OpDecorate %10 DescriptorSet 0
+               OpDecorate %10 Binding 1
+               OpDecorate %27 Location 0
+               OpDecorate %29 ArrayStride 16
+               OpMemberDecorate %30 0 Offset 0
+               OpDecorate %30 Block
+               OpDecorate %32 DescriptorSet 0
+               OpDecorate %32 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 2
+          %8 = OpTypeStruct %7
+          %9 = OpTypePointer Uniform %8
+         %10 = OpVariable %9 Uniform
+         %11 = OpTypeInt 32 1
+         %12 = OpConstant %11 0
+         %13 = OpTypeInt 32 0
+         %14 = OpConstant %13 0
+         %15 = OpTypePointer Uniform %6
+         %18 = OpConstant %13 1
+         %21 = OpTypeBool
+         %25 = OpTypeVector %6 4
+         %26 = OpTypePointer Output %25
+         %27 = OpVariable %26 Output
+         %28 = OpConstant %13 2
+         %29 = OpTypeArray %11 %28
+         %30 = OpTypeStruct %29
+         %31 = OpTypePointer Uniform %30
+         %32 = OpVariable %31 Uniform
+         %33 = OpTypePointer Uniform %11
+         %37 = OpConstant %11 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %16 = OpAccessChain %15 %10 %12 %14
+         %17 = OpLoad %6 %16
+         %19 = OpAccessChain %15 %10 %12 %18
+         %20 = OpLoad %6 %19
+         %22 = OpFOrdLessThan %21 %17 %20
+               OpSelectionMerge %24 None
+               OpBranchConditional %22 %23 %60
+         %23 = OpLabel
+         %34 = OpAccessChain %33 %32 %12 %12
+         %35 = OpLoad %11 %34
+         %36 = OpConvertSToF %6 %35
+         %38 = OpAccessChain %33 %32 %12 %37
+         %39 = OpLoad %11 %38
+         %40 = OpConvertSToF %6 %39
+         %41 = OpAccessChain %33 %32 %12 %37
+         %42 = OpLoad %11 %41
+         %43 = OpConvertSToF %6 %42
+         %44 = OpAccessChain %33 %32 %12 %12
+         %45 = OpLoad %11 %44
+         %46 = OpConvertSToF %6 %45
+         %47 = OpCompositeConstruct %25 %36 %40 %43 %46
+               OpStore %27 %47
+         %48 = OpAccessChain %15 %10 %12 %14
+         %49 = OpLoad %6 %48
+         %50 = OpAccessChain %15 %10 %12 %18
+         %51 = OpLoad %6 %50
+         %52 = OpFOrdGreaterThan %21 %49 %51
+               OpSelectionMerge %54 None
+               OpBranchConditional %52 %53 %54
+         %53 = OpLabel
+         %55 = OpAccessChain %33 %32 %12 %12
+         %56 = OpLoad %11 %55
+         %57 = OpConvertSToF %6 %56
+         %58 = OpCompositeConstruct %25 %57 %57 %57 %57
+               OpStore %27 %58
+               OpBranch %54
+         %54 = OpLabel
+               OpReturn
+         %60 = OpLabel
+         %61 = OpAccessChain %33 %32 %12 %37
+         %62 = OpLoad %11 %61
+         %63 = OpConvertSToF %6 %62
+         %64 = OpCompositeConstruct %25 %63 %63 %63 %63
+               OpStore %27 %64
+               OpBranch %24
+         %24 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# v1
+BUFFER variant_v1 DATA_TYPE vec2<float> STD140 DATA
+ 0.0 1.0
+END
+# _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_v1 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-target-lowering-inst-combine-compares-struct-array-clamp-function-cal.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal.amber
new file mode 100644 (file)
index 0000000..ff86b86
--- /dev/null
@@ -0,0 +1,415 @@
+#!amber
+
+# Copyright 2020 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: Covers target lowering and compare combining 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_3 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_2 _GLF_uniform_int_values[3]
+# #define _int_5 _GLF_uniform_int_values[4]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 3, 0, 2, 5]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[5];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# // Contents of v1: [0.0, 1.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     vec2 v1;
+# };
+#
+# struct S {
+#     int data;
+# };
+#
+# void func(inout S s)
+# {
+#     // Always false.
+#     while (v1.x > v1.y)
+#     {
+#         return;
+#     }
+#     s.data = _int_1;
+# }
+# void main()
+# {
+#     S arr[3];
+#     for (int i = _int_0; i < _int_3; i++)
+#     {
+#         arr[i].data = i;
+#     }
+#     for (int i = _int_0; i < _int_3; i++)
+#     {
+#         // Always false.
+#         if (v1.x > v1.y)
+#         {
+#             break;
+#         }
+#
+#         // True for i = 1, 2
+#         if (arr[i].data == _int_1)
+#         {
+#             arr[clamp(i, 0, 3)].data = _int_2;
+#             func(arr[2]);
+#         }
+#         else
+#         {
+#             for (int j = _int_0; j < _int_3; j++)
+#             {
+#                 // Always false.
+#                 if (arr[j].data > _int_5)
+#                 {
+#                     discard;
+#                 }
+#             }
+#         }
+#     }
+#     if (arr[_int_0].data == _int_0 && arr[_int_1].data == _int_2 &&
+#         arr[_int_2].data == _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; 8
+; Bound: 185
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %166
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %7 "S"
+               OpMemberName %7 0 "data"
+               OpName %11 "func(struct-S-i11;"
+               OpName %10 "s"
+               OpName %20 "buf1"
+               OpMemberName %20 0 "v1"
+               OpName %22 ""
+               OpName %37 "buf0"
+               OpMemberName %37 0 "_GLF_uniform_int_values"
+               OpName %39 ""
+               OpName %45 "i"
+               OpName %62 "arr"
+               OpName %68 "i"
+               OpName %102 "param"
+               OpName %109 "j"
+               OpName %166 "_GLF_color"
+               OpMemberDecorate %20 0 Offset 0
+               OpDecorate %20 Block
+               OpDecorate %22 DescriptorSet 0
+               OpDecorate %22 Binding 1
+               OpDecorate %36 ArrayStride 16
+               OpMemberDecorate %37 0 Offset 0
+               OpDecorate %37 Block
+               OpDecorate %39 DescriptorSet 0
+               OpDecorate %39 Binding 0
+               OpDecorate %166 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeStruct %6
+          %8 = OpTypePointer Function %7
+          %9 = OpTypeFunction %2 %8
+         %18 = OpTypeFloat 32
+         %19 = OpTypeVector %18 2
+         %20 = OpTypeStruct %19
+         %21 = OpTypePointer Uniform %20
+         %22 = OpVariable %21 Uniform
+         %23 = OpConstant %6 0
+         %24 = OpTypeInt 32 0
+         %25 = OpConstant %24 0
+         %26 = OpTypePointer Uniform %18
+         %29 = OpConstant %24 1
+         %32 = OpTypeBool
+         %35 = OpConstant %24 5
+         %36 = OpTypeArray %6 %35
+         %37 = OpTypeStruct %36
+         %38 = OpTypePointer Uniform %37
+         %39 = OpVariable %38 Uniform
+         %40 = OpTypePointer Uniform %6
+         %43 = OpTypePointer Function %6
+         %46 = OpConstant %6 2
+         %55 = OpConstant %6 1
+         %59 = OpConstant %24 3
+         %60 = OpTypeArray %7 %59
+         %61 = OpTypePointer Function %60
+         %97 = OpConstant %6 3
+        %124 = OpConstant %6 4
+        %164 = OpTypeVector %18 4
+        %165 = OpTypePointer Output %164
+        %166 = OpVariable %165 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %45 = OpVariable %43 Function
+         %62 = OpVariable %61 Function
+         %68 = OpVariable %43 Function
+        %102 = OpVariable %8 Function
+        %109 = OpVariable %43 Function
+         %47 = OpAccessChain %40 %39 %23 %46
+         %48 = OpLoad %6 %47
+               OpStore %45 %48
+               OpBranch %49
+         %49 = OpLabel
+               OpLoopMerge %51 %52 None
+               OpBranch %53
+         %53 = OpLabel
+         %54 = OpLoad %6 %45
+         %56 = OpAccessChain %40 %39 %23 %55
+         %57 = OpLoad %6 %56
+         %58 = OpSLessThan %32 %54 %57
+               OpBranchConditional %58 %50 %51
+         %50 = OpLabel
+         %63 = OpLoad %6 %45
+         %64 = OpLoad %6 %45
+         %65 = OpAccessChain %43 %62 %63 %23
+               OpStore %65 %64
+               OpBranch %52
+         %52 = OpLabel
+         %66 = OpLoad %6 %45
+         %67 = OpIAdd %6 %66 %55
+               OpStore %45 %67
+               OpBranch %49
+         %51 = OpLabel
+         %69 = OpAccessChain %40 %39 %23 %46
+         %70 = OpLoad %6 %69
+               OpStore %68 %70
+               OpBranch %71
+         %71 = OpLabel
+               OpLoopMerge %73 %74 None
+               OpBranch %75
+         %75 = OpLabel
+         %76 = OpLoad %6 %68
+         %77 = OpAccessChain %40 %39 %23 %55
+         %78 = OpLoad %6 %77
+         %79 = OpSLessThan %32 %76 %78
+               OpBranchConditional %79 %72 %73
+         %72 = OpLabel
+         %80 = OpAccessChain %26 %22 %23 %25
+         %81 = OpLoad %18 %80
+         %82 = OpAccessChain %26 %22 %23 %29
+         %83 = OpLoad %18 %82
+         %84 = OpFOrdGreaterThan %32 %81 %83
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %85 %86
+         %85 = OpLabel
+               OpBranch %73
+         %86 = OpLabel
+         %88 = OpLoad %6 %68
+         %89 = OpAccessChain %43 %62 %88 %23
+         %90 = OpLoad %6 %89
+         %91 = OpAccessChain %40 %39 %23 %23
+         %92 = OpLoad %6 %91
+         %93 = OpIEqual %32 %90 %92
+               OpSelectionMerge %95 None
+               OpBranchConditional %93 %94 %108
+         %94 = OpLabel
+         %96 = OpLoad %6 %68
+         %98 = OpExtInst %6 %1 SClamp %96 %23 %97
+         %99 = OpAccessChain %40 %39 %23 %97
+        %100 = OpLoad %6 %99
+        %101 = OpAccessChain %43 %62 %98 %23
+               OpStore %101 %100
+        %103 = OpAccessChain %8 %62 %46
+        %104 = OpLoad %7 %103
+               OpStore %102 %104
+        %105 = OpFunctionCall %2 %11 %102
+        %106 = OpLoad %7 %102
+        %107 = OpAccessChain %8 %62 %46
+               OpStore %107 %106
+               OpBranch %95
+        %108 = OpLabel
+        %110 = OpAccessChain %40 %39 %23 %46
+        %111 = OpLoad %6 %110
+               OpStore %109 %111
+               OpBranch %112
+        %112 = OpLabel
+               OpLoopMerge %114 %115 None
+               OpBranch %116
+        %116 = OpLabel
+        %117 = OpLoad %6 %109
+        %118 = OpAccessChain %40 %39 %23 %55
+        %119 = OpLoad %6 %118
+        %120 = OpSLessThan %32 %117 %119
+               OpBranchConditional %120 %113 %114
+        %113 = OpLabel
+        %121 = OpLoad %6 %109
+        %122 = OpAccessChain %43 %62 %121 %23
+        %123 = OpLoad %6 %122
+        %125 = OpAccessChain %40 %39 %23 %124
+        %126 = OpLoad %6 %125
+        %127 = OpSGreaterThan %32 %123 %126
+               OpSelectionMerge %129 None
+               OpBranchConditional %127 %128 %129
+        %128 = OpLabel
+               OpKill
+        %129 = OpLabel
+               OpBranch %115
+        %115 = OpLabel
+        %131 = OpLoad %6 %109
+        %132 = OpIAdd %6 %131 %55
+               OpStore %109 %132
+               OpBranch %112
+        %114 = OpLabel
+               OpBranch %95
+         %95 = OpLabel
+               OpBranch %74
+         %74 = OpLabel
+        %133 = OpLoad %6 %68
+        %134 = OpIAdd %6 %133 %55
+               OpStore %68 %134
+               OpBranch %71
+         %73 = OpLabel
+        %135 = OpAccessChain %40 %39 %23 %46
+        %136 = OpLoad %6 %135
+        %137 = OpAccessChain %43 %62 %136 %23
+        %138 = OpLoad %6 %137
+        %139 = OpAccessChain %40 %39 %23 %46
+        %140 = OpLoad %6 %139
+        %141 = OpIEqual %32 %138 %140
+               OpSelectionMerge %143 None
+               OpBranchConditional %141 %142 %143
+        %142 = OpLabel
+        %144 = OpAccessChain %40 %39 %23 %23
+        %145 = OpLoad %6 %144
+        %146 = OpAccessChain %43 %62 %145 %23
+        %147 = OpLoad %6 %146
+        %148 = OpAccessChain %40 %39 %23 %97
+        %149 = OpLoad %6 %148
+        %150 = OpIEqual %32 %147 %149
+               OpBranch %143
+        %143 = OpLabel
+        %151 = OpPhi %32 %141 %73 %150 %142
+               OpSelectionMerge %153 None
+               OpBranchConditional %151 %152 %153
+        %152 = OpLabel
+        %154 = OpAccessChain %40 %39 %23 %97
+        %155 = OpLoad %6 %154
+        %156 = OpAccessChain %43 %62 %155 %23
+        %157 = OpLoad %6 %156
+        %158 = OpAccessChain %40 %39 %23 %23
+        %159 = OpLoad %6 %158
+        %160 = OpIEqual %32 %157 %159
+               OpBranch %153
+        %153 = OpLabel
+        %161 = OpPhi %32 %151 %143 %160 %152
+               OpSelectionMerge %163 None
+               OpBranchConditional %161 %162 %180
+        %162 = OpLabel
+        %167 = OpAccessChain %40 %39 %23 %23
+        %168 = OpLoad %6 %167
+        %169 = OpConvertSToF %18 %168
+        %170 = OpAccessChain %40 %39 %23 %46
+        %171 = OpLoad %6 %170
+        %172 = OpConvertSToF %18 %171
+        %173 = OpAccessChain %40 %39 %23 %46
+        %174 = OpLoad %6 %173
+        %175 = OpConvertSToF %18 %174
+        %176 = OpAccessChain %40 %39 %23 %23
+        %177 = OpLoad %6 %176
+        %178 = OpConvertSToF %18 %177
+        %179 = OpCompositeConstruct %164 %169 %172 %175 %178
+               OpStore %166 %179
+               OpBranch %163
+        %180 = OpLabel
+        %181 = OpAccessChain %40 %39 %23 %46
+        %182 = OpLoad %6 %181
+        %183 = OpConvertSToF %18 %182
+        %184 = OpCompositeConstruct %164 %183 %183 %183 %183
+               OpStore %166 %184
+               OpBranch %163
+        %163 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %11 = OpFunction %2 None %9
+         %10 = OpFunctionParameter %8
+         %12 = OpLabel
+               OpBranch %13
+         %13 = OpLabel
+               OpLoopMerge %15 %16 None
+               OpBranch %17
+         %17 = OpLabel
+         %27 = OpAccessChain %26 %22 %23 %25
+         %28 = OpLoad %18 %27
+         %30 = OpAccessChain %26 %22 %23 %29
+         %31 = OpLoad %18 %30
+         %33 = OpFOrdGreaterThan %32 %28 %31
+               OpBranchConditional %33 %14 %15
+         %14 = OpLabel
+               OpReturn
+         %16 = OpLabel
+               OpBranch %13
+         %15 = OpLabel
+         %41 = OpAccessChain %40 %39 %23 %23
+         %42 = OpLoad %6 %41
+         %44 = OpAccessChain %43 %10 %23
+               OpStore %44 %42
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# v1
+BUFFER variant_v1 DATA_TYPE vec2<float> STD140 DATA
+ 0.0 1.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 3 0 2 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_v1 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-value-inst-combine-select-value-tracking-flip-bits.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-inst-combine-select-value-tracking-flip-bits.amber
new file mode 100644 (file)
index 0000000..221764e
--- /dev/null
@@ -0,0 +1,205 @@
+#!amber
+
+# Copyright 2020 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: Covers value, inst combine select and value tracking 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 310 es
+# #define _int_2 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [2, 0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int A[2];
+#     for (int i = _int_0; i < _int_2; i++)
+#     {
+#         A[i] = i;
+#     }
+#
+#     int a = min(~(A[_int_0]), ~(A[_int_1]));
+#
+#     _GLF_color = vec4(_int_0);
+#
+#     if (a == -_int_2)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 80
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %55
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "i"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %33 "A"
+               OpName %39 "a"
+               OpName %55 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %55 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
+         %28 = OpTypeBool
+         %30 = OpConstant %9 2
+         %31 = OpTypeArray %6 %30
+         %32 = OpTypePointer Function %31
+         %45 = OpConstant %6 2
+         %52 = OpTypeFloat 32
+         %53 = OpTypeVector %52 4
+         %54 = OpTypePointer Output %53
+         %55 = OpVariable %54 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %33 = OpVariable %32 Function
+         %39 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %14 %15 %16
+         %19 = OpLoad %6 %18
+               OpStore %8 %19
+               OpBranch %20
+         %20 = OpLabel
+               OpLoopMerge %22 %23 None
+               OpBranch %24
+         %24 = OpLabel
+         %25 = OpLoad %6 %8
+         %26 = OpAccessChain %17 %14 %15 %15
+         %27 = OpLoad %6 %26
+         %29 = OpSLessThan %28 %25 %27
+               OpBranchConditional %29 %21 %22
+         %21 = OpLabel
+         %34 = OpLoad %6 %8
+         %35 = OpLoad %6 %8
+         %36 = OpAccessChain %7 %33 %34
+               OpStore %36 %35
+               OpBranch %23
+         %23 = OpLabel
+         %37 = OpLoad %6 %8
+         %38 = OpIAdd %6 %37 %16
+               OpStore %8 %38
+               OpBranch %20
+         %22 = OpLabel
+         %40 = OpAccessChain %17 %14 %15 %16
+         %41 = OpLoad %6 %40
+         %42 = OpAccessChain %7 %33 %41
+         %43 = OpLoad %6 %42
+         %44 = OpNot %6 %43
+         %46 = OpAccessChain %17 %14 %15 %45
+         %47 = OpLoad %6 %46
+         %48 = OpAccessChain %7 %33 %47
+         %49 = OpLoad %6 %48
+         %50 = OpNot %6 %49
+         %51 = OpExtInst %6 %1 SMin %44 %50
+               OpStore %39 %51
+         %56 = OpAccessChain %17 %14 %15 %16
+         %57 = OpLoad %6 %56
+         %58 = OpConvertSToF %52 %57
+         %59 = OpCompositeConstruct %53 %58 %58 %58 %58
+               OpStore %55 %59
+         %60 = OpLoad %6 %39
+         %61 = OpAccessChain %17 %14 %15 %15
+         %62 = OpLoad %6 %61
+         %63 = OpSNegate %6 %62
+         %64 = OpIEqual %28 %60 %63
+               OpSelectionMerge %66 None
+               OpBranchConditional %64 %65 %66
+         %65 = OpLabel
+         %67 = OpAccessChain %17 %14 %15 %45
+         %68 = OpLoad %6 %67
+         %69 = OpConvertSToF %52 %68
+         %70 = OpAccessChain %17 %14 %15 %16
+         %71 = OpLoad %6 %70
+         %72 = OpConvertSToF %52 %71
+         %73 = OpAccessChain %17 %14 %15 %16
+         %74 = OpLoad %6 %73
+         %75 = OpConvertSToF %52 %74
+         %76 = OpAccessChain %17 %14 %15 %45
+         %77 = OpLoad %6 %76
+         %78 = OpConvertSToF %52 %77
+         %79 = OpCompositeConstruct %53 %69 %72 %75 %78
+               OpStore %55 %79
+               OpBranch %66
+         %66 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 2 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-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator.amber
new file mode 100644 (file)
index 0000000..d5100df
--- /dev/null
@@ -0,0 +1,206 @@
+#!amber
+
+# Copyright 2020 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 calculates modulo of constant one with a loop iterator
+
+# 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 310 es
+# #define _int_5 _GLF_uniform_int_values[0]
+# #define _int_3 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [5, 3, 0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = _int_0;
+#     for (int i = _int_1; i < _int_5; i++)
+#     {
+#         // True when i = 1.
+#         if (1 % i == _int_0)
+#         {
+#             continue;
+#         }
+#         a++;
+#     }
+#     if (a == _int_3)
+#     {
+#         _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; 8
+; Bound: 75
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %56
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %20 "i"
+               OpName %56 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %56 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 4
+         %11 = OpTypeArray %6 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpConstant %6 0
+         %16 = OpConstant %6 2
+         %17 = OpTypePointer Uniform %6
+         %21 = OpConstant %6 3
+         %32 = OpTypeBool
+         %34 = OpConstant %6 1
+         %53 = OpTypeFloat 32
+         %54 = OpTypeVector %53 4
+         %55 = OpTypePointer Output %54
+         %56 = OpVariable %55 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
+         %22 = OpAccessChain %17 %14 %15 %21
+         %23 = OpLoad %6 %22
+               OpStore %20 %23
+               OpBranch %24
+         %24 = OpLabel
+               OpLoopMerge %26 %27 None
+               OpBranch %28
+         %28 = OpLabel
+         %29 = OpLoad %6 %20
+         %30 = OpAccessChain %17 %14 %15 %15
+         %31 = OpLoad %6 %30
+         %33 = OpSLessThan %32 %29 %31
+               OpBranchConditional %33 %25 %26
+         %25 = OpLabel
+         %35 = OpLoad %6 %20
+         %36 = OpSMod %6 %34 %35
+         %37 = OpAccessChain %17 %14 %15 %16
+         %38 = OpLoad %6 %37
+         %39 = OpIEqual %32 %36 %38
+               OpSelectionMerge %41 None
+               OpBranchConditional %39 %40 %41
+         %40 = OpLabel
+               OpBranch %27
+         %41 = OpLabel
+         %43 = OpLoad %6 %8
+         %44 = OpIAdd %6 %43 %34
+               OpStore %8 %44
+               OpBranch %27
+         %27 = OpLabel
+         %45 = OpLoad %6 %20
+         %46 = OpIAdd %6 %45 %34
+               OpStore %20 %46
+               OpBranch %24
+         %26 = OpLabel
+         %47 = OpLoad %6 %8
+         %48 = OpAccessChain %17 %14 %15 %34
+         %49 = OpLoad %6 %48
+         %50 = OpIEqual %32 %47 %49
+               OpSelectionMerge %52 None
+               OpBranchConditional %50 %51 %70
+         %51 = OpLabel
+         %57 = OpAccessChain %17 %14 %15 %21
+         %58 = OpLoad %6 %57
+         %59 = OpConvertSToF %53 %58
+         %60 = OpAccessChain %17 %14 %15 %16
+         %61 = OpLoad %6 %60
+         %62 = OpConvertSToF %53 %61
+         %63 = OpAccessChain %17 %14 %15 %16
+         %64 = OpLoad %6 %63
+         %65 = OpConvertSToF %53 %64
+         %66 = OpAccessChain %17 %14 %15 %21
+         %67 = OpLoad %6 %66
+         %68 = OpConvertSToF %53 %67
+         %69 = OpCompositeConstruct %54 %59 %62 %65 %68
+               OpStore %56 %69
+               OpBranch %52
+         %70 = OpLabel
+         %71 = OpAccessChain %17 %14 %15 %16
+         %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
+ 5 3 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-value-tracking-constant-fold-refraction-dfxd-determinant.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-constant-fold-refraction-dfxd-determinant.amber
new file mode 100644 (file)
index 0000000..8c63788
--- /dev/null
@@ -0,0 +1,282 @@
+#!amber
+
+# Copyright 2020 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 calculates refraction with certain values
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _float_0_1 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0, 0.1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float I = -1.0;
+#     // N becomes 0.
+#     float N = dFdx(determinant(mat3(1.0)));
+#     // Usually eta is normalized, but the spec doesn't forbid other values.
+#     float eta = -1.1;
+#
+#     // Refraction calculated by the formula from the spec.
+#     float R;
+#     float k = _float_1_0 - eta * eta * (_float_1_0 - dot(N, I) * dot(N, I));
+#
+#     if (k < _float_0_0)
+#     {
+#         R = _float_0_0;
+#     }
+#     else
+#     {
+#         R = eta * I - (eta * dot(N, I) + sqrt(k)) * N;
+#     }
+#
+#     if (abs(R - refract(I, N, eta)) < _float_0_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; 8
+; Bound: 116
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %91
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "I"
+               OpName %10 "N"
+               OpName %21 "eta"
+               OpName %23 "k"
+               OpName %27 "buf1"
+               OpMemberName %27 0 "_GLF_uniform_float_values"
+               OpName %29 ""
+               OpName %58 "R"
+               OpName %91 "_GLF_color"
+               OpName %94 "buf0"
+               OpMemberName %94 0 "_GLF_uniform_int_values"
+               OpName %96 ""
+               OpDecorate %26 ArrayStride 16
+               OpMemberDecorate %27 0 Offset 0
+               OpDecorate %27 Block
+               OpDecorate %29 DescriptorSet 0
+               OpDecorate %29 Binding 1
+               OpDecorate %91 Location 0
+               OpDecorate %93 ArrayStride 16
+               OpMemberDecorate %94 0 RelaxedPrecision
+               OpMemberDecorate %94 0 Offset 0
+               OpDecorate %94 Block
+               OpDecorate %96 DescriptorSet 0
+               OpDecorate %96 Binding 0
+               OpDecorate %99 RelaxedPrecision
+               OpDecorate %102 RelaxedPrecision
+               OpDecorate %105 RelaxedPrecision
+               OpDecorate %108 RelaxedPrecision
+               OpDecorate %113 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 -1
+         %11 = OpTypeVector %6 3
+         %12 = OpTypeMatrix %11 3
+         %13 = OpConstant %6 1
+         %14 = OpConstant %6 0
+         %15 = OpConstantComposite %11 %13 %14 %14
+         %16 = OpConstantComposite %11 %14 %13 %14
+         %17 = OpConstantComposite %11 %14 %14 %13
+         %18 = OpConstantComposite %12 %15 %16 %17
+         %22 = OpConstant %6 -1.10000002
+         %24 = OpTypeInt 32 0
+         %25 = OpConstant %24 3
+         %26 = OpTypeArray %6 %25
+         %27 = OpTypeStruct %26
+         %28 = OpTypePointer Uniform %27
+         %29 = OpVariable %28 Uniform
+         %30 = OpTypeInt 32 1
+         %31 = OpConstant %30 0
+         %32 = OpTypePointer Uniform %6
+         %51 = OpConstant %30 1
+         %54 = OpTypeBool
+         %83 = OpConstant %30 2
+         %89 = OpTypeVector %6 4
+         %90 = OpTypePointer Output %89
+         %91 = OpVariable %90 Output
+         %92 = OpConstant %24 2
+         %93 = OpTypeArray %30 %92
+         %94 = OpTypeStruct %93
+         %95 = OpTypePointer Uniform %94
+         %96 = OpVariable %95 Uniform
+         %97 = OpTypePointer Uniform %30
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %10 = OpVariable %7 Function
+         %21 = OpVariable %7 Function
+         %23 = OpVariable %7 Function
+         %58 = OpVariable %7 Function
+               OpStore %8 %9
+         %19 = OpExtInst %6 %1 Determinant %18
+         %20 = OpDPdx %6 %19
+               OpStore %10 %20
+               OpStore %21 %22
+         %33 = OpAccessChain %32 %29 %31 %31
+         %34 = OpLoad %6 %33
+         %35 = OpLoad %6 %21
+         %36 = OpLoad %6 %21
+         %37 = OpFMul %6 %35 %36
+         %38 = OpAccessChain %32 %29 %31 %31
+         %39 = OpLoad %6 %38
+         %40 = OpLoad %6 %10
+         %41 = OpLoad %6 %8
+         %42 = OpFMul %6 %40 %41
+         %43 = OpLoad %6 %10
+         %44 = OpLoad %6 %8
+         %45 = OpFMul %6 %43 %44
+         %46 = OpFMul %6 %42 %45
+         %47 = OpFSub %6 %39 %46
+         %48 = OpFMul %6 %37 %47
+         %49 = OpFSub %6 %34 %48
+               OpStore %23 %49
+         %50 = OpLoad %6 %23
+         %52 = OpAccessChain %32 %29 %31 %51
+         %53 = OpLoad %6 %52
+         %55 = OpFOrdLessThan %54 %50 %53
+               OpSelectionMerge %57 None
+               OpBranchConditional %55 %56 %61
+         %56 = OpLabel
+         %59 = OpAccessChain %32 %29 %31 %51
+         %60 = OpLoad %6 %59
+               OpStore %58 %60
+               OpBranch %57
+         %61 = OpLabel
+         %62 = OpLoad %6 %21
+         %63 = OpLoad %6 %8
+         %64 = OpFMul %6 %62 %63
+         %65 = OpLoad %6 %21
+         %66 = OpLoad %6 %10
+         %67 = OpLoad %6 %8
+         %68 = OpFMul %6 %66 %67
+         %69 = OpFMul %6 %65 %68
+         %70 = OpLoad %6 %23
+         %71 = OpExtInst %6 %1 Sqrt %70
+         %72 = OpFAdd %6 %69 %71
+         %73 = OpLoad %6 %10
+         %74 = OpFMul %6 %72 %73
+         %75 = OpFSub %6 %64 %74
+               OpStore %58 %75
+               OpBranch %57
+         %57 = OpLabel
+         %76 = OpLoad %6 %58
+         %77 = OpLoad %6 %8
+         %78 = OpLoad %6 %10
+         %79 = OpLoad %6 %21
+         %80 = OpExtInst %6 %1 Refract %77 %78 %79
+         %81 = OpFSub %6 %76 %80
+         %82 = OpExtInst %6 %1 FAbs %81
+         %84 = OpAccessChain %32 %29 %31 %83
+         %85 = OpLoad %6 %84
+         %86 = OpFOrdLessThan %54 %82 %85
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %87 %111
+         %87 = OpLabel
+         %98 = OpAccessChain %97 %96 %31 %31
+         %99 = OpLoad %30 %98
+        %100 = OpConvertSToF %6 %99
+        %101 = OpAccessChain %97 %96 %31 %51
+        %102 = OpLoad %30 %101
+        %103 = OpConvertSToF %6 %102
+        %104 = OpAccessChain %97 %96 %31 %51
+        %105 = OpLoad %30 %104
+        %106 = OpConvertSToF %6 %105
+        %107 = OpAccessChain %97 %96 %31 %31
+        %108 = OpLoad %30 %107
+        %109 = OpConvertSToF %6 %108
+        %110 = OpCompositeConstruct %89 %100 %103 %106 %109
+               OpStore %91 %110
+               OpBranch %88
+        %111 = OpLabel
+        %112 = OpAccessChain %97 %96 %31 %51
+        %113 = OpLoad %30 %112
+        %114 = OpConvertSToF %6 %113
+        %115 = OpCompositeConstruct %89 %114 %114 %114 %114
+               OpStore %91 %115
+               OpBranch %88
+         %88 = 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 0.1
+END
+# _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_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-value-tracking-known-nonzero.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-known-nonzero.amber
new file mode 100644 (file)
index 0000000..61fc114
--- /dev/null
@@ -0,0 +1,213 @@
+#!amber
+
+# Copyright 2020 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 a specific value tracking path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_16384 _GLF_uniform_int_values[2]
+# #define _int_98304 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 16384, 98304]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int a = 65536;
+#     int sum = _int_0;
+#
+#     // Always true.
+#     if (1 == _int_1)
+#     {
+#         a--;
+#     }
+#     for (int i = 0; i < a; i += _int_16384)
+#     {
+#         sum += i;
+#     }
+#     if (sum == _int_98304)
+#     {
+#         _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; 8
+; Bound: 76
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %57
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %10 "sum"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %30 "i"
+               OpName %57 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %57 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 65536
+         %11 = OpTypeInt 32 0
+         %12 = OpConstant %11 4
+         %13 = OpTypeArray %6 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %6 0
+         %18 = OpTypePointer Uniform %6
+         %21 = OpConstant %6 1
+         %24 = OpTypeBool
+         %42 = OpConstant %6 2
+         %48 = OpConstant %6 3
+         %54 = OpTypeFloat 32
+         %55 = OpTypeVector %54 4
+         %56 = OpTypePointer Output %55
+         %57 = OpVariable %56 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %10 = OpVariable %7 Function
+         %30 = OpVariable %7 Function
+               OpStore %8 %9
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %6 %19
+               OpStore %10 %20
+         %22 = OpAccessChain %18 %16 %17 %21
+         %23 = OpLoad %6 %22
+         %25 = OpIEqual %24 %21 %23
+               OpSelectionMerge %27 None
+               OpBranchConditional %25 %26 %27
+         %26 = OpLabel
+         %28 = OpLoad %6 %8
+         %29 = OpISub %6 %28 %21
+               OpStore %8 %29
+               OpBranch %27
+         %27 = OpLabel
+               OpStore %30 %17
+               OpBranch %31
+         %31 = OpLabel
+               OpLoopMerge %33 %34 None
+               OpBranch %35
+         %35 = OpLabel
+         %36 = OpLoad %6 %30
+         %37 = OpLoad %6 %8
+         %38 = OpSLessThan %24 %36 %37
+               OpBranchConditional %38 %32 %33
+         %32 = OpLabel
+         %39 = OpLoad %6 %30
+         %40 = OpLoad %6 %10
+         %41 = OpIAdd %6 %40 %39
+               OpStore %10 %41
+               OpBranch %34
+         %34 = OpLabel
+         %43 = OpAccessChain %18 %16 %17 %42
+         %44 = OpLoad %6 %43
+         %45 = OpLoad %6 %30
+         %46 = OpIAdd %6 %45 %44
+               OpStore %30 %46
+               OpBranch %31
+         %33 = OpLabel
+         %47 = OpLoad %6 %10
+         %49 = OpAccessChain %18 %16 %17 %48
+         %50 = OpLoad %6 %49
+         %51 = OpIEqual %24 %47 %50
+               OpSelectionMerge %53 None
+               OpBranchConditional %51 %52 %71
+         %52 = OpLabel
+         %58 = OpAccessChain %18 %16 %17 %21
+         %59 = OpLoad %6 %58
+         %60 = OpConvertSToF %54 %59
+         %61 = OpAccessChain %18 %16 %17 %17
+         %62 = OpLoad %6 %61
+         %63 = OpConvertSToF %54 %62
+         %64 = OpAccessChain %18 %16 %17 %17
+         %65 = OpLoad %6 %64
+         %66 = OpConvertSToF %54 %65
+         %67 = OpAccessChain %18 %16 %17 %21
+         %68 = OpLoad %6 %67
+         %69 = OpConvertSToF %54 %68
+         %70 = OpCompositeConstruct %55 %60 %63 %66 %69
+               OpStore %57 %70
+               OpBranch %53
+         %71 = OpLabel
+         %72 = OpAccessChain %18 %16 %17 %17
+         %73 = OpLoad %6 %72
+         %74 = OpConvertSToF %54 %73
+         %75 = OpCompositeConstruct %55 %74 %74 %74 %74
+               OpStore %57 %75
+               OpBranch %53
+         %53 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 16384 98304
+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-value-tracking-max-uintbitstofloat.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-max-uintbitstofloat.amber
new file mode 100644 (file)
index 0000000..819b97d
--- /dev/null
@@ -0,0 +1,211 @@
+#!amber
+
+# Copyright 2020 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 a specific value tracking path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _uint_1065353216 _GLF_uniform_uint_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: 1.0
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# // Contents of _GLF_uniform_uint_values: 1065353216
+# layout(set = 0, binding = 2) uniform buf2
+# {
+#     uint _GLF_uniform_uint_values[1];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float f = uintBitsToFloat(max(100u, _uint_1065353216));
+#     if (f == _float_1_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; 8
+; Bound: 63
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %37
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "f"
+               OpName %13 "buf2"
+               OpMemberName %13 0 "_GLF_uniform_uint_values"
+               OpName %15 ""
+               OpName %25 "buf1"
+               OpMemberName %25 0 "_GLF_uniform_float_values"
+               OpName %27 ""
+               OpName %37 "_GLF_color"
+               OpName %40 "buf0"
+               OpMemberName %40 0 "_GLF_uniform_int_values"
+               OpName %42 ""
+               OpDecorate %12 ArrayStride 16
+               OpMemberDecorate %13 0 Offset 0
+               OpDecorate %13 Block
+               OpDecorate %15 DescriptorSet 0
+               OpDecorate %15 Binding 2
+               OpDecorate %24 ArrayStride 16
+               OpMemberDecorate %25 0 Offset 0
+               OpDecorate %25 Block
+               OpDecorate %27 DescriptorSet 0
+               OpDecorate %27 Binding 1
+               OpDecorate %37 Location 0
+               OpDecorate %39 ArrayStride 16
+               OpMemberDecorate %40 0 Offset 0
+               OpDecorate %40 Block
+               OpDecorate %42 DescriptorSet 0
+               OpDecorate %42 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 100
+         %11 = OpConstant %9 1
+         %12 = OpTypeArray %9 %11
+         %13 = OpTypeStruct %12
+         %14 = OpTypePointer Uniform %13
+         %15 = OpVariable %14 Uniform
+         %16 = OpTypeInt 32 1
+         %17 = OpConstant %16 0
+         %18 = OpTypePointer Uniform %9
+         %24 = OpTypeArray %6 %11
+         %25 = OpTypeStruct %24
+         %26 = OpTypePointer Uniform %25
+         %27 = OpVariable %26 Uniform
+         %28 = OpTypePointer Uniform %6
+         %31 = OpTypeBool
+         %35 = OpTypeVector %6 4
+         %36 = OpTypePointer Output %35
+         %37 = OpVariable %36 Output
+         %38 = OpConstant %9 2
+         %39 = OpTypeArray %16 %38
+         %40 = OpTypeStruct %39
+         %41 = OpTypePointer Uniform %40
+         %42 = OpVariable %41 Uniform
+         %43 = OpTypePointer Uniform %16
+         %47 = OpConstant %16 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %19 = OpAccessChain %18 %15 %17 %17
+         %20 = OpLoad %9 %19
+         %21 = OpExtInst %9 %1 UMax %10 %20
+         %22 = OpBitcast %6 %21
+               OpStore %8 %22
+         %23 = OpLoad %6 %8
+         %29 = OpAccessChain %28 %27 %17 %17
+         %30 = OpLoad %6 %29
+         %32 = OpFOrdEqual %31 %23 %30
+               OpSelectionMerge %34 None
+               OpBranchConditional %32 %33 %58
+         %33 = OpLabel
+         %44 = OpAccessChain %43 %42 %17 %17
+         %45 = OpLoad %16 %44
+         %46 = OpConvertSToF %6 %45
+         %48 = OpAccessChain %43 %42 %17 %47
+         %49 = OpLoad %16 %48
+         %50 = OpConvertSToF %6 %49
+         %51 = OpAccessChain %43 %42 %17 %47
+         %52 = OpLoad %16 %51
+         %53 = OpConvertSToF %6 %52
+         %54 = OpAccessChain %43 %42 %17 %17
+         %55 = OpLoad %16 %54
+         %56 = OpConvertSToF %6 %55
+         %57 = OpCompositeConstruct %35 %46 %50 %53 %56
+               OpStore %37 %57
+               OpBranch %34
+         %58 = OpLabel
+         %59 = OpAccessChain %43 %42 %17 %47
+         %60 = OpLoad %16 %59
+         %61 = OpConvertSToF %6 %60
+         %62 = OpCompositeConstruct %35 %61 %61 %61 %61
+               OpStore %37 %62
+               OpBranch %34
+         %34 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_uint_values
+BUFFER variant__GLF_uniform_uint_values DATA_TYPE int32[] STD140 DATA
+ 1065353216
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0
+END
+# _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_uint_values AS uniform DESCRIPTOR_SET 0 BINDING 2
+  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-value-tracking-selection-dag-negation-clamp-loop.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-value-tracking-selection-dag-negation-clamp-loop.amber
new file mode 100644 (file)
index 0000000..176c435
--- /dev/null
@@ -0,0 +1,434 @@
+#!amber
+
+# Copyright 2020 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 calculates negation of clamped loop iterator values
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_3 _GLF_uniform_int_values[3]
+# #define _int_4 _GLF_uniform_int_values[4]
+# #define _int_5 _GLF_uniform_int_values[5]
+# #define _int_10 _GLF_uniform_int_values[6]
+# #define _int_15 _GLF_uniform_int_values[7]
+# #define _int_6 _GLF_uniform_int_values[8]
+# #define _int_7 _GLF_uniform_int_values[9]
+# #define _int_8 _GLF_uniform_int_values[10]
+# #define _int_9 _GLF_uniform_int_values[11]
+# #define _int_11 _GLF_uniform_int_values[12]
+# #define _int_12 _GLF_uniform_int_values[13]
+# #define _int_13 _GLF_uniform_int_values[14]
+# #define _int_14 _GLF_uniform_int_values[15]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 2, 3, 4, 5, 10, 15, 6, 7, 8, 9,
+# // 11, 12, 13, 14]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[16];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int data[15];
+#     int ref[15];
+#     ref[_int_0] = _int_0;
+#     ref[_int_1] = _int_1;
+#     ref[_int_2] = _int_2;
+#     ref[_int_3] = _int_3;
+#     ref[_int_4] = _int_4;
+#     ref[_int_5] = -_int_1;
+#     ref[_int_6] = -_int_1;
+#     ref[_int_7] = -_int_1;
+#     ref[_int_8] = -_int_1;
+#     ref[_int_9] = -_int_1;
+#     ref[_int_10] = -_int_2;
+#     ref[_int_11] = -_int_2;
+#     ref[_int_12] = -_int_2;
+#     ref[_int_13] = -_int_2;
+#     ref[_int_14] = -_int_2;
+#
+#     for (int i = 0; i < _int_5; i++)
+#     {
+#         data[i] = ~clamp(~i, ~i, _int_1);
+#     }
+#     for (int i = _int_5; i < _int_10; i++)
+#     {
+#         data[i] = ~clamp(~i, 0, 1);
+#     }
+#     for (int i = _int_10; i < _int_15; i++)
+#     {
+#         data[i] = ~clamp(i, 0, 1);
+#     }
+#     for (int i = _int_0; i < _int_15; i++)
+#     {
+#         if (data[i] != ref[i])
+#         {
+#             _GLF_color = vec4(_int_0);
+#             return;
+#         }
+#     }
+#
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 228
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %207
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "ref"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %119 "i"
+               OpName %130 "data"
+               OpName %143 "i"
+               OpName %163 "i"
+               OpName %183 "i"
+               OpName %207 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %207 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 15
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypePointer Function %9
+         %12 = OpConstant %7 16
+         %13 = OpTypeArray %6 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %6 0
+         %18 = OpTypePointer Uniform %6
+         %23 = OpTypePointer Function %6
+         %25 = OpConstant %6 1
+         %31 = OpConstant %6 2
+         %37 = OpConstant %6 3
+         %43 = OpConstant %6 4
+         %49 = OpConstant %6 5
+         %56 = OpConstant %6 8
+         %63 = OpConstant %6 9
+         %70 = OpConstant %6 10
+         %77 = OpConstant %6 11
+         %84 = OpConstant %6 6
+         %91 = OpConstant %6 12
+         %98 = OpConstant %6 13
+        %105 = OpConstant %6 14
+        %112 = OpConstant %6 15
+        %128 = OpTypeBool
+        %172 = OpConstant %6 7
+        %204 = OpTypeFloat 32
+        %205 = OpTypeVector %204 4
+        %206 = OpTypePointer Output %205
+        %207 = OpVariable %206 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+        %119 = OpVariable %23 Function
+        %130 = OpVariable %10 Function
+        %143 = OpVariable %23 Function
+        %163 = OpVariable %23 Function
+        %183 = OpVariable %23 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %6 %19
+         %21 = OpAccessChain %18 %16 %17 %17
+         %22 = OpLoad %6 %21
+         %24 = OpAccessChain %23 %11 %20
+               OpStore %24 %22
+         %26 = OpAccessChain %18 %16 %17 %25
+         %27 = OpLoad %6 %26
+         %28 = OpAccessChain %18 %16 %17 %25
+         %29 = OpLoad %6 %28
+         %30 = OpAccessChain %23 %11 %27
+               OpStore %30 %29
+         %32 = OpAccessChain %18 %16 %17 %31
+         %33 = OpLoad %6 %32
+         %34 = OpAccessChain %18 %16 %17 %31
+         %35 = OpLoad %6 %34
+         %36 = OpAccessChain %23 %11 %33
+               OpStore %36 %35
+         %38 = OpAccessChain %18 %16 %17 %37
+         %39 = OpLoad %6 %38
+         %40 = OpAccessChain %18 %16 %17 %37
+         %41 = OpLoad %6 %40
+         %42 = OpAccessChain %23 %11 %39
+               OpStore %42 %41
+         %44 = OpAccessChain %18 %16 %17 %43
+         %45 = OpLoad %6 %44
+         %46 = OpAccessChain %18 %16 %17 %43
+         %47 = OpLoad %6 %46
+         %48 = OpAccessChain %23 %11 %45
+               OpStore %48 %47
+         %50 = OpAccessChain %18 %16 %17 %49
+         %51 = OpLoad %6 %50
+         %52 = OpAccessChain %18 %16 %17 %25
+         %53 = OpLoad %6 %52
+         %54 = OpSNegate %6 %53
+         %55 = OpAccessChain %23 %11 %51
+               OpStore %55 %54
+         %57 = OpAccessChain %18 %16 %17 %56
+         %58 = OpLoad %6 %57
+         %59 = OpAccessChain %18 %16 %17 %25
+         %60 = OpLoad %6 %59
+         %61 = OpSNegate %6 %60
+         %62 = OpAccessChain %23 %11 %58
+               OpStore %62 %61
+         %64 = OpAccessChain %18 %16 %17 %63
+         %65 = OpLoad %6 %64
+         %66 = OpAccessChain %18 %16 %17 %25
+         %67 = OpLoad %6 %66
+         %68 = OpSNegate %6 %67
+         %69 = OpAccessChain %23 %11 %65
+               OpStore %69 %68
+         %71 = OpAccessChain %18 %16 %17 %70
+         %72 = OpLoad %6 %71
+         %73 = OpAccessChain %18 %16 %17 %25
+         %74 = OpLoad %6 %73
+         %75 = OpSNegate %6 %74
+         %76 = OpAccessChain %23 %11 %72
+               OpStore %76 %75
+         %78 = OpAccessChain %18 %16 %17 %77
+         %79 = OpLoad %6 %78
+         %80 = OpAccessChain %18 %16 %17 %25
+         %81 = OpLoad %6 %80
+         %82 = OpSNegate %6 %81
+         %83 = OpAccessChain %23 %11 %79
+               OpStore %83 %82
+         %85 = OpAccessChain %18 %16 %17 %84
+         %86 = OpLoad %6 %85
+         %87 = OpAccessChain %18 %16 %17 %31
+         %88 = OpLoad %6 %87
+         %89 = OpSNegate %6 %88
+         %90 = OpAccessChain %23 %11 %86
+               OpStore %90 %89
+         %92 = OpAccessChain %18 %16 %17 %91
+         %93 = OpLoad %6 %92
+         %94 = OpAccessChain %18 %16 %17 %31
+         %95 = OpLoad %6 %94
+         %96 = OpSNegate %6 %95
+         %97 = OpAccessChain %23 %11 %93
+               OpStore %97 %96
+         %99 = OpAccessChain %18 %16 %17 %98
+        %100 = OpLoad %6 %99
+        %101 = OpAccessChain %18 %16 %17 %31
+        %102 = OpLoad %6 %101
+        %103 = OpSNegate %6 %102
+        %104 = OpAccessChain %23 %11 %100
+               OpStore %104 %103
+        %106 = OpAccessChain %18 %16 %17 %105
+        %107 = OpLoad %6 %106
+        %108 = OpAccessChain %18 %16 %17 %31
+        %109 = OpLoad %6 %108
+        %110 = OpSNegate %6 %109
+        %111 = OpAccessChain %23 %11 %107
+               OpStore %111 %110
+        %113 = OpAccessChain %18 %16 %17 %112
+        %114 = OpLoad %6 %113
+        %115 = OpAccessChain %18 %16 %17 %31
+        %116 = OpLoad %6 %115
+        %117 = OpSNegate %6 %116
+        %118 = OpAccessChain %23 %11 %114
+               OpStore %118 %117
+               OpStore %119 %17
+               OpBranch %120
+        %120 = OpLabel
+               OpLoopMerge %122 %123 None
+               OpBranch %124
+        %124 = OpLabel
+        %125 = OpLoad %6 %119
+        %126 = OpAccessChain %18 %16 %17 %49
+        %127 = OpLoad %6 %126
+        %129 = OpSLessThan %128 %125 %127
+               OpBranchConditional %129 %121 %122
+        %121 = OpLabel
+        %131 = OpLoad %6 %119
+        %132 = OpLoad %6 %119
+        %133 = OpNot %6 %132
+        %134 = OpLoad %6 %119
+        %135 = OpNot %6 %134
+        %136 = OpAccessChain %18 %16 %17 %25
+        %137 = OpLoad %6 %136
+        %138 = OpExtInst %6 %1 SClamp %133 %135 %137
+        %139 = OpNot %6 %138
+        %140 = OpAccessChain %23 %130 %131
+               OpStore %140 %139
+               OpBranch %123
+        %123 = OpLabel
+        %141 = OpLoad %6 %119
+        %142 = OpIAdd %6 %141 %25
+               OpStore %119 %142
+               OpBranch %120
+        %122 = OpLabel
+        %144 = OpAccessChain %18 %16 %17 %49
+        %145 = OpLoad %6 %144
+               OpStore %143 %145
+               OpBranch %146
+        %146 = OpLabel
+               OpLoopMerge %148 %149 None
+               OpBranch %150
+        %150 = OpLabel
+        %151 = OpLoad %6 %143
+        %152 = OpAccessChain %18 %16 %17 %84
+        %153 = OpLoad %6 %152
+        %154 = OpSLessThan %128 %151 %153
+               OpBranchConditional %154 %147 %148
+        %147 = OpLabel
+        %155 = OpLoad %6 %143
+        %156 = OpLoad %6 %143
+        %157 = OpNot %6 %156
+        %158 = OpExtInst %6 %1 SClamp %157 %17 %25
+        %159 = OpNot %6 %158
+        %160 = OpAccessChain %23 %130 %155
+               OpStore %160 %159
+               OpBranch %149
+        %149 = OpLabel
+        %161 = OpLoad %6 %143
+        %162 = OpIAdd %6 %161 %25
+               OpStore %143 %162
+               OpBranch %146
+        %148 = OpLabel
+        %164 = OpAccessChain %18 %16 %17 %84
+        %165 = OpLoad %6 %164
+               OpStore %163 %165
+               OpBranch %166
+        %166 = OpLabel
+               OpLoopMerge %168 %169 None
+               OpBranch %170
+        %170 = OpLabel
+        %171 = OpLoad %6 %163
+        %173 = OpAccessChain %18 %16 %17 %172
+        %174 = OpLoad %6 %173
+        %175 = OpSLessThan %128 %171 %174
+               OpBranchConditional %175 %167 %168
+        %167 = OpLabel
+        %176 = OpLoad %6 %163
+        %177 = OpLoad %6 %163
+        %178 = OpExtInst %6 %1 SClamp %177 %17 %25
+        %179 = OpNot %6 %178
+        %180 = OpAccessChain %23 %130 %176
+               OpStore %180 %179
+               OpBranch %169
+        %169 = OpLabel
+        %181 = OpLoad %6 %163
+        %182 = OpIAdd %6 %181 %25
+               OpStore %163 %182
+               OpBranch %166
+        %168 = OpLabel
+        %184 = OpAccessChain %18 %16 %17 %17
+        %185 = OpLoad %6 %184
+               OpStore %183 %185
+               OpBranch %186
+        %186 = OpLabel
+               OpLoopMerge %188 %189 None
+               OpBranch %190
+        %190 = OpLabel
+        %191 = OpLoad %6 %183
+        %192 = OpAccessChain %18 %16 %17 %172
+        %193 = OpLoad %6 %192
+        %194 = OpSLessThan %128 %191 %193
+               OpBranchConditional %194 %187 %188
+        %187 = OpLabel
+        %195 = OpLoad %6 %183
+        %196 = OpAccessChain %23 %130 %195
+        %197 = OpLoad %6 %196
+        %198 = OpLoad %6 %183
+        %199 = OpAccessChain %23 %11 %198
+        %200 = OpLoad %6 %199
+        %201 = OpINotEqual %128 %197 %200
+               OpSelectionMerge %203 None
+               OpBranchConditional %201 %202 %203
+        %202 = OpLabel
+        %208 = OpAccessChain %18 %16 %17 %17
+        %209 = OpLoad %6 %208
+        %210 = OpConvertSToF %204 %209
+        %211 = OpCompositeConstruct %205 %210 %210 %210 %210
+               OpStore %207 %211
+               OpReturn
+        %203 = OpLabel
+               OpBranch %189
+        %189 = OpLabel
+        %213 = OpLoad %6 %183
+        %214 = OpIAdd %6 %213 %25
+               OpStore %183 %214
+               OpBranch %186
+        %188 = OpLabel
+        %215 = OpAccessChain %18 %16 %17 %25
+        %216 = OpLoad %6 %215
+        %217 = OpConvertSToF %204 %216
+        %218 = OpAccessChain %18 %16 %17 %17
+        %219 = OpLoad %6 %218
+        %220 = OpConvertSToF %204 %219
+        %221 = OpAccessChain %18 %16 %17 %17
+        %222 = OpLoad %6 %221
+        %223 = OpConvertSToF %204 %222
+        %224 = OpAccessChain %18 %16 %17 %25
+        %225 = OpLoad %6 %224
+        %226 = OpConvertSToF %204 %225
+        %227 = OpCompositeConstruct %205 %217 %220 %223 %226
+               OpStore %207 %227
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 2 3 4 5 10 15 6 7 8 9 11 12 13 14
+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 2fb785a..934ad32 100644 (file)
@@ -24,6 +24,8 @@
 {      "cov-apfloat-tanh.amber",                                                                                                                                       "cov-apfloat-tanh",                                                                                                                                     "A fragment shader that covers a specific arbitrary precision float usage."                     },
 {      "cov-basic-block-discard-in-function.amber",                                                                                            "cov-basic-block-discard-in-function",                                                                                          "A fragment shader that covers a specific basic block code path"                                        },
 {      "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"                                      },
+{      "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-const-folding-ceil-vec4.amber",                                                                                                            "cov-const-folding-ceil-vec4",                                                                                                          "A fragment shader that covers a specific constant folding code path"                           },
 {      "cov-const-folding-clamp.amber",                                                                                                                        "cov-const-folding-clamp",                                                                                                                      "A fragment shader that covers a specific const folding rule path."                                     },
 {      "cov-const-folding-clamp-inside-while.amber",                                                                                           "cov-const-folding-clamp-inside-while",                                                                                         "A fragment shader that covers a specific constant folding path"                                        },
@@ -43,6 +45,9 @@
 {      "cov-copy-prop-arrays-func-argument.amber",                                                                                                     "cov-copy-prop-arrays-func-argument",                                                                                           "A fragment shader that covers a specific propagate array copy path."                           },
 {      "cov-copy-prop-arrays-no-stores.amber",                                                                                                         "cov-copy-prop-arrays-no-stores",                                                                                                       "A fragment shader that covers a specific propagate array copy path."                           },
 {      "cov-copy-prop-arrays-param-uniform.amber",                                                                                                     "cov-copy-prop-arrays-param-uniform",                                                                                           "A fragment shader that covers a specific propagate array copy path."                           },
+{      "cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop.amber",                      "cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop",            "Covers DAG combiner, cast combining and legalize vector types code paths"                      },
+{      "cov-dag-combiner-findmsb-loop.amber",                                                                                                          "cov-dag-combiner-findmsb-loop",                                                                                                        "A fragment shader that covers a specific DAG combiner code path"                                       },
+{      "cov-dag-combiner-increment-color.amber",                                                                                                       "cov-dag-combiner-increment-color",                                                                                                     "A fragment shader that covers a specific DAG combiner code path"                                       },
 {      "cov-dag-combiner-neg-div-pow2.amber",                                                                                                          "cov-dag-combiner-neg-div-pow2",                                                                                                        "A fragment shader that covers a specific DAG combiner code path"                                       },
 {      "cov-dag-combiner-same-cond-nested.amber",                                                                                                      "cov-dag-combiner-same-cond-nested",                                                                                            "A fragment shader that covers a specific DAG combiner code path"                                       },
 {      "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-inline-pass-nested-loops.amber",                                                                                                           "cov-inline-pass-nested-loops",                                                                                                         "A fragment shader that covers a specific inlining optimization path."                          },
 {      "cov-inline-pass-return-in-loop.amber",                                                                                                         "cov-inline-pass-return-in-loop",                                                                                                       "A fragment shader that covers a specific inlining optimization path."                          },
 {      "cov-inline-pass-unreachable-func.amber",                                                                                                       "cov-inline-pass-unreachable-func",                                                                                                     "A fragment shader that covers a specific inlining optimization path."                          },
+{      "cov-inst-combine-compares-while-modulo.amber",                                                                                         "cov-inst-combine-compares-while-modulo",                                                                                       "A fragment shader that covers a specific inst combine compares code path"                      },
+{      "cov-inst-peephole-optimizer-acosh.amber",                                                                                                      "cov-inst-peephole-optimizer-acosh",                                                                                            "A fragment shader that covers a specific peephole optimizer code path"                         },
+{      "cov-inst-value-tracking-inversesqrt.amber",                                                                                            "cov-inst-value-tracking-inversesqrt",                                                                                          "A fragment shader that covers a specific value tracking path"                                          },
+{      "cov-instr-emitter-pow-asinh.amber",                                                                                                            "cov-instr-emitter-pow-asinh",                                                                                                          "A fragment shader that covers a specific instruction emitter code path"                        },
+{      "cov-instruction-simplify-atanh-log-undefined.amber",                                                                           "cov-instruction-simplify-atanh-log-undefined",                                                                         "A fragment shader that covers a specific instruction simplification path"                      },
+{      "cov-instruction-simplify-bit-shifting.amber",                                                                                          "cov-instruction-simplify-bit-shifting",                                                                                        "A fragment shader that covers a specific instruction simplification path"                      },
+{      "cov-instruction-simplify-inclusive-or.amber",                                                                                          "cov-instruction-simplify-inclusive-or",                                                                                        "A fragment shader that covers a specific instruction simplification path"                      },
+{      "cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result.amber",           "cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result",         "A fragment shader that covers a specific instruction simplification path"                      },
+{      "cov-instruction-simplify-mod-acos-undefined.amber",                                                                            "cov-instruction-simplify-mod-acos-undefined",                                                                          "A fragment shader that covers a specific instruction simplification path"                      },
+{      "cov-instruction-simplify-mod-sqrt-undefined.amber",                                                                            "cov-instruction-simplify-mod-sqrt-undefined",                                                                          "A fragment shader that covers a specific instruction simplification path"                      },
+{      "cov-instruction-simplify-sqrt.amber",                                                                                                          "cov-instruction-simplify-sqrt",                                                                                                        "A fragment shader that covers a specific instruction simplify code path"                       },
+{      "cov-instructions-first-value-phi.amber",                                                                                                       "cov-instructions-first-value-phi",                                                                                                     "A fragment shader that covers a specific instructions code path"                                       },
 {      "cov-intervalmap-set-stop.amber",                                                                                                                       "cov-intervalmap-set-stop",                                                                                                                     "A fragment shader that covers a specific interval map code path."                                      },
+{      "cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if.amber",         "cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if",       "Covers IR builder, constant fold, inst combine calls and value tracking code paths"},
 {      "cov-irbuilder-matrix-cell-uniform.amber",                                                                                                      "cov-irbuilder-matrix-cell-uniform",                                                                                            "A fragment shader that covers a specific IR builder path."                                                     },
 {      "cov-liveinterval-different-dest.amber",                                                                                                        "cov-liveinterval-different-dest",                                                                                                      "A fragment shader that covers a specific live interval code path."                                     },
 {      "cov-loop-findmsb-findlsb.amber",                                                                                                                       "cov-loop-findmsb-findlsb",                                                                                                                     "A fragment shader that covers specific simplification and value tracking paths"        },
 {      "cov-mem-pass-unused-component.amber",                                                                                                          "cov-mem-pass-unused-component",                                                                                                        "A fragment shader that covers a specific mem pass code path."                                          },
 {      "cov-merge-return-condition-twice.amber",                                                                                                       "cov-merge-return-condition-twice",                                                                                                     "A fragment shader that covers a specific return merge path."                                           },
 {      "cov-modf-integer-to-private.amber",                                                                                                            "cov-modf-integer-to-private",                                                                                                          "A fragment shader that covers a specific private to local path."                                       },
+{      "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-pattern-match-signum.amber",                                                                                                                       "cov-pattern-match-signum",                                                                                                                     "A fragment shader that covers a specific pattern matching path."                                       },
 {      "cov-pattern-match-single-bit.amber",                                                                                                           "cov-pattern-match-single-bit",                                                                                                         "A fragment shader that covers a specific pattern matching path."                                       },
+{      "cov-peephole-optimizer-target-instr-info-for-if-if-if.amber",                                                          "cov-peephole-optimizer-target-instr-info-for-if-if-if",                                                        "Covers peephole optimizer and instr info code paths"                                                           },
 {      "cov-reduce-load-replace-extract.amber",                                                                                                        "cov-reduce-load-replace-extract",                                                                                                      "A fragment shader that covers a specific load size reduction path."                            },
 {      "cov-replace-copy-object.amber",                                                                                                                        "cov-replace-copy-object",                                                                                                                      "A fragment shader that covers a specific shader simplification path."                          },
 {      "cov-scaled-number-nested-loops.amber",                                                                                                         "cov-scaled-number-nested-loops",                                                                                                       "A fragment shader that covers a specific scaled number code path."                                     },
+{      "cov-selection-dag-assign-back-and-forth.amber",                                                                                        "cov-selection-dag-assign-back-and-forth",                                                                                      "A fragment shader that covers a specific selection DAG code path"                                      },
+{      "cov-selection-dag-lt-gt.amber",                                                                                                                        "cov-selection-dag-lt-gt",                                                                                                                      "A fragment shader that covers a specific selection DAG code path"                                      },
 {      "cov-selection-dag-same-cond-twice.amber",                                                                                                      "cov-selection-dag-same-cond-twice",                                                                                            "A fragment shader that covers a specific selection DAG code path"                                      },
 {      "cov-set-vector-cos-fragcoord.amber",                                                                                                           "cov-set-vector-cos-fragcoord",                                                                                                         "A fragment shader that covers a specific set vector code path."                                        },
 {      "cov-simplification-unused-struct.amber",                                                                                                       "cov-simplification-unused-struct",                                                                                                     "A fragment shader that covers a specific shader simplification path."                          },
 {      "cov-single-store-elim-assume-store.amber",                                                                                                     "cov-single-store-elim-assume-store",                                                                                           "A fragment shader that covers a specific single store elimination path."                       },
 {      "cov-ssa-rewrite-case-with-default.amber",                                                                                                      "cov-ssa-rewrite-case-with-default",                                                                                            "A fragment shader that covers a specific SSA rewrite path."                                            },
 {      "cov-target-lowering-dfdx-cos.amber",                                                                                                           "cov-target-lowering-dfdx-cos",                                                                                                         "A fragment shader that covers a specific target lowering code path."                           },
+{      "cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal.amber",                      "cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal",            "Covers target lowering and compare combining code paths"                                                       },
 {      "cov-types-return-in-main-never-hit.amber",                                                                                                     "cov-types-return-in-main-never-hit",                                                                                           "A fragment shader that covers a specific types optimization path."                                     },
 {      "cov-val-cfg-case-fallthrough.amber",                                                                                                           "cov-val-cfg-case-fallthrough",                                                                                                         "A fragment shader that covers a specific shader validation path."                                      },
+{      "cov-value-inst-combine-select-value-tracking-flip-bits.amber",                                                         "cov-value-inst-combine-select-value-tracking-flip-bits",                                                       "Covers value, inst combine select and value tracking code paths"                                       },
+{      "cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator.amber",                           "cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator",                         "A fragment shader that calculates modulo of constant one with a loop iterator"         },
 {      "cov-value-tracking-const-dfdy.amber",                                                                                                          "cov-value-tracking-const-dfdy",                                                                                                        "A fragment shader that covers a specific value tracking code path"                                     },
+{      "cov-value-tracking-constant-fold-refraction-dfxd-determinant.amber",                                           "cov-value-tracking-constant-fold-refraction-dfxd-determinant",                                         "A fragment shader that calculates refraction with certain values"                                      },
 {      "cov-value-tracking-inclusive-or.amber",                                                                                                        "cov-value-tracking-inclusive-or",                                                                                                      "A fragment shader that covers a specific value tracking path"                                          },
+{      "cov-value-tracking-known-nonzero.amber",                                                                                                       "cov-value-tracking-known-nonzero",                                                                                                     "A fragment shader that covers a specific value tracking path"                                          },
+{      "cov-value-tracking-max-uintbitstofloat.amber",                                                                                         "cov-value-tracking-max-uintbitstofloat",                                                                                       "A fragment shader that covers a specific value tracking path"                                          },
+{      "cov-value-tracking-selection-dag-negation-clamp-loop.amber",                                                           "cov-value-tracking-selection-dag-negation-clamp-loop",                                                         "A fragment shader that calculates negation of clamped loop iterator values"            },
 {      "cov-value-tracking-uniform-incident.amber",                                                                                            "cov-value-tracking-uniform-incident",                                                                                          "A fragment shader that covers a specific value tracking code path"                                     },
 {      "cov-vector-dce-inc-unused-comp.amber",                                                                                                         "cov-vector-dce-inc-unused-comp",                                                                                                       "A fragment shader that covers a specific vector DCE path."                                                     },
 {      "cov-vector-dce-unused-component.amber",                                                                                                        "cov-vector-dce-unused-component",                                                                                                      "A fragment shader that covers a specific vector DCE path."                                                     },
index 06bdfaf..1029c91 100644 (file)
@@ -721815,6 +721815,8 @@ dEQP-VK.graphicsfuzz.cov-apfloat-determinant
 dEQP-VK.graphicsfuzz.cov-apfloat-tanh
 dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
 dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
+dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
+dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
 dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
@@ -721834,6 +721836,9 @@ dEQP-VK.graphicsfuzz.cov-constants-mix-uniform
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-func-argument
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-no-stores
 dEQP-VK.graphicsfuzz.cov-copy-prop-arrays-param-uniform
+dEQP-VK.graphicsfuzz.cov-dag-combiner-combine-casts-legalize-vector-types-xyz-swizzle-for-loop
+dEQP-VK.graphicsfuzz.cov-dag-combiner-findmsb-loop
+dEQP-VK.graphicsfuzz.cov-dag-combiner-increment-color
 dEQP-VK.graphicsfuzz.cov-dag-combiner-neg-div-pow2
 dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
 dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
@@ -721879,7 +721884,20 @@ dEQP-VK.graphicsfuzz.cov-inline-pass-empty-block
 dEQP-VK.graphicsfuzz.cov-inline-pass-nested-loops
 dEQP-VK.graphicsfuzz.cov-inline-pass-return-in-loop
 dEQP-VK.graphicsfuzz.cov-inline-pass-unreachable-func
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-while-modulo
+dEQP-VK.graphicsfuzz.cov-inst-peephole-optimizer-acosh
+dEQP-VK.graphicsfuzz.cov-inst-value-tracking-inversesqrt
+dEQP-VK.graphicsfuzz.cov-instr-emitter-pow-asinh
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-atanh-log-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-bit-shifting
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-inclusive-or
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-inst-combine-calls-for-compare-function-call-result
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-acos-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-mod-sqrt-undefined
+dEQP-VK.graphicsfuzz.cov-instruction-simplify-sqrt
+dEQP-VK.graphicsfuzz.cov-instructions-first-value-phi
 dEQP-VK.graphicsfuzz.cov-intervalmap-set-stop
+dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
 dEQP-VK.graphicsfuzz.cov-irbuilder-matrix-cell-uniform
 dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
 dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
@@ -721889,11 +721907,16 @@ dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
 dEQP-VK.graphicsfuzz.cov-mem-pass-unused-component
 dEQP-VK.graphicsfuzz.cov-merge-return-condition-twice
 dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
+dEQP-VK.graphicsfuzz.cov-optimize-phis-for
+dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
 dEQP-VK.graphicsfuzz.cov-pattern-match-signum
 dEQP-VK.graphicsfuzz.cov-pattern-match-single-bit
+dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
 dEQP-VK.graphicsfuzz.cov-reduce-load-replace-extract
 dEQP-VK.graphicsfuzz.cov-replace-copy-object
 dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops
+dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
+dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
 dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
 dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
@@ -721911,10 +721934,17 @@ dEQP-VK.graphicsfuzz.cov-single-block-elim-self-assign
 dEQP-VK.graphicsfuzz.cov-single-store-elim-assume-store
 dEQP-VK.graphicsfuzz.cov-ssa-rewrite-case-with-default
 dEQP-VK.graphicsfuzz.cov-target-lowering-dfdx-cos
+dEQP-VK.graphicsfuzz.cov-target-lowering-inst-combine-compares-struct-array-clamp-function-cal
 dEQP-VK.graphicsfuzz.cov-types-return-in-main-never-hit
 dEQP-VK.graphicsfuzz.cov-val-cfg-case-fallthrough
+dEQP-VK.graphicsfuzz.cov-value-inst-combine-select-value-tracking-flip-bits
+dEQP-VK.graphicsfuzz.cov-value-tracking-apint-inst-combine-simplify-one-mod-loop-iterator
 dEQP-VK.graphicsfuzz.cov-value-tracking-const-dfdy
+dEQP-VK.graphicsfuzz.cov-value-tracking-constant-fold-refraction-dfxd-determinant
 dEQP-VK.graphicsfuzz.cov-value-tracking-inclusive-or
+dEQP-VK.graphicsfuzz.cov-value-tracking-known-nonzero
+dEQP-VK.graphicsfuzz.cov-value-tracking-max-uintbitstofloat
+dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
 dEQP-VK.graphicsfuzz.cov-value-tracking-uniform-incident
 dEQP-VK.graphicsfuzz.cov-vector-dce-inc-unused-comp
 dEQP-VK.graphicsfuzz.cov-vector-dce-unused-component