Add a batch of GraphicsFuzz coverage tests
authorAntto Mäkinen <antto.makinen@siru.fi>
Fri, 20 Nov 2020 15:48:57 +0000 (17:48 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 3 Dec 2020 08:14:01 +0000 (03:14 -0500)
This commit adds a batch of GraphicsFuzz coverage tests.

Components: Vulkan

New Tests:

dEQP-VK.graphicsfuzz.cov-access-array-dot
dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
dEQP-VK.graphicsfuzz.cov-const-folding-mod-one-one-lte
dEQP-VK.graphicsfuzz.cov-constants-combine-add-sub
dEQP-VK.graphicsfuzz.cov-dag-combiner-glf_color
dEQP-VK.graphicsfuzz.cov-dag-combiner-loop-bitfieldreverse
dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-determinant
dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-increase-negative
dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-neg-func-arg
dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-pack-unpack
dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-switch
dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-xor-add
dEQP-VK.graphicsfuzz.cov-inst-combine-compares-combine-select-uaddcarry
dEQP-VK.graphicsfuzz.cov-inst-combine-compares-isnan
dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ldexp
dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ternary-vector-access
dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-bitfield-bitcount
dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
dEQP-VK.graphicsfuzz.cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops-array-access
dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
dEQP-VK.graphicsfuzz.cov-tail-duplicator-for-for-for
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index

Change-Id: Idde9e994c12f93e9ede51f23fe3a75592d81c528

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-access-array-dot.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-apfloat-negative-step-func.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-apfloat-undefined-matrix-mul.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-const-folding-bitfieldinsert-div-one.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-const-folding-mod-one-one-lte.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-constants-combine-add-sub.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-glf_color.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-add-sub-determinant.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-add-sub-increase-negative.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-add-sub-neg-func-arg.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-and-or-xor-pack-unpack.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-and-or-xor-switch.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-and-or-xor-xor-add.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-combine-select-uaddcarry.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-isnan.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-ldexp.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-ternary-vector-access.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-shifts-bitfield-bitcount.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-shifts-mix-mix-clamp.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instr-info-det-mat-min.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instructions-for-if-less-than-equal.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-machine-scheduler-for-if-pow.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-scaled-number-nested-loops-array-access.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-simplify-for-bitwise-condition.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-simplify-right-shift-greater-than-zero.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-tail-duplicator-for-for-for.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-x86-isel-lowering-machine-value-type-uint-to-float.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-x86-isel-lowering-selection-dag-struct-array-clamp-index.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt
external/vulkancts/mustpass/master/vk-default.txt

index 0e30398..4b74d9d 100644 (file)
@@ -335578,14 +335578,18 @@ dEQP-VK.graphicsfuzz.continue-and-merge
 dEQP-VK.graphicsfuzz.control-flow-in-function
 dEQP-VK.graphicsfuzz.control-flow-switch
 dEQP-VK.graphicsfuzz.cosh-return-inf-unused
+dEQP-VK.graphicsfuzz.cov-access-array-dot
 dEQP-VK.graphicsfuzz.cov-analysis-reachable-from-many
 dEQP-VK.graphicsfuzz.cov-apfloat-acos-ldexp
 dEQP-VK.graphicsfuzz.cov-apfloat-determinant
+dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
 dEQP-VK.graphicsfuzz.cov-apfloat-tanh
+dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
 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-bitfieldinsert-div-one
 dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
@@ -335597,10 +335601,12 @@ dEQP-VK.graphicsfuzz.cov-const-folding-dot-condition-true
 dEQP-VK.graphicsfuzz.cov-const-folding-dot-determinant
 dEQP-VK.graphicsfuzz.cov-const-folding-gte-const-first
 dEQP-VK.graphicsfuzz.cov-const-folding-min-as-loop-range
+dEQP-VK.graphicsfuzz.cov-const-folding-mod-one-one-lte
 dEQP-VK.graphicsfuzz.cov-const-folding-same-condition
 dEQP-VK.graphicsfuzz.cov-const-folding-sinh-inf
 dEQP-VK.graphicsfuzz.cov-const-folding-vector-shuffle
 dEQP-VK.graphicsfuzz.cov-constant-folding-atan-over-tanh
+dEQP-VK.graphicsfuzz.cov-constants-combine-add-sub
 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
@@ -335608,6 +335614,8 @@ 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-glf_color
+dEQP-VK.graphicsfuzz.cov-dag-combiner-loop-bitfieldreverse
 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
@@ -335665,11 +335673,26 @@ 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-inst-combine-add-sub-determinant
+dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-increase-negative
+dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-neg-func-arg
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-switch
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-xor-add
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-combine-select-uaddcarry
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-isnan
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ldexp
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ternary-vector-access
+dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-bitfield-bitcount
+dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
+dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
+dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
 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
+dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
 dEQP-VK.graphicsfuzz.cov-machinevaluetype-one-iter-loop
 dEQP-VK.graphicsfuzz.cov-max-clamp-same-minval
 dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
@@ -335682,10 +335705,12 @@ 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-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
 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-scaled-number-nested-loops-array-access
 dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
 dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
@@ -335693,15 +335718,18 @@ dEQP-VK.graphicsfuzz.cov-simplification-while-inside-for
 dEQP-VK.graphicsfuzz.cov-simplify-clamp-max-itself
 dEQP-VK.graphicsfuzz.cov-simplify-component-uniform-idx
 dEQP-VK.graphicsfuzz.cov-simplify-div-by-uint-one
+dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
 dEQP-VK.graphicsfuzz.cov-simplify-ldexp-exponent-zero
 dEQP-VK.graphicsfuzz.cov-simplify-mul-identity
 dEQP-VK.graphicsfuzz.cov-simplify-not-less-than-neg
+dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
 dEQP-VK.graphicsfuzz.cov-simplify-select-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplify-sign-cosh
 dEQP-VK.graphicsfuzz.cov-simplify-smoothstep-undef
 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-tail-duplicator-for-for-for
 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
@@ -335720,6 +335748,8 @@ dEQP-VK.graphicsfuzz.cov-vector-dce-unused-component
 dEQP-VK.graphicsfuzz.cov-vector-log2-cosh
 dEQP-VK.graphicsfuzz.cov-wrap-op-kill-for-loop
 dEQP-VK.graphicsfuzz.cov-wrap-op-kill-two-branches
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index
 dEQP-VK.graphicsfuzz.create-color-in-do-while-for-loop
 dEQP-VK.graphicsfuzz.dead-barriers-in-loops
 dEQP-VK.graphicsfuzz.dead-struct-init
index 1d6a2dc..684f07a 100644 (file)
@@ -745771,14 +745771,18 @@ dEQP-VK.graphicsfuzz.continue-and-merge
 dEQP-VK.graphicsfuzz.control-flow-in-function
 dEQP-VK.graphicsfuzz.control-flow-switch
 dEQP-VK.graphicsfuzz.cosh-return-inf-unused
+dEQP-VK.graphicsfuzz.cov-access-array-dot
 dEQP-VK.graphicsfuzz.cov-analysis-reachable-from-many
 dEQP-VK.graphicsfuzz.cov-apfloat-acos-ldexp
 dEQP-VK.graphicsfuzz.cov-apfloat-determinant
+dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
 dEQP-VK.graphicsfuzz.cov-apfloat-tanh
+dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
 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-bitfieldinsert-div-one
 dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
@@ -745790,10 +745794,12 @@ dEQP-VK.graphicsfuzz.cov-const-folding-dot-condition-true
 dEQP-VK.graphicsfuzz.cov-const-folding-dot-determinant
 dEQP-VK.graphicsfuzz.cov-const-folding-gte-const-first
 dEQP-VK.graphicsfuzz.cov-const-folding-min-as-loop-range
+dEQP-VK.graphicsfuzz.cov-const-folding-mod-one-one-lte
 dEQP-VK.graphicsfuzz.cov-const-folding-same-condition
 dEQP-VK.graphicsfuzz.cov-const-folding-sinh-inf
 dEQP-VK.graphicsfuzz.cov-const-folding-vector-shuffle
 dEQP-VK.graphicsfuzz.cov-constant-folding-atan-over-tanh
+dEQP-VK.graphicsfuzz.cov-constants-combine-add-sub
 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
@@ -745801,6 +745807,8 @@ 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-glf_color
+dEQP-VK.graphicsfuzz.cov-dag-combiner-loop-bitfieldreverse
 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
@@ -745858,11 +745866,26 @@ 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-inst-combine-add-sub-determinant
+dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-increase-negative
+dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-neg-func-arg
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-switch
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-xor-add
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-combine-select-uaddcarry
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-isnan
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ldexp
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ternary-vector-access
+dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-bitfield-bitcount
+dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
+dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
+dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
 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
+dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
 dEQP-VK.graphicsfuzz.cov-machinevaluetype-one-iter-loop
 dEQP-VK.graphicsfuzz.cov-max-clamp-same-minval
 dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
@@ -745875,10 +745898,12 @@ 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-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
 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-scaled-number-nested-loops-array-access
 dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
 dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
@@ -745886,15 +745911,18 @@ dEQP-VK.graphicsfuzz.cov-simplification-while-inside-for
 dEQP-VK.graphicsfuzz.cov-simplify-clamp-max-itself
 dEQP-VK.graphicsfuzz.cov-simplify-component-uniform-idx
 dEQP-VK.graphicsfuzz.cov-simplify-div-by-uint-one
+dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
 dEQP-VK.graphicsfuzz.cov-simplify-ldexp-exponent-zero
 dEQP-VK.graphicsfuzz.cov-simplify-mul-identity
 dEQP-VK.graphicsfuzz.cov-simplify-not-less-than-neg
+dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
 dEQP-VK.graphicsfuzz.cov-simplify-select-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplify-sign-cosh
 dEQP-VK.graphicsfuzz.cov-simplify-smoothstep-undef
 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-tail-duplicator-for-for-for
 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
@@ -745913,6 +745941,8 @@ dEQP-VK.graphicsfuzz.cov-vector-dce-unused-component
 dEQP-VK.graphicsfuzz.cov-vector-log2-cosh
 dEQP-VK.graphicsfuzz.cov-wrap-op-kill-for-loop
 dEQP-VK.graphicsfuzz.cov-wrap-op-kill-two-branches
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index
 dEQP-VK.graphicsfuzz.create-color-in-do-while-for-loop
 dEQP-VK.graphicsfuzz.dead-barriers-in-loops
 dEQP-VK.graphicsfuzz.dead-struct-init
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-access-array-dot.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-access-array-dot.amber
new file mode 100644 (file)
index 0000000..769350b
--- /dev/null
@@ -0,0 +1,239 @@
+#!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 instruction combine casting, combine shifting and DAG 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 _float_2_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [2.0, 1.0, 0.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[3];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 2]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int numbers[3];
+#     numbers[_int_0] = _int_0;
+#     numbers[_int_1] = _int_1;
+#     numbers[_int_2] = _int_2;
+#
+#     vec2 a = vec2(_int_0, numbers[((0.0 < _float_0_0) ? 1 : 2)]);
+#     float b = dot(a, vec2(_float_1_0, _float_1_0));
+#
+#     if (b == _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: 94
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %75
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "numbers"
+               OpName %13 "buf1"
+               OpMemberName %13 0 "_GLF_uniform_int_values"
+               OpName %15 ""
+               OpName %39 "a"
+               OpName %45 "buf0"
+               OpMemberName %45 0 "_GLF_uniform_float_values"
+               OpName %47 ""
+               OpName %59 "b"
+               OpName %75 "_GLF_color"
+               OpDecorate %12 ArrayStride 16
+               OpMemberDecorate %13 0 Offset 0
+               OpDecorate %13 Block
+               OpDecorate %15 DescriptorSet 0
+               OpDecorate %15 Binding 1
+               OpDecorate %44 ArrayStride 16
+               OpMemberDecorate %45 0 Offset 0
+               OpDecorate %45 Block
+               OpDecorate %47 DescriptorSet 0
+               OpDecorate %47 Binding 0
+               OpDecorate %75 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 3
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypePointer Function %9
+         %12 = OpTypeArray %6 %8
+         %13 = OpTypeStruct %12
+         %14 = OpTypePointer Uniform %13
+         %15 = OpVariable %14 Uniform
+         %16 = OpConstant %6 0
+         %17 = OpTypePointer Uniform %6
+         %22 = OpTypePointer Function %6
+         %24 = OpConstant %6 1
+         %30 = OpConstant %6 2
+         %36 = OpTypeFloat 32
+         %37 = OpTypeVector %36 2
+         %38 = OpTypePointer Function %37
+         %43 = OpConstant %36 0
+         %44 = OpTypeArray %36 %8
+         %45 = OpTypeStruct %44
+         %46 = OpTypePointer Uniform %45
+         %47 = OpVariable %46 Uniform
+         %48 = OpTypePointer Uniform %36
+         %51 = OpTypeBool
+         %58 = OpTypePointer Function %36
+         %73 = OpTypeVector %36 4
+         %74 = OpTypePointer Output %73
+         %75 = OpVariable %74 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %39 = OpVariable %38 Function
+         %59 = OpVariable %58 Function
+         %18 = OpAccessChain %17 %15 %16 %16
+         %19 = OpLoad %6 %18
+         %20 = OpAccessChain %17 %15 %16 %16
+         %21 = OpLoad %6 %20
+         %23 = OpAccessChain %22 %11 %19
+               OpStore %23 %21
+         %25 = OpAccessChain %17 %15 %16 %24
+         %26 = OpLoad %6 %25
+         %27 = OpAccessChain %17 %15 %16 %24
+         %28 = OpLoad %6 %27
+         %29 = OpAccessChain %22 %11 %26
+               OpStore %29 %28
+         %31 = OpAccessChain %17 %15 %16 %30
+         %32 = OpLoad %6 %31
+         %33 = OpAccessChain %17 %15 %16 %30
+         %34 = OpLoad %6 %33
+         %35 = OpAccessChain %22 %11 %32
+               OpStore %35 %34
+         %40 = OpAccessChain %17 %15 %16 %16
+         %41 = OpLoad %6 %40
+         %42 = OpConvertSToF %36 %41
+         %49 = OpAccessChain %48 %47 %16 %30
+         %50 = OpLoad %36 %49
+         %52 = OpFOrdLessThan %51 %43 %50
+         %53 = OpSelect %6 %52 %24 %30
+         %54 = OpAccessChain %22 %11 %53
+         %55 = OpLoad %6 %54
+         %56 = OpConvertSToF %36 %55
+         %57 = OpCompositeConstruct %37 %42 %56
+               OpStore %39 %57
+         %60 = OpLoad %37 %39
+         %61 = OpAccessChain %48 %47 %16 %24
+         %62 = OpLoad %36 %61
+         %63 = OpAccessChain %48 %47 %16 %24
+         %64 = OpLoad %36 %63
+         %65 = OpCompositeConstruct %37 %62 %64
+         %66 = OpDot %36 %60 %65
+               OpStore %59 %66
+         %67 = OpLoad %36 %59
+         %68 = OpAccessChain %48 %47 %16 %16
+         %69 = OpLoad %36 %68
+         %70 = OpFOrdEqual %51 %67 %69
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %71 %89
+         %71 = OpLabel
+         %76 = OpAccessChain %17 %15 %16 %24
+         %77 = OpLoad %6 %76
+         %78 = OpConvertSToF %36 %77
+         %79 = OpAccessChain %17 %15 %16 %16
+         %80 = OpLoad %6 %79
+         %81 = OpConvertSToF %36 %80
+         %82 = OpAccessChain %17 %15 %16 %16
+         %83 = OpLoad %6 %82
+         %84 = OpConvertSToF %36 %83
+         %85 = OpAccessChain %17 %15 %16 %24
+         %86 = OpLoad %6 %85
+         %87 = OpConvertSToF %36 %86
+         %88 = OpCompositeConstruct %73 %78 %81 %84 %87
+               OpStore %75 %88
+               OpBranch %72
+         %89 = OpLabel
+         %90 = OpAccessChain %17 %15 %16 %16
+         %91 = OpLoad %6 %90
+         %92 = OpConvertSToF %36 %91
+         %93 = OpCompositeConstruct %73 %92 %92 %92 %92
+               OpStore %75 %93
+               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
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 2.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 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-apfloat-negative-step-func.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-apfloat-negative-step-func.amber
new file mode 100644 (file)
index 0000000..495b011
--- /dev/null
@@ -0,0 +1,197 @@
+#!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 floating point 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_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: 0.0
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     float edge = determinant(mat3(1));
+#     if (step(edge, vec4(-3.0)) == vec4(_float_0_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: 69
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %43
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "edge"
+               OpName %27 "buf1"
+               OpMemberName %27 0 "_GLF_uniform_float_values"
+               OpName %29 ""
+               OpName %43 "_GLF_color"
+               OpName %46 "buf0"
+               OpMemberName %46 0 "_GLF_uniform_int_values"
+               OpName %48 ""
+               OpDecorate %26 ArrayStride 16
+               OpMemberDecorate %27 0 Offset 0
+               OpDecorate %27 Block
+               OpDecorate %29 DescriptorSet 0
+               OpDecorate %29 Binding 1
+               OpDecorate %43 Location 0
+               OpDecorate %45 ArrayStride 16
+               OpMemberDecorate %46 0 Offset 0
+               OpDecorate %46 Block
+               OpDecorate %48 DescriptorSet 0
+               OpDecorate %48 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeVector %6 3
+         %10 = OpTypeMatrix %9 3
+         %11 = OpConstant %6 1
+         %12 = OpConstant %6 0
+         %13 = OpConstantComposite %9 %11 %12 %12
+         %14 = OpConstantComposite %9 %12 %11 %12
+         %15 = OpConstantComposite %9 %12 %12 %11
+         %16 = OpConstantComposite %10 %13 %14 %15
+         %19 = OpTypeVector %6 4
+         %20 = OpConstant %6 -3
+         %21 = OpConstantComposite %19 %20 %20 %20 %20
+         %24 = OpTypeInt 32 0
+         %25 = OpConstant %24 1
+         %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
+         %36 = OpTypeBool
+         %37 = OpTypeVector %36 4
+         %42 = OpTypePointer Output %19
+         %43 = OpVariable %42 Output
+         %44 = OpConstant %24 2
+         %45 = OpTypeArray %30 %44
+         %46 = OpTypeStruct %45
+         %47 = OpTypePointer Uniform %46
+         %48 = OpVariable %47 Uniform
+         %49 = OpTypePointer Uniform %30
+         %53 = OpConstant %30 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %17 = OpExtInst %6 %1 Determinant %16
+               OpStore %8 %17
+         %18 = OpLoad %6 %8
+         %22 = OpCompositeConstruct %19 %18 %18 %18 %18
+         %23 = OpExtInst %19 %1 Step %22 %21
+         %33 = OpAccessChain %32 %29 %31 %31
+         %34 = OpLoad %6 %33
+         %35 = OpCompositeConstruct %19 %34 %34 %34 %34
+         %38 = OpFOrdEqual %37 %23 %35
+         %39 = OpAll %36 %38
+               OpSelectionMerge %41 None
+               OpBranchConditional %39 %40 %64
+         %40 = OpLabel
+         %50 = OpAccessChain %49 %48 %31 %31
+         %51 = OpLoad %30 %50
+         %52 = OpConvertSToF %6 %51
+         %54 = OpAccessChain %49 %48 %31 %53
+         %55 = OpLoad %30 %54
+         %56 = OpConvertSToF %6 %55
+         %57 = OpAccessChain %49 %48 %31 %53
+         %58 = OpLoad %30 %57
+         %59 = OpConvertSToF %6 %58
+         %60 = OpAccessChain %49 %48 %31 %31
+         %61 = OpLoad %30 %60
+         %62 = OpConvertSToF %6 %61
+         %63 = OpCompositeConstruct %19 %52 %56 %59 %62
+               OpStore %43 %63
+               OpBranch %41
+         %64 = OpLabel
+         %65 = OpAccessChain %49 %48 %31 %53
+         %66 = OpLoad %30 %65
+         %67 = OpConvertSToF %6 %66
+         %68 = OpCompositeConstruct %19 %67 %67 %67 %67
+               OpStore %43 %68
+               OpBranch %41
+         %41 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.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-apfloat-undefined-matrix-mul.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-apfloat-undefined-matrix-mul.amber
new file mode 100644 (file)
index 0000000..90f99bf
--- /dev/null
@@ -0,0 +1,355 @@
+#!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 floating point 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_50 _GLF_uniform_int_values[0]
+# #define _int_10 _GLF_uniform_int_values[1]
+# #define _int_11 _GLF_uniform_int_values[2]
+# #define _int_12 _GLF_uniform_int_values[3]
+# #define _int_1 _GLF_uniform_int_values[4]
+# #define _int_2 _GLF_uniform_int_values[5]
+# #define _int_3 _GLF_uniform_int_values[6]
+# #define _int_6 _GLF_uniform_int_values[7]
+# #define _int_7 _GLF_uniform_int_values[8]
+# #define _int_0 _GLF_uniform_int_values[9]
+# #define _int_5 _GLF_uniform_int_values[10]
+# #define _int_9 _GLF_uniform_int_values[11]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+#
+# // 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: [50, 10, 11, 12, 1, 2, 3, 6, 7, 0, 5, 9]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[12];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     mat3x4 m0 = mat3x4(_int_1, _int_2, _int_3, 4, _int_5, _int_6, _int_7, 8,
+#                        _int_9, _int_10, _int_11, _int_12);
+#     mat3x4 m1 = mat3x4(_int_1);
+#
+#     // Results are too large to fit into a floating point type, thus the results are undefined.
+#     vec3 undefined = ldexp(vec3(1), ivec3(500));
+#     // These still fit into floating point type.
+#     vec3 defined = ldexp(vec3(_int_1), ivec3(_int_50));
+#
+#     // Vectors v0 and v1 are undefined.
+#     vec4 v0 = m0 * undefined;
+#     vec4 v1 = m1 * undefined;
+#
+#     // Vectors v2 and v3 are defined.
+#     vec4 v2 = m0 * defined;
+#     vec4 v3 = m1 * defined;
+#
+#     // Always true.
+#     if (v2.x > v3.x)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_int_0);
+#     }
+#
+#     // The result doesn't matter as the green channel is already zero.
+#     if (v0.x < v1.x)
+#     {
+#         _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: 158
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %121
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %10 "m0"
+               OpName %15 "buf1"
+               OpMemberName %15 0 "_GLF_uniform_int_values"
+               OpName %17 ""
+               OpName %68 "m1"
+               OpName %78 "undefined"
+               OpName %84 "defined"
+               OpName %94 "v0"
+               OpName %98 "v1"
+               OpName %102 "v2"
+               OpName %106 "v3"
+               OpName %121 "_GLF_color"
+               OpName %150 "buf0"
+               OpMemberName %150 0 "_GLF_uniform_float_values"
+               OpName %152 ""
+               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 %26 RelaxedPrecision
+               OpDecorate %30 RelaxedPrecision
+               OpDecorate %35 RelaxedPrecision
+               OpDecorate %39 RelaxedPrecision
+               OpDecorate %43 RelaxedPrecision
+               OpDecorate %48 RelaxedPrecision
+               OpDecorate %52 RelaxedPrecision
+               OpDecorate %56 RelaxedPrecision
+               OpDecorate %60 RelaxedPrecision
+               OpDecorate %70 RelaxedPrecision
+               OpDecorate %86 RelaxedPrecision
+               OpDecorate %90 RelaxedPrecision
+               OpDecorate %121 Location 0
+               OpDecorate %123 RelaxedPrecision
+               OpDecorate %127 RelaxedPrecision
+               OpDecorate %130 RelaxedPrecision
+               OpDecorate %133 RelaxedPrecision
+               OpDecorate %138 RelaxedPrecision
+               OpDecorate %149 ArrayStride 16
+               OpMemberDecorate %150 0 Offset 0
+               OpDecorate %150 Block
+               OpDecorate %152 DescriptorSet 0
+               OpDecorate %152 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypeMatrix %7 3
+          %9 = OpTypePointer Function %8
+         %11 = OpTypeInt 32 1
+         %12 = OpTypeInt 32 0
+         %13 = OpConstant %12 12
+         %14 = OpTypeArray %11 %13
+         %15 = OpTypeStruct %14
+         %16 = OpTypePointer Uniform %15
+         %17 = OpVariable %16 Uniform
+         %18 = OpConstant %11 0
+         %19 = OpConstant %11 4
+         %20 = OpTypePointer Uniform %11
+         %24 = OpConstant %11 5
+         %28 = OpConstant %11 6
+         %32 = OpConstant %6 4
+         %33 = OpConstant %11 10
+         %37 = OpConstant %11 7
+         %41 = OpConstant %11 8
+         %45 = OpConstant %6 8
+         %46 = OpConstant %11 11
+         %50 = OpConstant %11 1
+         %54 = OpConstant %11 2
+         %58 = OpConstant %11 3
+         %62 = OpConstant %6 1
+         %63 = OpConstant %6 0
+         %76 = OpTypeVector %6 3
+         %77 = OpTypePointer Function %76
+         %79 = OpConstantComposite %76 %62 %62 %62
+         %80 = OpTypeVector %11 3
+         %81 = OpConstant %11 500
+         %82 = OpConstantComposite %80 %81 %81 %81
+         %93 = OpTypePointer Function %7
+        %110 = OpConstant %12 0
+        %111 = OpTypePointer Function %6
+        %116 = OpTypeBool
+        %120 = OpTypePointer Output %7
+        %121 = OpVariable %120 Output
+        %125 = OpConstant %11 9
+        %148 = OpConstant %12 1
+        %149 = OpTypeArray %6 %148
+        %150 = OpTypeStruct %149
+        %151 = OpTypePointer Uniform %150
+        %152 = OpVariable %151 Uniform
+        %153 = OpTypePointer Uniform %6
+        %156 = OpTypePointer Output %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %10 = OpVariable %9 Function
+         %68 = OpVariable %9 Function
+         %78 = OpVariable %77 Function
+         %84 = OpVariable %77 Function
+         %94 = OpVariable %93 Function
+         %98 = OpVariable %93 Function
+        %102 = OpVariable %93 Function
+        %106 = OpVariable %93 Function
+         %21 = OpAccessChain %20 %17 %18 %19
+         %22 = OpLoad %11 %21
+         %23 = OpConvertSToF %6 %22
+         %25 = OpAccessChain %20 %17 %18 %24
+         %26 = OpLoad %11 %25
+         %27 = OpConvertSToF %6 %26
+         %29 = OpAccessChain %20 %17 %18 %28
+         %30 = OpLoad %11 %29
+         %31 = OpConvertSToF %6 %30
+         %34 = OpAccessChain %20 %17 %18 %33
+         %35 = OpLoad %11 %34
+         %36 = OpConvertSToF %6 %35
+         %38 = OpAccessChain %20 %17 %18 %37
+         %39 = OpLoad %11 %38
+         %40 = OpConvertSToF %6 %39
+         %42 = OpAccessChain %20 %17 %18 %41
+         %43 = OpLoad %11 %42
+         %44 = OpConvertSToF %6 %43
+         %47 = OpAccessChain %20 %17 %18 %46
+         %48 = OpLoad %11 %47
+         %49 = OpConvertSToF %6 %48
+         %51 = OpAccessChain %20 %17 %18 %50
+         %52 = OpLoad %11 %51
+         %53 = OpConvertSToF %6 %52
+         %55 = OpAccessChain %20 %17 %18 %54
+         %56 = OpLoad %11 %55
+         %57 = OpConvertSToF %6 %56
+         %59 = OpAccessChain %20 %17 %18 %58
+         %60 = OpLoad %11 %59
+         %61 = OpConvertSToF %6 %60
+         %64 = OpCompositeConstruct %7 %23 %27 %31 %32
+         %65 = OpCompositeConstruct %7 %36 %40 %44 %45
+         %66 = OpCompositeConstruct %7 %49 %53 %57 %61
+         %67 = OpCompositeConstruct %8 %64 %65 %66
+               OpStore %10 %67
+         %69 = OpAccessChain %20 %17 %18 %19
+         %70 = OpLoad %11 %69
+         %71 = OpConvertSToF %6 %70
+         %72 = OpCompositeConstruct %7 %71 %63 %63 %63
+         %73 = OpCompositeConstruct %7 %63 %71 %63 %63
+         %74 = OpCompositeConstruct %7 %63 %63 %71 %63
+         %75 = OpCompositeConstruct %8 %72 %73 %74
+               OpStore %68 %75
+         %83 = OpExtInst %76 %1 Ldexp %79 %82
+               OpStore %78 %83
+         %85 = OpAccessChain %20 %17 %18 %19
+         %86 = OpLoad %11 %85
+         %87 = OpConvertSToF %6 %86
+         %88 = OpCompositeConstruct %76 %87 %87 %87
+         %89 = OpAccessChain %20 %17 %18 %18
+         %90 = OpLoad %11 %89
+         %91 = OpCompositeConstruct %80 %90 %90 %90
+         %92 = OpExtInst %76 %1 Ldexp %88 %91
+               OpStore %84 %92
+         %95 = OpLoad %8 %10
+         %96 = OpLoad %76 %78
+         %97 = OpMatrixTimesVector %7 %95 %96
+               OpStore %94 %97
+         %99 = OpLoad %8 %68
+        %100 = OpLoad %76 %78
+        %101 = OpMatrixTimesVector %7 %99 %100
+               OpStore %98 %101
+        %103 = OpLoad %8 %10
+        %104 = OpLoad %76 %84
+        %105 = OpMatrixTimesVector %7 %103 %104
+               OpStore %102 %105
+        %107 = OpLoad %8 %68
+        %108 = OpLoad %76 %84
+        %109 = OpMatrixTimesVector %7 %107 %108
+               OpStore %106 %109
+        %112 = OpAccessChain %111 %102 %110
+        %113 = OpLoad %6 %112
+        %114 = OpAccessChain %111 %106 %110
+        %115 = OpLoad %6 %114
+        %117 = OpFOrdGreaterThan %116 %113 %115
+               OpSelectionMerge %119 None
+               OpBranchConditional %117 %118 %136
+        %118 = OpLabel
+        %122 = OpAccessChain %20 %17 %18 %19
+        %123 = OpLoad %11 %122
+        %124 = OpConvertSToF %6 %123
+        %126 = OpAccessChain %20 %17 %18 %125
+        %127 = OpLoad %11 %126
+        %128 = OpConvertSToF %6 %127
+        %129 = OpAccessChain %20 %17 %18 %125
+        %130 = OpLoad %11 %129
+        %131 = OpConvertSToF %6 %130
+        %132 = OpAccessChain %20 %17 %18 %19
+        %133 = OpLoad %11 %132
+        %134 = OpConvertSToF %6 %133
+        %135 = OpCompositeConstruct %7 %124 %128 %131 %134
+               OpStore %121 %135
+               OpBranch %119
+        %136 = OpLabel
+        %137 = OpAccessChain %20 %17 %18 %125
+        %138 = OpLoad %11 %137
+        %139 = OpConvertSToF %6 %138
+        %140 = OpCompositeConstruct %7 %139 %139 %139 %139
+               OpStore %121 %140
+               OpBranch %119
+        %119 = OpLabel
+        %141 = OpAccessChain %111 %94 %110
+        %142 = OpLoad %6 %141
+        %143 = OpAccessChain %111 %98 %110
+        %144 = OpLoad %6 %143
+        %145 = OpFOrdLessThan %116 %142 %144
+               OpSelectionMerge %147 None
+               OpBranchConditional %145 %146 %147
+        %146 = OpLabel
+        %154 = OpAccessChain %153 %152 %18 %18
+        %155 = OpLoad %6 %154
+        %157 = OpAccessChain %156 %121 %148
+               OpStore %157 %155
+               OpBranch %147
+        %147 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 50 10 11 12 1 2 3 6 7 0 5 9
+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-const-folding-bitfieldinsert-div-one.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-const-folding-bitfieldinsert-div-one.amber
new file mode 100644 (file)
index 0000000..953f6e4
--- /dev/null
@@ -0,0 +1,224 @@
+#!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 const folding 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_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _float_9_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: 9.0
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [10, 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 arr[10];
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         arr[i] = float(i);
+#     }
+#
+#     float f = arr[bitfieldInsert(9, 0, 0, 0) / 1];
+#     if (f == _float_9_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, 1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(0);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 78
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %62
+               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 %34 "arr"
+               OpName %42 "f"
+               OpName %51 "buf0"
+               OpMemberName %51 0 "_GLF_uniform_float_values"
+               OpName %53 ""
+               OpName %62 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %50 ArrayStride 16
+               OpMemberDecorate %51 0 Offset 0
+               OpDecorate %51 Block
+               OpDecorate %53 DescriptorSet 0
+               OpDecorate %53 Binding 0
+               OpDecorate %62 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 = OpTypeFloat 32
+         %31 = OpConstant %9 10
+         %32 = OpTypeArray %30 %31
+         %33 = OpTypePointer Function %32
+         %38 = OpTypePointer Function %30
+         %43 = OpConstant %6 9
+         %49 = OpConstant %9 1
+         %50 = OpTypeArray %30 %49
+         %51 = OpTypeStruct %50
+         %52 = OpTypePointer Uniform %51
+         %53 = OpVariable %52 Uniform
+         %54 = OpTypePointer Uniform %30
+         %60 = OpTypeVector %30 4
+         %61 = OpTypePointer Output %60
+         %62 = OpVariable %61 Output
+         %63 = OpConstant %6 2
+         %73 = OpConstant %30 1
+         %76 = OpConstant %30 0
+         %77 = OpConstantComposite %60 %76 %76 %76 %76
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %34 = OpVariable %33 Function
+         %42 = OpVariable %38 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
+         %35 = OpLoad %6 %8
+         %36 = OpLoad %6 %8
+         %37 = OpConvertSToF %30 %36
+         %39 = OpAccessChain %38 %34 %35
+               OpStore %39 %37
+               OpBranch %23
+         %23 = OpLabel
+         %40 = OpLoad %6 %8
+         %41 = OpIAdd %6 %40 %16
+               OpStore %8 %41
+               OpBranch %20
+         %22 = OpLabel
+         %44 = OpBitFieldInsert %6 %43 %15 %15 %15
+         %45 = OpSDiv %6 %44 %16
+         %46 = OpAccessChain %38 %34 %45
+         %47 = OpLoad %30 %46
+               OpStore %42 %47
+         %48 = OpLoad %30 %42
+         %55 = OpAccessChain %54 %53 %15 %15
+         %56 = OpLoad %30 %55
+         %57 = OpFOrdEqual %28 %48 %56
+               OpSelectionMerge %59 None
+               OpBranchConditional %57 %58 %75
+         %58 = OpLabel
+         %64 = OpAccessChain %17 %14 %15 %63
+         %65 = OpLoad %6 %64
+         %66 = OpConvertSToF %30 %65
+         %67 = OpAccessChain %17 %14 %15 %16
+         %68 = OpLoad %6 %67
+         %69 = OpConvertSToF %30 %68
+         %70 = OpAccessChain %17 %14 %15 %16
+         %71 = OpLoad %6 %70
+         %72 = OpConvertSToF %30 %71
+         %74 = OpCompositeConstruct %60 %66 %69 %72 %73
+               OpStore %62 %74
+               OpBranch %59
+         %75 = OpLabel
+               OpStore %62 %77
+               OpBranch %59
+         %59 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 9.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-const-folding-mod-one-one-lte.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-const-folding-mod-one-one-lte.amber
new file mode 100644 (file)
index 0000000..45a3832
--- /dev/null
@@ -0,0 +1,147 @@
+#!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 const folding 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()
+# {
+#     if (mod(1.0, 1.0) <= 0.01)
+#     {
+#         _GLF_color = vec4(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: 42
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %16
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %16 "_GLF_color"
+               OpName %21 "buf0"
+               OpMemberName %21 0 "_GLF_uniform_int_values"
+               OpName %23 ""
+               OpDecorate %16 Location 0
+               OpDecorate %20 ArrayStride 16
+               OpMemberDecorate %21 0 Offset 0
+               OpDecorate %21 Block
+               OpDecorate %23 DescriptorSet 0
+               OpDecorate %23 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpConstant %6 1
+          %9 = OpConstant %6 0.00999999978
+         %10 = OpTypeBool
+         %14 = OpTypeVector %6 4
+         %15 = OpTypePointer Output %14
+         %16 = OpVariable %15 Output
+         %17 = OpTypeInt 32 1
+         %18 = OpTypeInt 32 0
+         %19 = OpConstant %18 2
+         %20 = OpTypeArray %17 %19
+         %21 = OpTypeStruct %20
+         %22 = OpTypePointer Uniform %21
+         %23 = OpVariable %22 Uniform
+         %24 = OpConstant %17 0
+         %25 = OpTypePointer Uniform %17
+         %32 = OpConstant %17 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpFMod %6 %7 %7
+         %11 = OpFOrdLessThanEqual %10 %8 %9
+               OpSelectionMerge %13 None
+               OpBranchConditional %11 %12 %37
+         %12 = OpLabel
+         %26 = OpAccessChain %25 %23 %24 %24
+         %27 = OpLoad %17 %26
+         %28 = OpConvertSToF %6 %27
+         %29 = OpAccessChain %25 %23 %24 %24
+         %30 = OpLoad %17 %29
+         %31 = OpConvertSToF %6 %30
+         %33 = OpAccessChain %25 %23 %24 %32
+         %34 = OpLoad %17 %33
+         %35 = OpConvertSToF %6 %34
+         %36 = OpCompositeConstruct %14 %7 %28 %31 %35
+               OpStore %16 %36
+               OpBranch %13
+         %37 = OpLabel
+         %38 = OpAccessChain %25 %23 %24 %24
+         %39 = OpLoad %17 %38
+         %40 = OpConvertSToF %6 %39
+         %41 = OpCompositeConstruct %14 %40 %40 %40 %40
+               OpStore %16 %41
+               OpBranch %13
+         %13 = 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-constants-combine-add-sub.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-constants-combine-add-sub.amber
new file mode 100644 (file)
index 0000000..86ff666
--- /dev/null
@@ -0,0 +1,265 @@
+#!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 constants and add/sub combining 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_7 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_5 _GLF_uniform_int_values[3]
+# #define _int_10 _GLF_uniform_int_values[4]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [7, 1, 0, 5, 10]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[5];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# int func(float f)
+# {
+#     int a = _int_1;
+#     int b = _int_0;
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         if (a > _int_5)
+#         {
+#             break;
+#         }
+#
+#         // Simplifies to a = i.
+#         a = int(f) -_int_1 / 2 + i;
+#
+#         b++;
+#     }
+#     if (b == _int_7)
+#     {
+#         return _int_1;
+#     }
+#     else
+#     {
+#         return _int_0;
+#     }
+# }
+#
+# void main()
+# {
+#     if (func(-9.3 + 10.0) == _int_1)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_int_0);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 107
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %88
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "func(f1;"
+               OpName %10 "f"
+               OpName %14 "a"
+               OpName %18 "buf0"
+               OpMemberName %18 0 "_GLF_uniform_int_values"
+               OpName %20 ""
+               OpName %26 "b"
+               OpName %30 "i"
+               OpName %79 "param"
+               OpName %88 "_GLF_color"
+               OpDecorate %17 ArrayStride 16
+               OpMemberDecorate %18 0 Offset 0
+               OpDecorate %18 Block
+               OpDecorate %20 DescriptorSet 0
+               OpDecorate %20 Binding 0
+               OpDecorate %88 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %8 = OpTypeInt 32 1
+          %9 = OpTypeFunction %8 %7
+         %13 = OpTypePointer Function %8
+         %15 = OpTypeInt 32 0
+         %16 = OpConstant %15 5
+         %17 = OpTypeArray %8 %16
+         %18 = OpTypeStruct %17
+         %19 = OpTypePointer Uniform %18
+         %20 = OpVariable %19 Uniform
+         %21 = OpConstant %8 0
+         %22 = OpConstant %8 1
+         %23 = OpTypePointer Uniform %8
+         %27 = OpConstant %8 2
+         %39 = OpConstant %8 4
+         %42 = OpTypeBool
+         %45 = OpConstant %8 3
+         %78 = OpConstant %6 0.699999988
+         %86 = OpTypeVector %6 4
+         %87 = OpTypePointer Output %86
+         %88 = OpVariable %87 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %79 = OpVariable %7 Function
+               OpStore %79 %78
+         %80 = OpFunctionCall %8 %11 %79
+         %81 = OpAccessChain %23 %20 %21 %22
+         %82 = OpLoad %8 %81
+         %83 = OpIEqual %42 %80 %82
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %84 %102
+         %84 = OpLabel
+         %89 = OpAccessChain %23 %20 %21 %22
+         %90 = OpLoad %8 %89
+         %91 = OpConvertSToF %6 %90
+         %92 = OpAccessChain %23 %20 %21 %27
+         %93 = OpLoad %8 %92
+         %94 = OpConvertSToF %6 %93
+         %95 = OpAccessChain %23 %20 %21 %27
+         %96 = OpLoad %8 %95
+         %97 = OpConvertSToF %6 %96
+         %98 = OpAccessChain %23 %20 %21 %22
+         %99 = OpLoad %8 %98
+        %100 = OpConvertSToF %6 %99
+        %101 = OpCompositeConstruct %86 %91 %94 %97 %100
+               OpStore %88 %101
+               OpBranch %85
+        %102 = OpLabel
+        %103 = OpAccessChain %23 %20 %21 %27
+        %104 = OpLoad %8 %103
+        %105 = OpConvertSToF %6 %104
+        %106 = OpCompositeConstruct %86 %105 %105 %105 %105
+               OpStore %88 %106
+               OpBranch %85
+         %85 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %11 = OpFunction %8 None %9
+         %10 = OpFunctionParameter %7
+         %12 = OpLabel
+         %14 = OpVariable %13 Function
+         %26 = OpVariable %13 Function
+         %30 = OpVariable %13 Function
+         %24 = OpAccessChain %23 %20 %21 %22
+         %25 = OpLoad %8 %24
+               OpStore %14 %25
+         %28 = OpAccessChain %23 %20 %21 %27
+         %29 = OpLoad %8 %28
+               OpStore %26 %29
+         %31 = OpAccessChain %23 %20 %21 %27
+         %32 = OpLoad %8 %31
+               OpStore %30 %32
+               OpBranch %33
+         %33 = OpLabel
+               OpLoopMerge %35 %36 None
+               OpBranch %37
+         %37 = OpLabel
+         %38 = OpLoad %8 %30
+         %40 = OpAccessChain %23 %20 %21 %39
+         %41 = OpLoad %8 %40
+         %43 = OpSLessThan %42 %38 %41
+               OpBranchConditional %43 %34 %35
+         %34 = OpLabel
+         %44 = OpLoad %8 %14
+         %46 = OpAccessChain %23 %20 %21 %45
+         %47 = OpLoad %8 %46
+         %48 = OpSGreaterThan %42 %44 %47
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %50
+         %49 = OpLabel
+               OpBranch %35
+         %50 = OpLabel
+         %52 = OpLoad %6 %10
+         %53 = OpConvertFToS %8 %52
+         %54 = OpAccessChain %23 %20 %21 %22
+         %55 = OpLoad %8 %54
+         %56 = OpSDiv %8 %55 %27
+         %57 = OpISub %8 %53 %56
+         %58 = OpLoad %8 %30
+         %59 = OpIAdd %8 %57 %58
+               OpStore %14 %59
+         %60 = OpLoad %8 %26
+         %61 = OpIAdd %8 %60 %22
+               OpStore %26 %61
+               OpBranch %36
+         %36 = OpLabel
+         %62 = OpLoad %8 %30
+         %63 = OpIAdd %8 %62 %22
+               OpStore %30 %63
+               OpBranch %33
+         %35 = OpLabel
+         %64 = OpLoad %8 %26
+         %65 = OpAccessChain %23 %20 %21 %21
+         %66 = OpLoad %8 %65
+         %67 = OpIEqual %42 %64 %66
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %68 %73
+         %68 = OpLabel
+         %70 = OpAccessChain %23 %20 %21 %22
+         %71 = OpLoad %8 %70
+               OpReturnValue %71
+         %73 = OpLabel
+         %74 = OpAccessChain %23 %20 %21 %27
+         %75 = OpLoad %8 %74
+               OpReturnValue %75
+         %69 = OpLabel
+               OpUnreachable
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 7 1 0 5 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_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-glf_color.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-glf_color.amber
new file mode 100644 (file)
index 0000000..948a58d
--- /dev/null
@@ -0,0 +1,277 @@
+#!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 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_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_4 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+# #define _float_3_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: [1.0, 0.4, 2.0, 3.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# float func(float b)
+# {
+#     _GLF_color = vec4(_float_1_0, _float_1_0, _float_0_4, 1.0);
+#     _GLF_color = _GLF_color;
+#     if (_float_1_0 >= b)
+#     {
+#         return _float_1_0;
+#     }
+#     return _float_2_0;
+# }
+#
+# void main()
+# {
+#     // func returns 1.0.
+#     float a = func(_float_1_0);
+#
+#     // func returns 2.0.
+#     a += func(_float_1_0 + _float_1_0);
+#
+#     if (a == _float_3_0 &&
+#         _GLF_color == vec4(_float_1_0, _float_1_0, _float_0_4, _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: 110
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %14
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %10 "func(f1;"
+               OpName %9 "b"
+               OpName %14 "_GLF_color"
+               OpName %18 "buf1"
+               OpMemberName %18 0 "_GLF_uniform_float_values"
+               OpName %20 ""
+               OpName %49 "a"
+               OpName %50 "param"
+               OpName %59 "param"
+               OpName %88 "buf0"
+               OpMemberName %88 0 "_GLF_uniform_int_values"
+               OpName %90 ""
+               OpDecorate %14 Location 0
+               OpDecorate %17 ArrayStride 16
+               OpMemberDecorate %18 0 Offset 0
+               OpDecorate %18 Block
+               OpDecorate %20 DescriptorSet 0
+               OpDecorate %20 Binding 1
+               OpDecorate %87 ArrayStride 16
+               OpMemberDecorate %88 0 RelaxedPrecision
+               OpMemberDecorate %88 0 Offset 0
+               OpDecorate %88 Block
+               OpDecorate %90 DescriptorSet 0
+               OpDecorate %90 Binding 0
+               OpDecorate %93 RelaxedPrecision
+               OpDecorate %96 RelaxedPrecision
+               OpDecorate %99 RelaxedPrecision
+               OpDecorate %102 RelaxedPrecision
+               OpDecorate %107 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %8 = OpTypeFunction %6 %7
+         %12 = OpTypeVector %6 4
+         %13 = OpTypePointer Output %12
+         %14 = OpVariable %13 Output
+         %15 = OpTypeInt 32 0
+         %16 = OpConstant %15 4
+         %17 = OpTypeArray %6 %16
+         %18 = OpTypeStruct %17
+         %19 = OpTypePointer Uniform %18
+         %20 = OpVariable %19 Uniform
+         %21 = OpTypeInt 32 1
+         %22 = OpConstant %21 0
+         %23 = OpTypePointer Uniform %6
+         %28 = OpConstant %21 1
+         %31 = OpConstant %6 1
+         %37 = OpTypeBool
+         %44 = OpConstant %21 2
+         %64 = OpConstant %21 3
+         %80 = OpTypeVector %37 4
+         %86 = OpConstant %15 2
+         %87 = OpTypeArray %21 %86
+         %88 = OpTypeStruct %87
+         %89 = OpTypePointer Uniform %88
+         %90 = OpVariable %89 Uniform
+         %91 = OpTypePointer Uniform %21
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %49 = OpVariable %7 Function
+         %50 = OpVariable %7 Function
+         %59 = OpVariable %7 Function
+         %51 = OpAccessChain %23 %20 %22 %22
+         %52 = OpLoad %6 %51
+               OpStore %50 %52
+         %53 = OpFunctionCall %6 %10 %50
+               OpStore %49 %53
+         %54 = OpAccessChain %23 %20 %22 %22
+         %55 = OpLoad %6 %54
+         %56 = OpAccessChain %23 %20 %22 %22
+         %57 = OpLoad %6 %56
+         %58 = OpFAdd %6 %55 %57
+               OpStore %59 %58
+         %60 = OpFunctionCall %6 %10 %59
+         %61 = OpLoad %6 %49
+         %62 = OpFAdd %6 %61 %60
+               OpStore %49 %62
+         %63 = OpLoad %6 %49
+         %65 = OpAccessChain %23 %20 %22 %64
+         %66 = OpLoad %6 %65
+         %67 = OpFOrdEqual %37 %63 %66
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %68 %69
+         %68 = OpLabel
+         %70 = OpLoad %12 %14
+         %71 = OpAccessChain %23 %20 %22 %22
+         %72 = OpLoad %6 %71
+         %73 = OpAccessChain %23 %20 %22 %22
+         %74 = OpLoad %6 %73
+         %75 = OpAccessChain %23 %20 %22 %28
+         %76 = OpLoad %6 %75
+         %77 = OpAccessChain %23 %20 %22 %22
+         %78 = OpLoad %6 %77
+         %79 = OpCompositeConstruct %12 %72 %74 %76 %78
+         %81 = OpFOrdEqual %80 %70 %79
+         %82 = OpAll %37 %81
+               OpBranch %69
+         %69 = OpLabel
+         %83 = OpPhi %37 %67 %5 %82 %68
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %84 %105
+         %84 = OpLabel
+         %92 = OpAccessChain %91 %90 %22 %22
+         %93 = OpLoad %21 %92
+         %94 = OpConvertSToF %6 %93
+         %95 = OpAccessChain %91 %90 %22 %28
+         %96 = OpLoad %21 %95
+         %97 = OpConvertSToF %6 %96
+         %98 = OpAccessChain %91 %90 %22 %28
+         %99 = OpLoad %21 %98
+        %100 = OpConvertSToF %6 %99
+        %101 = OpAccessChain %91 %90 %22 %22
+        %102 = OpLoad %21 %101
+        %103 = OpConvertSToF %6 %102
+        %104 = OpCompositeConstruct %12 %94 %97 %100 %103
+               OpStore %14 %104
+               OpBranch %85
+        %105 = OpLabel
+        %106 = OpAccessChain %91 %90 %22 %28
+        %107 = OpLoad %21 %106
+        %108 = OpConvertSToF %6 %107
+        %109 = OpCompositeConstruct %12 %108 %108 %108 %108
+               OpStore %14 %109
+               OpBranch %85
+         %85 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %10 = OpFunction %6 None %8
+          %9 = OpFunctionParameter %7
+         %11 = OpLabel
+         %24 = OpAccessChain %23 %20 %22 %22
+         %25 = OpLoad %6 %24
+         %26 = OpAccessChain %23 %20 %22 %22
+         %27 = OpLoad %6 %26
+         %29 = OpAccessChain %23 %20 %22 %28
+         %30 = OpLoad %6 %29
+         %32 = OpCompositeConstruct %12 %25 %27 %30 %31
+               OpStore %14 %32
+         %33 = OpLoad %12 %14
+               OpStore %14 %33
+         %34 = OpAccessChain %23 %20 %22 %22
+         %35 = OpLoad %6 %34
+         %36 = OpLoad %6 %9
+         %38 = OpFOrdGreaterThanEqual %37 %35 %36
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %39 %40
+         %39 = OpLabel
+         %41 = OpAccessChain %23 %20 %22 %22
+         %42 = OpLoad %6 %41
+               OpReturnValue %42
+         %40 = OpLabel
+         %45 = OpAccessChain %23 %20 %22 %44
+         %46 = OpLoad %6 %45
+               OpReturnValue %46
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.4 2.0 3.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-dag-combiner-loop-bitfieldreverse.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse.amber
new file mode 100644 (file)
index 0000000..92c3bc3
--- /dev/null
@@ -0,0 +1,192 @@
+#!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_0 _GLF_uniform_int_values[1]
+# #define _int_1 _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, 0, 1, 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 = _int_0;
+#     for (int i = -_int_2; bitfieldReverse(++i) <= _int_1;)
+#     {
+#         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: 68
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %49
+               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 %49 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %49 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 1
+         %17 = OpTypePointer Uniform %6
+         %21 = OpConstant %6 3
+         %33 = OpConstant %6 2
+         %36 = OpTypeBool
+         %46 = OpTypeFloat 32
+         %47 = OpTypeVector %46 4
+         %48 = OpTypePointer Output %47
+         %49 = OpVariable %48 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
+         %24 = OpSNegate %6 %23
+               OpStore %20 %24
+               OpBranch %25
+         %25 = OpLabel
+               OpLoopMerge %27 %28 None
+               OpBranch %29
+         %29 = OpLabel
+         %30 = OpLoad %6 %20
+         %31 = OpIAdd %6 %30 %16
+               OpStore %20 %31
+         %32 = OpBitReverse %6 %31
+         %34 = OpAccessChain %17 %14 %15 %33
+         %35 = OpLoad %6 %34
+         %37 = OpSLessThanEqual %36 %32 %35
+               OpBranchConditional %37 %26 %27
+         %26 = OpLabel
+         %38 = OpLoad %6 %8
+         %39 = OpIAdd %6 %38 %16
+               OpStore %8 %39
+               OpBranch %28
+         %28 = OpLabel
+               OpBranch %25
+         %27 = OpLabel
+         %40 = OpLoad %6 %8
+         %41 = OpAccessChain %17 %14 %15 %15
+         %42 = OpLoad %6 %41
+         %43 = OpIEqual %36 %40 %42
+               OpSelectionMerge %45 None
+               OpBranchConditional %43 %44 %63
+         %44 = OpLabel
+         %50 = OpAccessChain %17 %14 %15 %33
+         %51 = OpLoad %6 %50
+         %52 = OpConvertSToF %46 %51
+         %53 = OpAccessChain %17 %14 %15 %16
+         %54 = OpLoad %6 %53
+         %55 = OpConvertSToF %46 %54
+         %56 = OpAccessChain %17 %14 %15 %16
+         %57 = OpLoad %6 %56
+         %58 = OpConvertSToF %46 %57
+         %59 = OpAccessChain %17 %14 %15 %33
+         %60 = OpLoad %6 %59
+         %61 = OpConvertSToF %46 %60
+         %62 = OpCompositeConstruct %47 %52 %55 %58 %61
+               OpStore %49 %62
+               OpBranch %45
+         %63 = OpLabel
+         %64 = OpAccessChain %17 %14 %15 %16
+         %65 = OpLoad %6 %64
+         %66 = OpConvertSToF %46 %65
+         %67 = OpCompositeConstruct %47 %66 %66 %66 %66
+               OpStore %49 %67
+               OpBranch %45
+         %45 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 0 1 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-inst-combine-add-sub-determinant.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-add-sub-determinant.amber
new file mode 100644 (file)
index 0000000..1933978
--- /dev/null
@@ -0,0 +1,230 @@
+#!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 add sub 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_1_0 _GLF_uniform_float_values[0]
+# #define _float_4_0 _GLF_uniform_float_values[1]
+# #define _float_3_0 _GLF_uniform_float_values[2]
+# #define _float_2_0 _GLF_uniform_float_values[3]
+# #define _float_0_0 _GLF_uniform_float_values[4]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 4.0, 3.0, 2.0, 0.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[5];
+# };
+#
+# // 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()
+# {
+#     // mix() selects 2.0.
+#     float a = mix(-_float_1_0, 2.0, _float_0_0 < _float_1_0);
+#     mat2 m = mat2(1.0, a, 3.0, 4.0);
+#     float ref = _float_1_0 * _float_4_0 - (_float_2_0)*_float_3_0;
+#
+#     if (determinant(m) == ref)
+#     {
+#         _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: 90
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %65
+               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 %33 "m"
+               OpName %42 "ref"
+               OpName %65 "_GLF_color"
+               OpName %68 "buf1"
+               OpMemberName %68 0 "_GLF_uniform_int_values"
+               OpName %70 ""
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %65 Location 0
+               OpDecorate %67 ArrayStride 16
+               OpMemberDecorate %68 0 Offset 0
+               OpDecorate %68 Block
+               OpDecorate %70 DescriptorSet 0
+               OpDecorate %70 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 5
+         %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 %6 2
+         %22 = OpConstant %15 4
+         %27 = OpTypeBool
+         %30 = OpTypeVector %6 2
+         %31 = OpTypeMatrix %30 2
+         %32 = OpTypePointer Function %31
+         %34 = OpConstant %6 1
+         %36 = OpConstant %6 3
+         %37 = OpConstant %6 4
+         %38 = OpConstant %6 0
+         %45 = OpConstant %15 1
+         %49 = OpConstant %15 3
+         %52 = OpConstant %15 2
+         %63 = OpTypeVector %6 4
+         %64 = OpTypePointer Output %63
+         %65 = OpVariable %64 Output
+         %66 = OpConstant %9 2
+         %67 = OpTypeArray %15 %66
+         %68 = OpTypeStruct %67
+         %69 = OpTypePointer Uniform %68
+         %70 = OpVariable %69 Uniform
+         %71 = OpTypePointer Uniform %15
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %33 = OpVariable %32 Function
+         %42 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %14 %16 %16
+         %19 = OpLoad %6 %18
+         %20 = OpFNegate %6 %19
+         %23 = OpAccessChain %17 %14 %16 %22
+         %24 = OpLoad %6 %23
+         %25 = OpAccessChain %17 %14 %16 %16
+         %26 = OpLoad %6 %25
+         %28 = OpFOrdLessThan %27 %24 %26
+         %29 = OpSelect %6 %28 %21 %20
+               OpStore %8 %29
+         %35 = OpLoad %6 %8
+         %39 = OpCompositeConstruct %30 %34 %35
+         %40 = OpCompositeConstruct %30 %36 %37
+         %41 = OpCompositeConstruct %31 %39 %40
+               OpStore %33 %41
+         %43 = OpAccessChain %17 %14 %16 %16
+         %44 = OpLoad %6 %43
+         %46 = OpAccessChain %17 %14 %16 %45
+         %47 = OpLoad %6 %46
+         %48 = OpFMul %6 %44 %47
+         %50 = OpAccessChain %17 %14 %16 %49
+         %51 = OpLoad %6 %50
+         %53 = OpAccessChain %17 %14 %16 %52
+         %54 = OpLoad %6 %53
+         %55 = OpFMul %6 %51 %54
+         %56 = OpFSub %6 %48 %55
+               OpStore %42 %56
+         %57 = OpLoad %31 %33
+         %58 = OpExtInst %6 %1 Determinant %57
+         %59 = OpLoad %6 %42
+         %60 = OpFOrdEqual %27 %58 %59
+               OpSelectionMerge %62 None
+               OpBranchConditional %60 %61 %85
+         %61 = OpLabel
+         %72 = OpAccessChain %71 %70 %16 %16
+         %73 = OpLoad %15 %72
+         %74 = OpConvertSToF %6 %73
+         %75 = OpAccessChain %71 %70 %16 %45
+         %76 = OpLoad %15 %75
+         %77 = OpConvertSToF %6 %76
+         %78 = OpAccessChain %71 %70 %16 %45
+         %79 = OpLoad %15 %78
+         %80 = OpConvertSToF %6 %79
+         %81 = OpAccessChain %71 %70 %16 %16
+         %82 = OpLoad %15 %81
+         %83 = OpConvertSToF %6 %82
+         %84 = OpCompositeConstruct %63 %74 %77 %80 %83
+               OpStore %65 %84
+               OpBranch %62
+         %85 = OpLabel
+         %86 = OpAccessChain %71 %70 %16 %45
+         %87 = OpLoad %15 %86
+         %88 = OpConvertSToF %6 %87
+         %89 = OpCompositeConstruct %63 %88 %88 %88 %88
+               OpStore %65 %89
+               OpBranch %62
+         %62 = 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 4.0 3.0 2.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-inst-combine-add-sub-increase-negative.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-add-sub-increase-negative.amber
new file mode 100644 (file)
index 0000000..f768d47
--- /dev/null
@@ -0,0 +1,264 @@
+#!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 add sub 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_2 _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: [0, 1, 2]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int arr[2];
+#     for (int i = _int_0; i < _int_2; i++)
+#     {
+#         arr[i] = _int_0;
+#     }
+#
+#     int a = -1;
+#
+#     // Always true.
+#     if (!(gl_FragCoord.y < _float_0_0))
+#     {
+#         arr[++a] = _int_1;
+#     }
+#
+#     arr[++a] = _int_2;
+#
+#     // Checks arr[0] == 1. Always true.
+#     if (arr[_int_0] == _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: 99
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %46 %82
+               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 %33 "arr"
+               OpName %41 "a"
+               OpName %46 "gl_FragCoord"
+               OpName %52 "buf0"
+               OpMemberName %52 0 "_GLF_uniform_float_values"
+               OpName %54 ""
+               OpName %82 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %46 BuiltIn FragCoord
+               OpDecorate %51 ArrayStride 16
+               OpMemberDecorate %52 0 Offset 0
+               OpDecorate %52 Block
+               OpDecorate %54 DescriptorSet 0
+               OpDecorate %54 Binding 0
+               OpDecorate %82 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 3
+         %11 = OpTypeArray %6 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpConstant %6 0
+         %16 = OpTypePointer Uniform %6
+         %25 = OpConstant %6 2
+         %28 = OpTypeBool
+         %30 = OpConstant %9 2
+         %31 = OpTypeArray %6 %30
+         %32 = OpTypePointer Function %31
+         %39 = OpConstant %6 1
+         %42 = OpConstant %6 -1
+         %43 = OpTypeFloat 32
+         %44 = OpTypeVector %43 4
+         %45 = OpTypePointer Input %44
+         %46 = OpVariable %45 Input
+         %47 = OpConstant %9 1
+         %48 = OpTypePointer Input %43
+         %51 = OpTypeArray %43 %47
+         %52 = OpTypeStruct %51
+         %53 = OpTypePointer Uniform %52
+         %54 = OpVariable %53 Uniform
+         %55 = OpTypePointer Uniform %43
+         %81 = OpTypePointer Output %44
+         %82 = OpVariable %81 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %33 = OpVariable %32 Function
+         %41 = OpVariable %7 Function
+         %17 = OpAccessChain %16 %14 %15 %15
+         %18 = OpLoad %6 %17
+               OpStore %8 %18
+               OpBranch %19
+         %19 = OpLabel
+               OpLoopMerge %21 %22 None
+               OpBranch %23
+         %23 = OpLabel
+         %24 = OpLoad %6 %8
+         %26 = OpAccessChain %16 %14 %15 %25
+         %27 = OpLoad %6 %26
+         %29 = OpSLessThan %28 %24 %27
+               OpBranchConditional %29 %20 %21
+         %20 = OpLabel
+         %34 = OpLoad %6 %8
+         %35 = OpAccessChain %16 %14 %15 %15
+         %36 = OpLoad %6 %35
+         %37 = OpAccessChain %7 %33 %34
+               OpStore %37 %36
+               OpBranch %22
+         %22 = OpLabel
+         %38 = OpLoad %6 %8
+         %40 = OpIAdd %6 %38 %39
+               OpStore %8 %40
+               OpBranch %19
+         %21 = OpLabel
+               OpStore %41 %42
+         %49 = OpAccessChain %48 %46 %47
+         %50 = OpLoad %43 %49
+         %56 = OpAccessChain %55 %54 %15 %15
+         %57 = OpLoad %43 %56
+         %58 = OpFOrdLessThan %28 %50 %57
+         %59 = OpLogicalNot %28 %58
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %60 %61
+         %60 = OpLabel
+         %62 = OpLoad %6 %41
+         %63 = OpIAdd %6 %62 %39
+               OpStore %41 %63
+         %64 = OpAccessChain %16 %14 %15 %39
+         %65 = OpLoad %6 %64
+         %66 = OpAccessChain %7 %33 %63
+               OpStore %66 %65
+               OpBranch %61
+         %61 = OpLabel
+         %67 = OpLoad %6 %41
+         %68 = OpIAdd %6 %67 %39
+               OpStore %41 %68
+         %69 = OpAccessChain %16 %14 %15 %25
+         %70 = OpLoad %6 %69
+         %71 = OpAccessChain %7 %33 %68
+               OpStore %71 %70
+         %72 = OpAccessChain %16 %14 %15 %15
+         %73 = OpLoad %6 %72
+         %74 = OpAccessChain %7 %33 %73
+         %75 = OpLoad %6 %74
+         %76 = OpAccessChain %16 %14 %15 %39
+         %77 = OpLoad %6 %76
+         %78 = OpIEqual %28 %75 %77
+               OpSelectionMerge %80 None
+               OpBranchConditional %78 %79 %94
+         %79 = OpLabel
+         %83 = OpLoad %6 %41
+         %84 = OpConvertSToF %43 %83
+         %85 = OpAccessChain %16 %14 %15 %15
+         %86 = OpLoad %6 %85
+         %87 = OpConvertSToF %43 %86
+         %88 = OpAccessChain %16 %14 %15 %15
+         %89 = OpLoad %6 %88
+         %90 = OpConvertSToF %43 %89
+         %91 = OpLoad %6 %41
+         %92 = OpConvertSToF %43 %91
+         %93 = OpCompositeConstruct %44 %84 %87 %90 %92
+               OpStore %82 %93
+               OpBranch %80
+         %94 = OpLabel
+         %95 = OpAccessChain %16 %14 %15 %15
+         %96 = OpLoad %6 %95
+         %97 = OpConvertSToF %43 %96
+         %98 = OpCompositeConstruct %44 %97 %97 %97 %97
+               OpStore %82 %98
+               OpBranch %80
+         %80 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 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_float_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+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-add-sub-neg-func-arg.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-add-sub-neg-func-arg.amber
new file mode 100644 (file)
index 0000000..fbe2f0c
--- /dev/null
@@ -0,0 +1,266 @@
+#!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 add/sub combining 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_9 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_5 _GLF_uniform_int_values[3]
+# #define _int_10 _GLF_uniform_int_values[4]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [9, 1, 0, 5, 10]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[5];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# int func(float f)
+# {
+#     int a = _int_1;
+#     int b = _int_0;
+#
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         if (a > _int_5)
+#         {
+#             break;
+#         }
+#
+#         // Simplifies to a = i - 2.
+#         a = int(f) - 1 - _int_1 + i;
+#
+#         b++;
+#     }
+#
+#     if (b == _int_9)
+#     {
+#         return _int_1;
+#     }
+#     else
+#     {
+#         return _int_0;
+#     }
+# }
+# void main()
+# {
+#     if (func(-9.3 + 10.0) == _int_1)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_int_0);
+#     }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 107
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %88
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "func(f1;"
+               OpName %10 "f"
+               OpName %14 "a"
+               OpName %18 "buf0"
+               OpMemberName %18 0 "_GLF_uniform_int_values"
+               OpName %20 ""
+               OpName %26 "b"
+               OpName %30 "i"
+               OpName %79 "param"
+               OpName %88 "_GLF_color"
+               OpDecorate %17 ArrayStride 16
+               OpMemberDecorate %18 0 Offset 0
+               OpDecorate %18 Block
+               OpDecorate %20 DescriptorSet 0
+               OpDecorate %20 Binding 0
+               OpDecorate %88 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypePointer Function %6
+          %8 = OpTypeInt 32 1
+          %9 = OpTypeFunction %8 %7
+         %13 = OpTypePointer Function %8
+         %15 = OpTypeInt 32 0
+         %16 = OpConstant %15 5
+         %17 = OpTypeArray %8 %16
+         %18 = OpTypeStruct %17
+         %19 = OpTypePointer Uniform %18
+         %20 = OpVariable %19 Uniform
+         %21 = OpConstant %8 0
+         %22 = OpConstant %8 1
+         %23 = OpTypePointer Uniform %8
+         %27 = OpConstant %8 2
+         %39 = OpConstant %8 4
+         %42 = OpTypeBool
+         %45 = OpConstant %8 3
+         %78 = OpConstant %6 0.699999988
+         %86 = OpTypeVector %6 4
+         %87 = OpTypePointer Output %86
+         %88 = OpVariable %87 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %79 = OpVariable %7 Function
+               OpStore %79 %78
+         %80 = OpFunctionCall %8 %11 %79
+         %81 = OpAccessChain %23 %20 %21 %22
+         %82 = OpLoad %8 %81
+         %83 = OpIEqual %42 %80 %82
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %84 %102
+         %84 = OpLabel
+         %89 = OpAccessChain %23 %20 %21 %22
+         %90 = OpLoad %8 %89
+         %91 = OpConvertSToF %6 %90
+         %92 = OpAccessChain %23 %20 %21 %27
+         %93 = OpLoad %8 %92
+         %94 = OpConvertSToF %6 %93
+         %95 = OpAccessChain %23 %20 %21 %27
+         %96 = OpLoad %8 %95
+         %97 = OpConvertSToF %6 %96
+         %98 = OpAccessChain %23 %20 %21 %22
+         %99 = OpLoad %8 %98
+        %100 = OpConvertSToF %6 %99
+        %101 = OpCompositeConstruct %86 %91 %94 %97 %100
+               OpStore %88 %101
+               OpBranch %85
+        %102 = OpLabel
+        %103 = OpAccessChain %23 %20 %21 %27
+        %104 = OpLoad %8 %103
+        %105 = OpConvertSToF %6 %104
+        %106 = OpCompositeConstruct %86 %105 %105 %105 %105
+               OpStore %88 %106
+               OpBranch %85
+         %85 = OpLabel
+               OpReturn
+               OpFunctionEnd
+         %11 = OpFunction %8 None %9
+         %10 = OpFunctionParameter %7
+         %12 = OpLabel
+         %14 = OpVariable %13 Function
+         %26 = OpVariable %13 Function
+         %30 = OpVariable %13 Function
+         %24 = OpAccessChain %23 %20 %21 %22
+         %25 = OpLoad %8 %24
+               OpStore %14 %25
+         %28 = OpAccessChain %23 %20 %21 %27
+         %29 = OpLoad %8 %28
+               OpStore %26 %29
+         %31 = OpAccessChain %23 %20 %21 %27
+         %32 = OpLoad %8 %31
+               OpStore %30 %32
+               OpBranch %33
+         %33 = OpLabel
+               OpLoopMerge %35 %36 None
+               OpBranch %37
+         %37 = OpLabel
+         %38 = OpLoad %8 %30
+         %40 = OpAccessChain %23 %20 %21 %39
+         %41 = OpLoad %8 %40
+         %43 = OpSLessThan %42 %38 %41
+               OpBranchConditional %43 %34 %35
+         %34 = OpLabel
+         %44 = OpLoad %8 %14
+         %46 = OpAccessChain %23 %20 %21 %45
+         %47 = OpLoad %8 %46
+         %48 = OpSGreaterThan %42 %44 %47
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %50
+         %49 = OpLabel
+               OpBranch %35
+         %50 = OpLabel
+         %52 = OpLoad %6 %10
+         %53 = OpConvertFToS %8 %52
+         %54 = OpISub %8 %53 %22
+         %55 = OpAccessChain %23 %20 %21 %22
+         %56 = OpLoad %8 %55
+         %57 = OpISub %8 %54 %56
+         %58 = OpLoad %8 %30
+         %59 = OpIAdd %8 %57 %58
+               OpStore %14 %59
+         %60 = OpLoad %8 %26
+         %61 = OpIAdd %8 %60 %22
+               OpStore %26 %61
+               OpBranch %36
+         %36 = OpLabel
+         %62 = OpLoad %8 %30
+         %63 = OpIAdd %8 %62 %22
+               OpStore %30 %63
+               OpBranch %33
+         %35 = OpLabel
+         %64 = OpLoad %8 %26
+         %65 = OpAccessChain %23 %20 %21 %21
+         %66 = OpLoad %8 %65
+         %67 = OpIEqual %42 %64 %66
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %68 %73
+         %68 = OpLabel
+         %70 = OpAccessChain %23 %20 %21 %22
+         %71 = OpLoad %8 %70
+               OpReturnValue %71
+         %73 = OpLabel
+         %74 = OpAccessChain %23 %20 %21 %27
+         %75 = OpLoad %8 %74
+               OpReturnValue %75
+         %69 = OpLabel
+               OpUnreachable
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 9 1 0 5 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_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-combine-and-or-xor-pack-unpack.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-and-or-xor-pack-unpack.amber
new file mode 100644 (file)
index 0000000..125e1b1
--- /dev/null
@@ -0,0 +1,288 @@
+#!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 and or xor 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_0 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_127_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 127.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [3, 0, 2, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     // Packs the components into an unsigned integer of 4294967295u.
+#     uint a = packUnorm4x8(vec4(_float_1_0));
+#
+#     // Unpacks the packed integer into signed integers and converts them into
+#     // normalized floating-point values.
+#     vec4 v1 = unpackSnorm4x8(a);
+#
+#     // Reference values. The unpacked values were also divided by 127.0, thus they
+#     // can be compared to the reference value regardless of loss of precision.
+#     vec4 ref = vec4(-_float_1_0 / _float_127_0, -_float_1_0 / _float_127_0,
+#                     -_float_1_0 / _float_127_0, -_float_1_0 / _float_127_0);
+#
+#     if (v1[_int_0] == ref[_int_3] && v1[_int_1] == ref[_int_2] &&
+#         v1[_int_2] == ref[_int_1] && v1[_int_3] == ref[_int_0])
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(v1[_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: 132
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %112
+               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 %24 "v1"
+               OpName %27 "ref"
+               OpName %57 "buf1"
+               OpMemberName %57 0 "_GLF_uniform_int_values"
+               OpName %59 ""
+               OpName %112 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %56 ArrayStride 16
+               OpMemberDecorate %57 0 Offset 0
+               OpDecorate %57 Block
+               OpDecorate %59 DescriptorSet 0
+               OpDecorate %59 Binding 1
+               OpDecorate %112 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 0
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeFloat 32
+         %10 = OpConstant %6 2
+         %11 = OpTypeArray %9 %10
+         %12 = OpTypeStruct %11
+         %13 = OpTypePointer Uniform %12
+         %14 = OpVariable %13 Uniform
+         %15 = OpTypeInt 32 1
+         %16 = OpConstant %15 0
+         %17 = OpTypePointer Uniform %9
+         %20 = OpTypeVector %9 4
+         %23 = OpTypePointer Function %20
+         %31 = OpConstant %15 1
+         %54 = OpTypeBool
+         %55 = OpConstant %6 4
+         %56 = OpTypeArray %15 %55
+         %57 = OpTypeStruct %56
+         %58 = OpTypePointer Uniform %57
+         %59 = OpVariable %58 Uniform
+         %60 = OpTypePointer Uniform %15
+         %63 = OpTypePointer Function %9
+         %73 = OpConstant %15 3
+         %78 = OpConstant %15 2
+        %111 = OpTypePointer Output %20
+        %112 = OpVariable %111 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %24 = OpVariable %23 Function
+         %27 = OpVariable %23 Function
+         %18 = OpAccessChain %17 %14 %16 %16
+         %19 = OpLoad %9 %18
+         %21 = OpCompositeConstruct %20 %19 %19 %19 %19
+         %22 = OpExtInst %6 %1 PackUnorm4x8 %21
+               OpStore %8 %22
+         %25 = OpLoad %6 %8
+         %26 = OpExtInst %20 %1 UnpackSnorm4x8 %25
+               OpStore %24 %26
+         %28 = OpAccessChain %17 %14 %16 %16
+         %29 = OpLoad %9 %28
+         %30 = OpFNegate %9 %29
+         %32 = OpAccessChain %17 %14 %16 %31
+         %33 = OpLoad %9 %32
+         %34 = OpFDiv %9 %30 %33
+         %35 = OpAccessChain %17 %14 %16 %16
+         %36 = OpLoad %9 %35
+         %37 = OpFNegate %9 %36
+         %38 = OpAccessChain %17 %14 %16 %31
+         %39 = OpLoad %9 %38
+         %40 = OpFDiv %9 %37 %39
+         %41 = OpAccessChain %17 %14 %16 %16
+         %42 = OpLoad %9 %41
+         %43 = OpFNegate %9 %42
+         %44 = OpAccessChain %17 %14 %16 %31
+         %45 = OpLoad %9 %44
+         %46 = OpFDiv %9 %43 %45
+         %47 = OpAccessChain %17 %14 %16 %16
+         %48 = OpLoad %9 %47
+         %49 = OpFNegate %9 %48
+         %50 = OpAccessChain %17 %14 %16 %31
+         %51 = OpLoad %9 %50
+         %52 = OpFDiv %9 %49 %51
+         %53 = OpCompositeConstruct %20 %34 %40 %46 %52
+               OpStore %27 %53
+         %61 = OpAccessChain %60 %59 %16 %31
+         %62 = OpLoad %15 %61
+         %64 = OpAccessChain %63 %24 %62
+         %65 = OpLoad %9 %64
+         %66 = OpAccessChain %60 %59 %16 %16
+         %67 = OpLoad %15 %66
+         %68 = OpAccessChain %63 %27 %67
+         %69 = OpLoad %9 %68
+         %70 = OpFOrdEqual %54 %65 %69
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %71 %72
+         %71 = OpLabel
+         %74 = OpAccessChain %60 %59 %16 %73
+         %75 = OpLoad %15 %74
+         %76 = OpAccessChain %63 %24 %75
+         %77 = OpLoad %9 %76
+         %79 = OpAccessChain %60 %59 %16 %78
+         %80 = OpLoad %15 %79
+         %81 = OpAccessChain %63 %27 %80
+         %82 = OpLoad %9 %81
+         %83 = OpFOrdEqual %54 %77 %82
+               OpBranch %72
+         %72 = OpLabel
+         %84 = OpPhi %54 %70 %5 %83 %71
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %85 %86
+         %85 = OpLabel
+         %87 = OpAccessChain %60 %59 %16 %78
+         %88 = OpLoad %15 %87
+         %89 = OpAccessChain %63 %24 %88
+         %90 = OpLoad %9 %89
+         %91 = OpAccessChain %60 %59 %16 %73
+         %92 = OpLoad %15 %91
+         %93 = OpAccessChain %63 %27 %92
+         %94 = OpLoad %9 %93
+         %95 = OpFOrdEqual %54 %90 %94
+               OpBranch %86
+         %86 = OpLabel
+         %96 = OpPhi %54 %84 %72 %95 %85
+               OpSelectionMerge %98 None
+               OpBranchConditional %96 %97 %98
+         %97 = OpLabel
+         %99 = OpAccessChain %60 %59 %16 %16
+        %100 = OpLoad %15 %99
+        %101 = OpAccessChain %63 %24 %100
+        %102 = OpLoad %9 %101
+        %103 = OpAccessChain %60 %59 %16 %31
+        %104 = OpLoad %15 %103
+        %105 = OpAccessChain %63 %27 %104
+        %106 = OpLoad %9 %105
+        %107 = OpFOrdEqual %54 %102 %106
+               OpBranch %98
+         %98 = OpLabel
+        %108 = OpPhi %54 %96 %86 %107 %97
+               OpSelectionMerge %110 None
+               OpBranchConditional %108 %109 %126
+        %109 = OpLabel
+        %113 = OpAccessChain %60 %59 %16 %73
+        %114 = OpLoad %15 %113
+        %115 = OpConvertSToF %9 %114
+        %116 = OpAccessChain %60 %59 %16 %31
+        %117 = OpLoad %15 %116
+        %118 = OpConvertSToF %9 %117
+        %119 = OpAccessChain %60 %59 %16 %31
+        %120 = OpLoad %15 %119
+        %121 = OpConvertSToF %9 %120
+        %122 = OpAccessChain %60 %59 %16 %73
+        %123 = OpLoad %15 %122
+        %124 = OpConvertSToF %9 %123
+        %125 = OpCompositeConstruct %20 %115 %118 %121 %124
+               OpStore %112 %125
+               OpBranch %110
+        %126 = OpLabel
+        %127 = OpAccessChain %60 %59 %16 %31
+        %128 = OpLoad %15 %127
+        %129 = OpAccessChain %63 %24 %128
+        %130 = OpLoad %9 %129
+        %131 = OpCompositeConstruct %20 %130 %130 %130 %130
+               OpStore %112 %131
+               OpBranch %110
+        %110 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 0 2 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 127.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-combine-and-or-xor-switch.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-and-or-xor-switch.amber
new file mode 100644 (file)
index 0000000..4ba9323
--- /dev/null
@@ -0,0 +1,235 @@
+#!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 and or xor 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_4 _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_10 _GLF_uniform_int_values[4]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [4, 2, 0, 1, 10]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[5];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     int count0 = _int_0;
+#     int count1 = _int_0;
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         switch (i)
+#         {
+#             case 0:
+#             case 1:
+#                 count0++;
+#             case 3:
+#             case 2:
+#                 count1++;
+#         }
+#     }
+#     if (count1 == _int_4)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_int_0);
+#     }
+#     if (count0 != _int_2)
+#     {
+#         _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: 88
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %58
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "count0"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %20 "count1"
+               OpName %23 "i"
+               OpName %58 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %58 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeInt 32 0
+         %10 = OpConstant %9 5
+         %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
+         %32 = OpConstant %6 4
+         %35 = OpTypeBool
+         %42 = OpConstant %6 1
+         %55 = OpTypeFloat 32
+         %56 = OpTypeVector %55 4
+         %57 = OpTypePointer Output %56
+         %58 = OpVariable %57 Output
+         %59 = OpConstant %6 3
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %20 = OpVariable %7 Function
+         %23 = 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
+         %24 = OpAccessChain %17 %14 %15 %16
+         %25 = OpLoad %6 %24
+               OpStore %23 %25
+               OpBranch %26
+         %26 = OpLabel
+               OpLoopMerge %28 %29 None
+               OpBranch %30
+         %30 = OpLabel
+         %31 = OpLoad %6 %23
+         %33 = OpAccessChain %17 %14 %15 %32
+         %34 = OpLoad %6 %33
+         %36 = OpSLessThan %35 %31 %34
+               OpBranchConditional %36 %27 %28
+         %27 = OpLabel
+         %37 = OpLoad %6 %23
+               OpSelectionMerge %40 None
+               OpSwitch %37 %40 0 %38 1 %38 3 %39 2 %39
+         %38 = OpLabel
+         %41 = OpLoad %6 %8
+         %43 = OpIAdd %6 %41 %42
+               OpStore %8 %43
+               OpBranch %39
+         %39 = OpLabel
+         %44 = OpLoad %6 %20
+         %45 = OpIAdd %6 %44 %42
+               OpStore %20 %45
+               OpBranch %40
+         %40 = OpLabel
+               OpBranch %29
+         %29 = OpLabel
+         %47 = OpLoad %6 %23
+         %48 = OpIAdd %6 %47 %42
+               OpStore %23 %48
+               OpBranch %26
+         %28 = OpLabel
+         %49 = OpLoad %6 %20
+         %50 = OpAccessChain %17 %14 %15 %15
+         %51 = OpLoad %6 %50
+         %52 = OpIEqual %35 %49 %51
+               OpSelectionMerge %54 None
+               OpBranchConditional %52 %53 %73
+         %53 = OpLabel
+         %60 = OpAccessChain %17 %14 %15 %59
+         %61 = OpLoad %6 %60
+         %62 = OpConvertSToF %55 %61
+         %63 = OpAccessChain %17 %14 %15 %16
+         %64 = OpLoad %6 %63
+         %65 = OpConvertSToF %55 %64
+         %66 = OpAccessChain %17 %14 %15 %16
+         %67 = OpLoad %6 %66
+         %68 = OpConvertSToF %55 %67
+         %69 = OpAccessChain %17 %14 %15 %59
+         %70 = OpLoad %6 %69
+         %71 = OpConvertSToF %55 %70
+         %72 = OpCompositeConstruct %56 %62 %65 %68 %71
+               OpStore %58 %72
+               OpBranch %54
+         %73 = OpLabel
+         %74 = OpAccessChain %17 %14 %15 %16
+         %75 = OpLoad %6 %74
+         %76 = OpConvertSToF %55 %75
+         %77 = OpCompositeConstruct %56 %76 %76 %76 %76
+               OpStore %58 %77
+               OpBranch %54
+         %54 = OpLabel
+         %78 = OpLoad %6 %8
+         %79 = OpAccessChain %17 %14 %15 %42
+         %80 = OpLoad %6 %79
+         %81 = OpINotEqual %35 %78 %80
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %82 %83
+         %82 = OpLabel
+         %84 = OpAccessChain %17 %14 %15 %16
+         %85 = OpLoad %6 %84
+         %86 = OpConvertSToF %55 %85
+         %87 = OpCompositeConstruct %56 %86 %86 %86 %86
+               OpStore %58 %87
+               OpBranch %83
+         %83 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 4 2 0 1 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_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-combine-and-or-xor-xor-add.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-and-or-xor-xor-add.amber
new file mode 100644 (file)
index 0000000..5d427f9
--- /dev/null
@@ -0,0 +1,203 @@
+#!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 and or xor 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 _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: [0, 1]
+# 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()
+# {
+#     float data[2];
+#     data[_int_0] = _float_0_0;
+#     data[_int_1] = _float_1_0;
+#     float a = data[(1 ^ (_int_1 & 2))];
+#     if (a == _float_1_0)
+#     {
+#         _GLF_color = vec4(_float_1_0, _float_0_0, _float_0_0, _float_1_0);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_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: 67
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %53
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "data"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %22 "buf1"
+               OpMemberName %22 0 "_GLF_uniform_float_values"
+               OpName %24 ""
+               OpName %36 "a"
+               OpName %53 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %21 ArrayStride 16
+               OpMemberDecorate %22 0 Offset 0
+               OpDecorate %22 Block
+               OpDecorate %24 DescriptorSet 0
+               OpDecorate %24 Binding 1
+               OpDecorate %53 Location 0
+          %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 = OpTypeArray %12 %8
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %12 0
+         %18 = OpTypePointer Uniform %12
+         %21 = OpTypeArray %6 %8
+         %22 = OpTypeStruct %21
+         %23 = OpTypePointer Uniform %22
+         %24 = OpVariable %23 Uniform
+         %25 = OpTypePointer Uniform %6
+         %28 = OpTypePointer Function %6
+         %30 = OpConstant %12 1
+         %39 = OpConstant %12 2
+         %47 = OpTypeBool
+         %51 = OpTypeVector %6 4
+         %52 = OpTypePointer Output %51
+         %53 = OpVariable %52 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %36 = OpVariable %28 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %12 %19
+         %26 = OpAccessChain %25 %24 %17 %17
+         %27 = OpLoad %6 %26
+         %29 = OpAccessChain %28 %11 %20
+               OpStore %29 %27
+         %31 = OpAccessChain %18 %16 %17 %30
+         %32 = OpLoad %12 %31
+         %33 = OpAccessChain %25 %24 %17 %30
+         %34 = OpLoad %6 %33
+         %35 = OpAccessChain %28 %11 %32
+               OpStore %35 %34
+         %37 = OpAccessChain %18 %16 %17 %30
+         %38 = OpLoad %12 %37
+         %40 = OpBitwiseAnd %12 %38 %39
+         %41 = OpBitwiseXor %12 %30 %40
+         %42 = OpAccessChain %28 %11 %41
+         %43 = OpLoad %6 %42
+               OpStore %36 %43
+         %44 = OpLoad %6 %36
+         %45 = OpAccessChain %25 %24 %17 %30
+         %46 = OpLoad %6 %45
+         %48 = OpFOrdEqual %47 %44 %46
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %63
+         %49 = OpLabel
+         %54 = OpAccessChain %25 %24 %17 %30
+         %55 = OpLoad %6 %54
+         %56 = OpAccessChain %25 %24 %17 %17
+         %57 = OpLoad %6 %56
+         %58 = OpAccessChain %25 %24 %17 %17
+         %59 = OpLoad %6 %58
+         %60 = OpAccessChain %25 %24 %17 %30
+         %61 = OpLoad %6 %60
+         %62 = OpCompositeConstruct %51 %55 %57 %59 %61
+               OpStore %53 %62
+               OpBranch %50
+         %63 = OpLabel
+         %64 = OpAccessChain %25 %24 %17 %17
+         %65 = OpLoad %6 %64
+         %66 = OpCompositeConstruct %51 %65 %65 %65 %65
+               OpStore %53 %66
+               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
+ 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-inst-combine-compares-combine-select-uaddcarry.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-combine-select-uaddcarry.amber
new file mode 100644 (file)
index 0000000..4da8d88
--- /dev/null
@@ -0,0 +1,333 @@
+#!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 a specific instruction combine compares and combine select 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 _uint_1 _GLF_uniform_uint_values[0]
+# #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_uint_values: 1
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     uint _GLF_uniform_uint_values[1];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [2, 0, 1]
+# layout(set = 0, binding = 2) uniform buf2
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# struct S {
+#     int a;
+# };
+#
+# // Always returns 1.
+# int f1()
+# {
+#     S A = S(1);
+#     int i = _int_0;
+#     for (int i = _int_0; i < _int_0 + _int_2; i++)
+#     {
+#         if (A.a == clamp(i, _int_0, 1))
+#         {
+#             return _int_1;
+#         }
+#     }
+#
+#     // The function returns before reaching this.
+#     return _int_2;
+# }
+#
+# // Always returns 1.0.
+# float f2()
+# {
+#     return float(f1());
+# }
+#
+# void main()
+# {
+#     uint a = _uint_1;
+#     uint b = uaddCarry(uint(2 * _int_0), uint(_int_0), a);
+#     if (b == 0u && f2() == _float_1_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_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: 130
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %111
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "f1("
+               OpName %12 "f2("
+               OpName %14 "S"
+               OpMemberName %14 0 "a"
+               OpName %16 "A"
+               OpName %20 "i"
+               OpName %24 "buf2"
+               OpMemberName %24 0 "_GLF_uniform_int_values"
+               OpName %26 ""
+               OpName %31 "i"
+               OpName %71 "a"
+               OpName %74 "buf1"
+               OpMemberName %74 0 "_GLF_uniform_uint_values"
+               OpName %76 ""
+               OpName %80 "b"
+               OpName %88 "ResType"
+               OpName %99 "buf0"
+               OpMemberName %99 0 "_GLF_uniform_float_values"
+               OpName %101 ""
+               OpName %111 "_GLF_color"
+               OpDecorate %23 ArrayStride 16
+               OpMemberDecorate %24 0 Offset 0
+               OpDecorate %24 Block
+               OpDecorate %26 DescriptorSet 0
+               OpDecorate %26 Binding 2
+               OpDecorate %73 ArrayStride 16
+               OpMemberDecorate %74 0 Offset 0
+               OpDecorate %74 Block
+               OpDecorate %76 DescriptorSet 0
+               OpDecorate %76 Binding 1
+               OpDecorate %98 ArrayStride 16
+               OpMemberDecorate %99 0 Offset 0
+               OpDecorate %99 Block
+               OpDecorate %101 DescriptorSet 0
+               OpDecorate %101 Binding 0
+               OpDecorate %111 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeFunction %6
+         %10 = OpTypeFloat 32
+         %11 = OpTypeFunction %10
+         %14 = OpTypeStruct %6
+         %15 = OpTypePointer Function %14
+         %17 = OpConstant %6 1
+         %18 = OpConstantComposite %14 %17
+         %19 = OpTypePointer Function %6
+         %21 = OpTypeInt 32 0
+         %22 = OpConstant %21 3
+         %23 = OpTypeArray %6 %22
+         %24 = OpTypeStruct %23
+         %25 = OpTypePointer Uniform %24
+         %26 = OpVariable %25 Uniform
+         %27 = OpConstant %6 0
+         %28 = OpTypePointer Uniform %6
+         %45 = OpTypeBool
+         %56 = OpConstant %6 2
+         %70 = OpTypePointer Function %21
+         %72 = OpConstant %21 1
+         %73 = OpTypeArray %21 %72
+         %74 = OpTypeStruct %73
+         %75 = OpTypePointer Uniform %74
+         %76 = OpVariable %75 Uniform
+         %77 = OpTypePointer Uniform %21
+         %88 = OpTypeStruct %21 %21
+         %93 = OpConstant %21 0
+         %98 = OpTypeArray %10 %72
+         %99 = OpTypeStruct %98
+        %100 = OpTypePointer Uniform %99
+        %101 = OpVariable %100 Uniform
+        %102 = OpTypePointer Uniform %10
+        %109 = OpTypeVector %10 4
+        %110 = OpTypePointer Output %109
+        %111 = OpVariable %110 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %71 = OpVariable %70 Function
+         %80 = OpVariable %70 Function
+         %78 = OpAccessChain %77 %76 %27 %27
+         %79 = OpLoad %21 %78
+               OpStore %71 %79
+         %81 = OpAccessChain %28 %26 %27 %17
+         %82 = OpLoad %6 %81
+         %83 = OpIMul %6 %56 %82
+         %84 = OpBitcast %21 %83
+         %85 = OpAccessChain %28 %26 %27 %17
+         %86 = OpLoad %6 %85
+         %87 = OpBitcast %21 %86
+         %89 = OpIAddCarry %88 %84 %87
+         %90 = OpCompositeExtract %21 %89 1
+               OpStore %71 %90
+         %91 = OpCompositeExtract %21 %89 0
+               OpStore %80 %91
+         %92 = OpLoad %21 %80
+         %94 = OpIEqual %45 %92 %93
+               OpSelectionMerge %96 None
+               OpBranchConditional %94 %95 %96
+         %95 = OpLabel
+         %97 = OpFunctionCall %10 %12
+        %103 = OpAccessChain %102 %101 %27 %27
+        %104 = OpLoad %10 %103
+        %105 = OpFOrdEqual %45 %97 %104
+               OpBranch %96
+         %96 = OpLabel
+        %106 = OpPhi %45 %94 %5 %105 %95
+               OpSelectionMerge %108 None
+               OpBranchConditional %106 %107 %125
+        %107 = OpLabel
+        %112 = OpAccessChain %28 %26 %27 %56
+        %113 = OpLoad %6 %112
+        %114 = OpConvertSToF %10 %113
+        %115 = OpAccessChain %28 %26 %27 %17
+        %116 = OpLoad %6 %115
+        %117 = OpConvertSToF %10 %116
+        %118 = OpAccessChain %28 %26 %27 %17
+        %119 = OpLoad %6 %118
+        %120 = OpConvertSToF %10 %119
+        %121 = OpAccessChain %28 %26 %27 %56
+        %122 = OpLoad %6 %121
+        %123 = OpConvertSToF %10 %122
+        %124 = OpCompositeConstruct %109 %114 %117 %120 %123
+               OpStore %111 %124
+               OpBranch %108
+        %125 = OpLabel
+        %126 = OpAccessChain %28 %26 %27 %56
+        %127 = OpLoad %6 %126
+        %128 = OpConvertSToF %10 %127
+        %129 = OpCompositeConstruct %109 %128 %128 %128 %128
+               OpStore %111 %129
+               OpBranch %108
+        %108 = OpLabel
+               OpReturn
+               OpFunctionEnd
+          %8 = OpFunction %6 None %7
+          %9 = OpLabel
+         %16 = OpVariable %15 Function
+         %20 = OpVariable %19 Function
+         %31 = OpVariable %19 Function
+               OpStore %16 %18
+         %29 = OpAccessChain %28 %26 %27 %17
+         %30 = OpLoad %6 %29
+               OpStore %20 %30
+         %32 = OpAccessChain %28 %26 %27 %17
+         %33 = OpLoad %6 %32
+               OpStore %31 %33
+               OpBranch %34
+         %34 = OpLabel
+               OpLoopMerge %36 %37 None
+               OpBranch %38
+         %38 = OpLabel
+         %39 = OpLoad %6 %31
+         %40 = OpAccessChain %28 %26 %27 %17
+         %41 = OpLoad %6 %40
+         %42 = OpAccessChain %28 %26 %27 %27
+         %43 = OpLoad %6 %42
+         %44 = OpIAdd %6 %41 %43
+         %46 = OpSLessThan %45 %39 %44
+               OpBranchConditional %46 %35 %36
+         %35 = OpLabel
+         %47 = OpAccessChain %19 %16 %27
+         %48 = OpLoad %6 %47
+         %49 = OpLoad %6 %31
+         %50 = OpAccessChain %28 %26 %27 %17
+         %51 = OpLoad %6 %50
+         %52 = OpExtInst %6 %1 SClamp %49 %51 %17
+         %53 = OpIEqual %45 %48 %52
+               OpSelectionMerge %55 None
+               OpBranchConditional %53 %54 %55
+         %54 = OpLabel
+         %57 = OpAccessChain %28 %26 %27 %56
+         %58 = OpLoad %6 %57
+               OpReturnValue %58
+         %55 = OpLabel
+               OpBranch %37
+         %37 = OpLabel
+         %60 = OpLoad %6 %31
+         %61 = OpIAdd %6 %60 %17
+               OpStore %31 %61
+               OpBranch %34
+         %36 = OpLabel
+         %62 = OpAccessChain %28 %26 %27 %27
+         %63 = OpLoad %6 %62
+               OpReturnValue %63
+               OpFunctionEnd
+         %12 = OpFunction %10 None %11
+         %13 = OpLabel
+         %66 = OpFunctionCall %6 %8
+         %67 = OpConvertSToF %10 %66
+               OpReturnValue %67
+               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_uint_values
+BUFFER variant__GLF_uniform_uint_values DATA_TYPE int32[] STD140 DATA
+ 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER variant__GLF_uniform_uint_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-combine-compares-isnan.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-isnan.amber
new file mode 100644 (file)
index 0000000..a54455b
--- /dev/null
@@ -0,0 +1,151 @@
+#!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 combine compare 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];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     if (isnan((-_GLF_color).x))
+#     {
+#         _GLF_color = vec4(_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: 45
+; 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 ""
+               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 %42 RelaxedPrecision
+          %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
+         %35 = OpConstant %11 0
+         %37 = OpTypeBool
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %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
+         %33 = OpLoad %7 %9
+         %34 = OpFNegate %7 %33
+         %36 = OpCompositeExtract %6 %34 0
+         %38 = OpIsNan %37 %36
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %39 %40
+         %39 = OpLabel
+         %41 = OpAccessChain %18 %16 %17 %17
+         %42 = OpLoad %10 %41
+         %43 = OpConvertSToF %6 %42
+         %44 = OpCompositeConstruct %7 %43 %43 %43 %43
+               OpStore %9 %44
+               OpBranch %40
+         %40 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-ldexp.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-ldexp.amber
new file mode 100644 (file)
index 0000000..88f2488
--- /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 instruction 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 _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: [0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     if (ldexp(_float_0_0, 10000) == _float_0_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_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: 54
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %28
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %10 "buf0"
+               OpMemberName %10 0 "_GLF_uniform_float_values"
+               OpName %12 ""
+               OpName %28 "_GLF_color"
+               OpName %31 "buf1"
+               OpMemberName %31 0 "_GLF_uniform_int_values"
+               OpName %33 ""
+               OpDecorate %9 ArrayStride 16
+               OpMemberDecorate %10 0 Offset 0
+               OpDecorate %10 Block
+               OpDecorate %12 DescriptorSet 0
+               OpDecorate %12 Binding 0
+               OpDecorate %28 Location 0
+               OpDecorate %30 ArrayStride 16
+               OpMemberDecorate %31 0 Offset 0
+               OpDecorate %31 Block
+               OpDecorate %33 DescriptorSet 0
+               OpDecorate %33 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 1
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypeStruct %9
+         %11 = OpTypePointer Uniform %10
+         %12 = OpVariable %11 Uniform
+         %13 = OpTypeInt 32 1
+         %14 = OpConstant %13 0
+         %15 = OpTypePointer Uniform %6
+         %18 = OpConstant %13 10000
+         %22 = OpTypeBool
+         %26 = OpTypeVector %6 4
+         %27 = OpTypePointer Output %26
+         %28 = OpVariable %27 Output
+         %29 = OpConstant %7 2
+         %30 = OpTypeArray %13 %29
+         %31 = OpTypeStruct %30
+         %32 = OpTypePointer Uniform %31
+         %33 = OpVariable %32 Uniform
+         %34 = OpConstant %13 1
+         %35 = OpTypePointer Uniform %13
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %16 = OpAccessChain %15 %12 %14 %14
+         %17 = OpLoad %6 %16
+         %19 = OpExtInst %6 %1 Ldexp %17 %18
+         %20 = OpAccessChain %15 %12 %14 %14
+         %21 = OpLoad %6 %20
+         %23 = OpFOrdEqual %22 %19 %21
+               OpSelectionMerge %25 None
+               OpBranchConditional %23 %24 %49
+         %24 = OpLabel
+         %36 = OpAccessChain %35 %33 %14 %34
+         %37 = OpLoad %13 %36
+         %38 = OpConvertSToF %6 %37
+         %39 = OpAccessChain %35 %33 %14 %14
+         %40 = OpLoad %13 %39
+         %41 = OpConvertSToF %6 %40
+         %42 = OpAccessChain %35 %33 %14 %14
+         %43 = OpLoad %13 %42
+         %44 = OpConvertSToF %6 %43
+         %45 = OpAccessChain %35 %33 %14 %34
+         %46 = OpLoad %13 %45
+         %47 = OpConvertSToF %6 %46
+         %48 = OpCompositeConstruct %26 %38 %41 %44 %47
+               OpStore %28 %48
+               OpBranch %25
+         %49 = OpLabel
+         %50 = OpAccessChain %35 %33 %14 %34
+         %51 = OpLoad %13 %50
+         %52 = OpConvertSToF %6 %51
+         %53 = OpCompositeConstruct %26 %52 %52 %52 %52
+               OpStore %28 %53
+               OpBranch %25
+         %25 = 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
+# _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-inst-combine-compares-ternary-vector-access.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-compares-ternary-vector-access.amber
new file mode 100644 (file)
index 0000000..6a1012d
--- /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 instruction combine compare 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_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+# #define _float_3_0 _GLF_uniform_float_values[3]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0, 2.0, 3.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[4];
+# };
+#
+# // 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()
+# {
+#     // a becomes 0.
+#     int a = (gl_FragCoord.y >= _float_0_0) ? 0 : 2;
+#
+#     float b = vec3(_float_1_0, _float_2_0, _float_3_0)[a];
+#
+#     if (b == _float_1_0)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_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: 77
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %12 %52
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "a"
+               OpName %12 "gl_FragCoord"
+               OpName %20 "buf0"
+               OpMemberName %20 0 "_GLF_uniform_float_values"
+               OpName %22 ""
+               OpName %32 "b"
+               OpName %52 "_GLF_color"
+               OpName %55 "buf1"
+               OpMemberName %55 0 "_GLF_uniform_int_values"
+               OpName %57 ""
+               OpDecorate %12 BuiltIn FragCoord
+               OpDecorate %19 ArrayStride 16
+               OpMemberDecorate %20 0 Offset 0
+               OpDecorate %20 Block
+               OpDecorate %22 DescriptorSet 0
+               OpDecorate %22 Binding 0
+               OpDecorate %52 Location 0
+               OpDecorate %54 ArrayStride 16
+               OpMemberDecorate %55 0 Offset 0
+               OpDecorate %55 Block
+               OpDecorate %57 DescriptorSet 0
+               OpDecorate %57 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpTypeFloat 32
+         %10 = OpTypeVector %9 4
+         %11 = OpTypePointer Input %10
+         %12 = OpVariable %11 Input
+         %13 = OpTypeInt 32 0
+         %14 = OpConstant %13 1
+         %15 = OpTypePointer Input %9
+         %18 = OpConstant %13 4
+         %19 = OpTypeArray %9 %18
+         %20 = OpTypeStruct %19
+         %21 = OpTypePointer Uniform %20
+         %22 = OpVariable %21 Uniform
+         %23 = OpConstant %6 0
+         %24 = OpTypePointer Uniform %9
+         %27 = OpTypeBool
+         %29 = OpConstant %6 2
+         %31 = OpTypePointer Function %9
+         %33 = OpConstant %6 1
+         %38 = OpConstant %6 3
+         %41 = OpTypeVector %9 3
+         %51 = OpTypePointer Output %10
+         %52 = OpVariable %51 Output
+         %53 = OpConstant %13 2
+         %54 = OpTypeArray %6 %53
+         %55 = OpTypeStruct %54
+         %56 = OpTypePointer Uniform %55
+         %57 = OpVariable %56 Uniform
+         %58 = OpTypePointer Uniform %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %32 = OpVariable %31 Function
+         %16 = OpAccessChain %15 %12 %14
+         %17 = OpLoad %9 %16
+         %25 = OpAccessChain %24 %22 %23 %23
+         %26 = OpLoad %9 %25
+         %28 = OpFOrdGreaterThanEqual %27 %17 %26
+         %30 = OpSelect %6 %28 %23 %29
+               OpStore %8 %30
+         %34 = OpAccessChain %24 %22 %23 %33
+         %35 = OpLoad %9 %34
+         %36 = OpAccessChain %24 %22 %23 %29
+         %37 = OpLoad %9 %36
+         %39 = OpAccessChain %24 %22 %23 %38
+         %40 = OpLoad %9 %39
+         %42 = OpCompositeConstruct %41 %35 %37 %40
+         %43 = OpLoad %6 %8
+         %44 = OpVectorExtractDynamic %9 %42 %43
+               OpStore %32 %44
+         %45 = OpLoad %9 %32
+         %46 = OpAccessChain %24 %22 %23 %33
+         %47 = OpLoad %9 %46
+         %48 = OpFOrdEqual %27 %45 %47
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %72
+         %49 = OpLabel
+         %59 = OpAccessChain %58 %57 %23 %23
+         %60 = OpLoad %6 %59
+         %61 = OpConvertSToF %9 %60
+         %62 = OpAccessChain %58 %57 %23 %33
+         %63 = OpLoad %6 %62
+         %64 = OpConvertSToF %9 %63
+         %65 = OpAccessChain %58 %57 %23 %33
+         %66 = OpLoad %6 %65
+         %67 = OpConvertSToF %9 %66
+         %68 = OpAccessChain %58 %57 %23 %23
+         %69 = OpLoad %6 %68
+         %70 = OpConvertSToF %9 %69
+         %71 = OpCompositeConstruct %10 %61 %64 %67 %70
+               OpStore %52 %71
+               OpBranch %50
+         %72 = OpLabel
+         %73 = OpAccessChain %58 %57 %23 %23
+         %74 = OpLoad %6 %73
+         %75 = OpConvertSToF %9 %74
+         %76 = OpCompositeConstruct %10 %75 %75 %75 %75
+               OpStore %52 %76
+               OpBranch %50
+         %50 = 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
+ 0.0 1.0 2.0 3.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-combine-shifts-bitfield-bitcount.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-shifts-bitfield-bitcount.amber
new file mode 100644 (file)
index 0000000..dd85566
--- /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 combine shifts 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]
+#
+# 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()
+# {
+#     // Always zero.
+#     int i = bitfieldExtract(_int_0, bitCount(0), _int_1);
+#
+#     if (i == _int_0)
+#     {
+#         _GLF_color = vec4(_int_1, i, i, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(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: 50
+; 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 "i"
+               OpName %12 "buf0"
+               OpMemberName %12 0 "_GLF_uniform_int_values"
+               OpName %14 ""
+               OpName %34 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %19 RelaxedPrecision
+               OpDecorate %34 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %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 = OpConstant %6 0
+         %16 = OpTypePointer Uniform %6
+         %20 = OpConstant %6 1
+         %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
+         %17 = OpAccessChain %16 %14 %15 %15
+         %18 = OpLoad %6 %17
+         %19 = OpBitCount %6 %15
+         %21 = OpAccessChain %16 %14 %15 %20
+         %22 = OpLoad %6 %21
+         %23 = OpBitFieldSExtract %6 %18 %19 %22
+               OpStore %8 %23
+         %24 = OpLoad %6 %8
+         %25 = OpAccessChain %16 %14 %15 %15
+         %26 = OpLoad %6 %25
+         %28 = OpIEqual %27 %24 %26
+               OpSelectionMerge %30 None
+               OpBranchConditional %28 %29 %46
+         %29 = OpLabel
+         %35 = OpAccessChain %16 %14 %15 %20
+         %36 = OpLoad %6 %35
+         %37 = OpConvertSToF %31 %36
+         %38 = OpLoad %6 %8
+         %39 = OpConvertSToF %31 %38
+         %40 = OpLoad %6 %8
+         %41 = OpConvertSToF %31 %40
+         %42 = OpAccessChain %16 %14 %15 %20
+         %43 = OpLoad %6 %42
+         %44 = OpConvertSToF %31 %43
+         %45 = OpCompositeConstruct %32 %37 %39 %41 %44
+               OpStore %34 %45
+               OpBranch %30
+         %46 = OpLabel
+         %47 = OpLoad %6 %8
+         %48 = OpConvertSToF %31 %47
+         %49 = OpCompositeConstruct %32 %48 %48 %48 %48
+               OpStore %34 %49
+               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-inst-combine-shifts-mix-mix-clamp.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-inst-combine-shifts-mix-mix-clamp.amber
new file mode 100644 (file)
index 0000000..c879660
--- /dev/null
@@ -0,0 +1,313 @@
+#!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 combine shifts 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_2 _GLF_uniform_int_values[1]
+# #define _int_0 _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;
+# precision highp int;
+#
+# // 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, 2, 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[2];
+#     A[_int_0] = _int_1;
+#     A[_int_1] = _int_2;
+#
+#     int i = _int_1;
+#     while (i > _int_0)
+#     {
+#         i--;
+#     }
+#
+#     int a = A[((_float_0_0 >= _float_0_0) ? 1 : i)];
+#
+#     // v1 becomes vec2(1, 1).
+#     vec2 v1 = mix(vec2(_int_1, a), vec2(_int_1, _int_1), bvec2((_float_0_0 < _float_1_0), true));
+#
+#     // v2 becomes vec2(1, 1).
+#     vec2 v2 = mix(vec2(v1[_int_0]), vec2(v1[_int_1]), bvec2(false));
+#
+#     int b = A[int(clamp(vec2(_int_2), vec2(_int_1), v2).x)];
+#
+#     if (b == _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: 146
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %127
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "A"
+               OpName %14 "buf1"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %32 "i"
+               OpName %47 "a"
+               OpName %50 "buf0"
+               OpMemberName %50 0 "_GLF_uniform_float_values"
+               OpName %52 ""
+               OpName %65 "v1"
+               OpName %88 "v2"
+               OpName %103 "b"
+               OpName %127 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 1
+               OpDecorate %49 ArrayStride 16
+               OpMemberDecorate %50 0 Offset 0
+               OpDecorate %50 Block
+               OpDecorate %52 DescriptorSet 0
+               OpDecorate %52 Binding 0
+               OpDecorate %127 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeInt 32 0
+          %8 = OpConstant %7 2
+          %9 = OpTypeArray %6 %8
+         %10 = OpTypePointer Function %9
+         %12 = OpConstant %7 3
+         %13 = OpTypeArray %6 %12
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %6 0
+         %18 = OpConstant %6 2
+         %19 = OpTypePointer Uniform %6
+         %24 = OpTypePointer Function %6
+         %28 = OpConstant %6 1
+         %43 = OpTypeBool
+         %48 = OpTypeFloat 32
+         %49 = OpTypeArray %48 %8
+         %50 = OpTypeStruct %49
+         %51 = OpTypePointer Uniform %50
+         %52 = OpVariable %51 Uniform
+         %53 = OpTypePointer Uniform %48
+         %63 = OpTypeVector %48 2
+         %64 = OpTypePointer Function %63
+         %84 = OpConstantTrue %43
+         %85 = OpTypeVector %43 2
+         %91 = OpTypePointer Function %48
+        %100 = OpConstantFalse %43
+        %101 = OpConstantComposite %85 %100 %100
+        %114 = OpConstant %7 0
+        %125 = OpTypeVector %48 4
+        %126 = OpTypePointer Output %125
+        %127 = OpVariable %126 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %32 = OpVariable %24 Function
+         %47 = OpVariable %24 Function
+         %65 = OpVariable %64 Function
+         %88 = OpVariable %64 Function
+        %103 = OpVariable %24 Function
+         %20 = OpAccessChain %19 %16 %17 %18
+         %21 = OpLoad %6 %20
+         %22 = OpAccessChain %19 %16 %17 %17
+         %23 = OpLoad %6 %22
+         %25 = OpAccessChain %24 %11 %21
+               OpStore %25 %23
+         %26 = OpAccessChain %19 %16 %17 %17
+         %27 = OpLoad %6 %26
+         %29 = OpAccessChain %19 %16 %17 %28
+         %30 = OpLoad %6 %29
+         %31 = OpAccessChain %24 %11 %27
+               OpStore %31 %30
+         %33 = OpAccessChain %19 %16 %17 %17
+         %34 = OpLoad %6 %33
+               OpStore %32 %34
+               OpBranch %35
+         %35 = OpLabel
+               OpLoopMerge %37 %38 None
+               OpBranch %39
+         %39 = OpLabel
+         %40 = OpLoad %6 %32
+         %41 = OpAccessChain %19 %16 %17 %18
+         %42 = OpLoad %6 %41
+         %44 = OpSGreaterThan %43 %40 %42
+               OpBranchConditional %44 %36 %37
+         %36 = OpLabel
+         %45 = OpLoad %6 %32
+         %46 = OpISub %6 %45 %28
+               OpStore %32 %46
+               OpBranch %38
+         %38 = OpLabel
+               OpBranch %35
+         %37 = OpLabel
+         %54 = OpAccessChain %53 %52 %17 %28
+         %55 = OpLoad %48 %54
+         %56 = OpAccessChain %53 %52 %17 %28
+         %57 = OpLoad %48 %56
+         %58 = OpFOrdGreaterThanEqual %43 %55 %57
+         %59 = OpLoad %6 %32
+         %60 = OpSelect %6 %58 %28 %59
+         %61 = OpAccessChain %24 %11 %60
+         %62 = OpLoad %6 %61
+               OpStore %47 %62
+         %66 = OpAccessChain %19 %16 %17 %17
+         %67 = OpLoad %6 %66
+         %68 = OpConvertSToF %48 %67
+         %69 = OpLoad %6 %47
+         %70 = OpConvertSToF %48 %69
+         %71 = OpCompositeConstruct %63 %68 %70
+         %72 = OpAccessChain %19 %16 %17 %17
+         %73 = OpLoad %6 %72
+         %74 = OpConvertSToF %48 %73
+         %75 = OpAccessChain %19 %16 %17 %17
+         %76 = OpLoad %6 %75
+         %77 = OpConvertSToF %48 %76
+         %78 = OpCompositeConstruct %63 %74 %77
+         %79 = OpAccessChain %53 %52 %17 %28
+         %80 = OpLoad %48 %79
+         %81 = OpAccessChain %53 %52 %17 %17
+         %82 = OpLoad %48 %81
+         %83 = OpFOrdLessThan %43 %80 %82
+         %86 = OpCompositeConstruct %85 %83 %84
+         %87 = OpSelect %63 %86 %78 %71
+               OpStore %65 %87
+         %89 = OpAccessChain %19 %16 %17 %18
+         %90 = OpLoad %6 %89
+         %92 = OpAccessChain %91 %65 %90
+         %93 = OpLoad %48 %92
+         %94 = OpCompositeConstruct %63 %93 %93
+         %95 = OpAccessChain %19 %16 %17 %17
+         %96 = OpLoad %6 %95
+         %97 = OpAccessChain %91 %65 %96
+         %98 = OpLoad %48 %97
+         %99 = OpCompositeConstruct %63 %98 %98
+        %102 = OpSelect %63 %101 %99 %94
+               OpStore %88 %102
+        %104 = OpAccessChain %19 %16 %17 %28
+        %105 = OpLoad %6 %104
+        %106 = OpConvertSToF %48 %105
+        %107 = OpCompositeConstruct %63 %106 %106
+        %108 = OpAccessChain %19 %16 %17 %17
+        %109 = OpLoad %6 %108
+        %110 = OpConvertSToF %48 %109
+        %111 = OpCompositeConstruct %63 %110 %110
+        %112 = OpLoad %63 %88
+        %113 = OpExtInst %63 %1 FClamp %107 %111 %112
+        %115 = OpCompositeExtract %48 %113 0
+        %116 = OpConvertFToS %6 %115
+        %117 = OpAccessChain %24 %11 %116
+        %118 = OpLoad %6 %117
+               OpStore %103 %118
+        %119 = OpLoad %6 %103
+        %120 = OpAccessChain %19 %16 %17 %28
+        %121 = OpLoad %6 %120
+        %122 = OpIEqual %43 %119 %121
+               OpSelectionMerge %124 None
+               OpBranchConditional %122 %123 %141
+        %123 = OpLabel
+        %128 = OpAccessChain %19 %16 %17 %17
+        %129 = OpLoad %6 %128
+        %130 = OpConvertSToF %48 %129
+        %131 = OpAccessChain %19 %16 %17 %18
+        %132 = OpLoad %6 %131
+        %133 = OpConvertSToF %48 %132
+        %134 = OpAccessChain %19 %16 %17 %18
+        %135 = OpLoad %6 %134
+        %136 = OpConvertSToF %48 %135
+        %137 = OpAccessChain %19 %16 %17 %17
+        %138 = OpLoad %6 %137
+        %139 = OpConvertSToF %48 %138
+        %140 = OpCompositeConstruct %125 %130 %133 %136 %139
+               OpStore %127 %140
+               OpBranch %124
+        %141 = OpLabel
+        %142 = OpAccessChain %19 %16 %17 %18
+        %143 = OpLoad %6 %142
+        %144 = OpConvertSToF %48 %143
+        %145 = OpCompositeConstruct %125 %144 %144 %144 %144
+               OpStore %127 %145
+               OpBranch %124
+        %124 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 2 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-instr-info-det-mat-min.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instr-info-det-mat-min.amber
new file mode 100644 (file)
index 0000000..a45527b
--- /dev/null
@@ -0,0 +1,338 @@
+#!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 instr info 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_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1]
+# 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];
+# };
+#
+# int data[10];
+#
+# void f1()
+# {
+#     _GLF_color = vec4(0);
+#
+#     for (int i = _int_1; i < _int_10; i++)
+#     {
+#         data[i] = _int_0;
+#     }
+#
+#     float a = determinant(mat2(1.0, 1.0, 1.0, 1.0));
+#     float b = determinant(mat2(0.0, 0.0, 0.0, 0.0));
+#
+#     mat2x4 m24a = mat2x4(a, _float_1_0, _float_1_0, _float_1_0, _float_1_0,
+#                          _float_1_0, _float_1_0, _float_1_0);
+#     mat2x4 m24b = mat2x4(b, _float_1_0, _float_1_0, _float_1_0, _float_1_0,
+#                          _float_1_0, _float_1_0, _float_1_0);
+#
+#     float c = min(float(m24a), float(m24b));
+#
+#     if (c < _float_1_0 && a == 0.0 && b == 0.0)
+#     {
+#         data[0] = _int_1;
+#     }
+# }
+#
+# void main()
+# {
+#     for (int i = 0; i <= 10; i++)
+#     {
+#         f1();
+#     }
+#
+#     _GLF_color = vec4(data[0], _float_0_0, _float_0_0, data[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: 152
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %11
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %6 "f1("
+               OpName %11 "_GLF_color"
+               OpName %16 "i"
+               OpName %20 "buf0"
+               OpMemberName %20 0 "_GLF_uniform_int_values"
+               OpName %22 ""
+               OpName %42 "data"
+               OpName %51 "a"
+               OpName %58 "b"
+               OpName %64 "m24a"
+               OpName %68 "buf1"
+               OpMemberName %68 0 "_GLF_uniform_float_values"
+               OpName %70 ""
+               OpName %89 "m24b"
+               OpName %108 "c"
+               OpName %129 "i"
+               OpDecorate %11 Location 0
+               OpDecorate %19 ArrayStride 16
+               OpMemberDecorate %20 0 Offset 0
+               OpDecorate %20 Block
+               OpDecorate %22 DescriptorSet 0
+               OpDecorate %22 Binding 0
+               OpDecorate %67 ArrayStride 16
+               OpMemberDecorate %68 0 Offset 0
+               OpDecorate %68 Block
+               OpDecorate %70 DescriptorSet 0
+               OpDecorate %70 Binding 1
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %8 = OpTypeFloat 32
+          %9 = OpTypeVector %8 4
+         %10 = OpTypePointer Output %9
+         %11 = OpVariable %10 Output
+         %12 = OpConstant %8 0
+         %13 = OpConstantComposite %9 %12 %12 %12 %12
+         %14 = OpTypeInt 32 1
+         %15 = OpTypePointer Function %14
+         %17 = OpTypeInt 32 0
+         %18 = OpConstant %17 3
+         %19 = OpTypeArray %14 %18
+         %20 = OpTypeStruct %19
+         %21 = OpTypePointer Uniform %20
+         %22 = OpVariable %21 Uniform
+         %23 = OpConstant %14 0
+         %24 = OpConstant %14 1
+         %25 = OpTypePointer Uniform %14
+         %34 = OpConstant %14 2
+         %37 = OpTypeBool
+         %39 = OpConstant %17 10
+         %40 = OpTypeArray %14 %39
+         %41 = OpTypePointer Private %40
+         %42 = OpVariable %41 Private
+         %46 = OpTypePointer Private %14
+         %50 = OpTypePointer Function %8
+         %52 = OpTypeVector %8 2
+         %53 = OpTypeMatrix %52 2
+         %54 = OpConstant %8 1
+         %55 = OpConstantComposite %52 %54 %54
+         %56 = OpConstantComposite %53 %55 %55
+         %59 = OpConstantComposite %52 %12 %12
+         %60 = OpConstantComposite %53 %59 %59
+         %62 = OpTypeMatrix %9 2
+         %63 = OpTypePointer Function %62
+         %66 = OpConstant %17 2
+         %67 = OpTypeArray %8 %66
+         %68 = OpTypeStruct %67
+         %69 = OpTypePointer Uniform %68
+         %70 = OpVariable %69 Uniform
+         %71 = OpTypePointer Uniform %8
+        %136 = OpConstant %14 10
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+        %129 = OpVariable %15 Function
+               OpStore %129 %23
+               OpBranch %130
+        %130 = OpLabel
+               OpLoopMerge %132 %133 None
+               OpBranch %134
+        %134 = OpLabel
+        %135 = OpLoad %14 %129
+        %137 = OpSLessThanEqual %37 %135 %136
+               OpBranchConditional %137 %131 %132
+        %131 = OpLabel
+        %138 = OpFunctionCall %2 %6
+               OpBranch %133
+        %133 = OpLabel
+        %139 = OpLoad %14 %129
+        %140 = OpIAdd %14 %139 %24
+               OpStore %129 %140
+               OpBranch %130
+        %132 = OpLabel
+        %141 = OpAccessChain %46 %42 %23
+        %142 = OpLoad %14 %141
+        %143 = OpConvertSToF %8 %142
+        %144 = OpAccessChain %71 %70 %23 %23
+        %145 = OpLoad %8 %144
+        %146 = OpAccessChain %71 %70 %23 %23
+        %147 = OpLoad %8 %146
+        %148 = OpAccessChain %46 %42 %23
+        %149 = OpLoad %14 %148
+        %150 = OpConvertSToF %8 %149
+        %151 = OpCompositeConstruct %9 %143 %145 %147 %150
+               OpStore %11 %151
+               OpReturn
+               OpFunctionEnd
+          %6 = OpFunction %2 None %3
+          %7 = OpLabel
+         %16 = OpVariable %15 Function
+         %51 = OpVariable %50 Function
+         %58 = OpVariable %50 Function
+         %64 = OpVariable %63 Function
+         %89 = OpVariable %63 Function
+        %108 = OpVariable %50 Function
+               OpStore %11 %13
+         %26 = OpAccessChain %25 %22 %23 %24
+         %27 = OpLoad %14 %26
+               OpStore %16 %27
+               OpBranch %28
+         %28 = OpLabel
+               OpLoopMerge %30 %31 None
+               OpBranch %32
+         %32 = OpLabel
+         %33 = OpLoad %14 %16
+         %35 = OpAccessChain %25 %22 %23 %34
+         %36 = OpLoad %14 %35
+         %38 = OpSLessThan %37 %33 %36
+               OpBranchConditional %38 %29 %30
+         %29 = OpLabel
+         %43 = OpLoad %14 %16
+         %44 = OpAccessChain %25 %22 %23 %23
+         %45 = OpLoad %14 %44
+         %47 = OpAccessChain %46 %42 %43
+               OpStore %47 %45
+               OpBranch %31
+         %31 = OpLabel
+         %48 = OpLoad %14 %16
+         %49 = OpIAdd %14 %48 %24
+               OpStore %16 %49
+               OpBranch %28
+         %30 = OpLabel
+         %57 = OpExtInst %8 %1 Determinant %56
+               OpStore %51 %57
+         %61 = OpExtInst %8 %1 Determinant %60
+               OpStore %58 %61
+         %65 = OpLoad %8 %51
+         %72 = OpAccessChain %71 %70 %23 %24
+         %73 = OpLoad %8 %72
+         %74 = OpAccessChain %71 %70 %23 %24
+         %75 = OpLoad %8 %74
+         %76 = OpAccessChain %71 %70 %23 %24
+         %77 = OpLoad %8 %76
+         %78 = OpAccessChain %71 %70 %23 %24
+         %79 = OpLoad %8 %78
+         %80 = OpAccessChain %71 %70 %23 %24
+         %81 = OpLoad %8 %80
+         %82 = OpAccessChain %71 %70 %23 %24
+         %83 = OpLoad %8 %82
+         %84 = OpAccessChain %71 %70 %23 %24
+         %85 = OpLoad %8 %84
+         %86 = OpCompositeConstruct %9 %65 %73 %75 %77
+         %87 = OpCompositeConstruct %9 %79 %81 %83 %85
+         %88 = OpCompositeConstruct %62 %86 %87
+               OpStore %64 %88
+         %90 = OpLoad %8 %58
+         %91 = OpAccessChain %71 %70 %23 %24
+         %92 = OpLoad %8 %91
+         %93 = OpAccessChain %71 %70 %23 %24
+         %94 = OpLoad %8 %93
+         %95 = OpAccessChain %71 %70 %23 %24
+         %96 = OpLoad %8 %95
+         %97 = OpAccessChain %71 %70 %23 %24
+         %98 = OpLoad %8 %97
+         %99 = OpAccessChain %71 %70 %23 %24
+        %100 = OpLoad %8 %99
+        %101 = OpAccessChain %71 %70 %23 %24
+        %102 = OpLoad %8 %101
+        %103 = OpAccessChain %71 %70 %23 %24
+        %104 = OpLoad %8 %103
+        %105 = OpCompositeConstruct %9 %90 %92 %94 %96
+        %106 = OpCompositeConstruct %9 %98 %100 %102 %104
+        %107 = OpCompositeConstruct %62 %105 %106
+               OpStore %89 %107
+        %109 = OpLoad %62 %64
+        %110 = OpCompositeExtract %8 %109 0 0
+        %111 = OpLoad %62 %89
+        %112 = OpCompositeExtract %8 %111 0 0
+        %113 = OpExtInst %8 %1 FMin %110 %112
+               OpStore %108 %113
+        %114 = OpLoad %8 %108
+        %115 = OpAccessChain %71 %70 %23 %24
+        %116 = OpLoad %8 %115
+        %117 = OpFOrdLessThan %37 %114 %116
+        %118 = OpLoad %8 %51
+        %119 = OpFOrdEqual %37 %118 %12
+        %120 = OpLogicalAnd %37 %117 %119
+        %121 = OpLoad %8 %58
+        %122 = OpFOrdEqual %37 %121 %12
+        %123 = OpLogicalAnd %37 %120 %122
+               OpSelectionMerge %125 None
+               OpBranchConditional %123 %124 %125
+        %124 = OpLabel
+        %126 = OpAccessChain %25 %22 %23 %24
+        %127 = OpLoad %14 %126
+        %128 = OpAccessChain %46 %42 %23
+               OpStore %128 %127
+               OpBranch %125
+        %125 = 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
+ 0.0 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+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-for-if-less-than-equal.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instructions-for-if-less-than-equal.amber
new file mode 100644 (file)
index 0000000..9fcdc0e
--- /dev/null
@@ -0,0 +1,199 @@
+#!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 specific instruction simplify and combine compare 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_10 _GLF_uniform_int_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_25 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.25]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 10]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_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++)
+#     {
+#         // True when i = 0.
+#         if (!(_float_0_25 <= float(i)))
+#         {
+#             _GLF_color += vec4(_float_1_0, i, i, _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: 64
+; 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 "buf1"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %24 "i"
+               OpName %39 "buf0"
+               OpMemberName %39 0 "_GLF_uniform_float_values"
+               OpName %41 ""
+               OpDecorate %9 Location 0
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 1
+               OpDecorate %38 ArrayStride 16
+               OpMemberDecorate %39 0 Offset 0
+               OpDecorate %39 Block
+               OpDecorate %41 DescriptorSet 0
+               OpDecorate %41 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
+         %23 = OpTypePointer Function %10
+         %33 = OpConstant %10 1
+         %36 = OpTypeBool
+         %38 = OpTypeArray %6 %12
+         %39 = OpTypeStruct %38
+         %40 = OpTypePointer Uniform %39
+         %41 = OpVariable %40 Uniform
+         %42 = OpTypePointer Uniform %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %24 = OpVariable %23 Function
+         %19 = OpAccessChain %18 %16 %17 %17
+         %20 = OpLoad %10 %19
+         %21 = OpConvertSToF %6 %20
+         %22 = OpCompositeConstruct %7 %21 %21 %21 %21
+               OpStore %9 %22
+         %25 = OpAccessChain %18 %16 %17 %17
+         %26 = OpLoad %10 %25
+               OpStore %24 %26
+               OpBranch %27
+         %27 = OpLabel
+               OpLoopMerge %29 %30 None
+               OpBranch %31
+         %31 = OpLabel
+         %32 = OpLoad %10 %24
+         %34 = OpAccessChain %18 %16 %17 %33
+         %35 = OpLoad %10 %34
+         %37 = OpSLessThan %36 %32 %35
+               OpBranchConditional %37 %28 %29
+         %28 = OpLabel
+         %43 = OpAccessChain %42 %41 %17 %33
+         %44 = OpLoad %6 %43
+         %45 = OpLoad %10 %24
+         %46 = OpConvertSToF %6 %45
+         %47 = OpFOrdLessThanEqual %36 %44 %46
+         %48 = OpLogicalNot %36 %47
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %49 %50
+         %49 = OpLabel
+         %51 = OpAccessChain %42 %41 %17 %17
+         %52 = OpLoad %6 %51
+         %53 = OpLoad %10 %24
+         %54 = OpConvertSToF %6 %53
+         %55 = OpLoad %10 %24
+         %56 = OpConvertSToF %6 %55
+         %57 = OpAccessChain %42 %41 %17 %17
+         %58 = OpLoad %6 %57
+         %59 = OpCompositeConstruct %7 %52 %54 %56 %58
+         %60 = OpLoad %7 %9
+         %61 = OpFAdd %7 %60 %59
+               OpStore %9 %61
+               OpBranch %50
+         %50 = OpLabel
+               OpBranch %30
+         %30 = OpLabel
+         %62 = OpLoad %10 %24
+         %63 = OpIAdd %10 %62 %33
+               OpStore %24 %63
+               OpBranch %27
+         %29 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 10
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.25
+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-machine-scheduler-for-if-pow.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-machine-scheduler-for-if-pow.amber
new file mode 100644 (file)
index 0000000..99180e0
--- /dev/null
@@ -0,0 +1,300 @@
+#!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 machine scheduler 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_0 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_4_0 _GLF_uniform_float_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[2]
+# #define _float_2_0 _GLF_uniform_float_values[3]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [10, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 4.0, 1.0, 2.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_v1;
+#
+# void main()
+# {
+#     vec2 uv = gl_FragCoord.xy;
+#     vec4 v1 = vec4(_float_0_0);
+#     if (uv.y >= _float_0_0)
+#     {
+#         v1.x = _float_1_0;
+#         v1.y = _float_0_0;
+#         v1.z = _float_0_0;
+#         v1.w = _float_1_0;
+#     }
+#
+#     float a = _float_1_0;
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         // Always false.
+#         if (_float_1_0 < _float_0_0)
+#         {
+#             discard;
+#         }
+#         // a becomes 4.
+#         a = pow(v1.x + v1.y + v1.z + v1.w, _float_2_0);
+#     }
+#
+#     if (a == _float_4_0)
+#     {
+#         _GLF_v1 = v1;
+#     }
+#     else
+#     {
+#         _GLF_v1 = 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" %12 %109
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "uv"
+               OpName %12 "gl_FragCoord"
+               OpName %16 "v1"
+               OpName %20 "buf1"
+               OpMemberName %20 0 "_GLF_uniform_float_values"
+               OpName %22 ""
+               OpName %55 "a"
+               OpName %59 "i"
+               OpName %61 "buf0"
+               OpMemberName %61 0 "_GLF_uniform_int_values"
+               OpName %63 ""
+               OpName %109 "_GLF_v1"
+               OpDecorate %12 BuiltIn FragCoord
+               OpDecorate %19 ArrayStride 16
+               OpMemberDecorate %20 0 Offset 0
+               OpDecorate %20 Block
+               OpDecorate %22 DescriptorSet 0
+               OpDecorate %22 Binding 1
+               OpDecorate %59 RelaxedPrecision
+               OpDecorate %60 ArrayStride 16
+               OpMemberDecorate %61 0 RelaxedPrecision
+               OpMemberDecorate %61 0 Offset 0
+               OpDecorate %61 Block
+               OpDecorate %63 DescriptorSet 0
+               OpDecorate %63 Binding 0
+               OpDecorate %67 RelaxedPrecision
+               OpDecorate %73 RelaxedPrecision
+               OpDecorate %75 RelaxedPrecision
+               OpDecorate %100 RelaxedPrecision
+               OpDecorate %101 RelaxedPrecision
+               OpDecorate %109 Location 0
+               OpDecorate %113 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 2
+          %8 = OpTypePointer Function %7
+         %10 = OpTypeVector %6 4
+         %11 = OpTypePointer Input %10
+         %12 = OpVariable %11 Input
+         %15 = OpTypePointer Function %10
+         %17 = OpTypeInt 32 0
+         %18 = OpConstant %17 4
+         %19 = OpTypeArray %6 %18
+         %20 = OpTypeStruct %19
+         %21 = OpTypePointer Uniform %20
+         %22 = OpVariable %21 Uniform
+         %23 = OpTypeInt 32 1
+         %24 = OpConstant %23 0
+         %25 = OpTypePointer Uniform %6
+         %29 = OpConstant %17 1
+         %30 = OpTypePointer Function %6
+         %35 = OpTypeBool
+         %39 = OpConstant %23 2
+         %42 = OpConstant %17 0
+         %49 = OpConstant %17 2
+         %53 = OpConstant %17 3
+         %58 = OpTypePointer Function %23
+         %60 = OpTypeArray %23 %49
+         %61 = OpTypeStruct %60
+         %62 = OpTypePointer Uniform %61
+         %63 = OpVariable %62 Uniform
+         %64 = OpConstant %23 1
+         %65 = OpTypePointer Uniform %23
+         %96 = OpConstant %23 3
+        %108 = OpTypePointer Output %10
+        %109 = OpVariable %108 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %9 = OpVariable %8 Function
+         %16 = OpVariable %15 Function
+         %55 = OpVariable %30 Function
+         %59 = OpVariable %58 Function
+         %13 = OpLoad %10 %12
+         %14 = OpVectorShuffle %7 %13 %13 0 1
+               OpStore %9 %14
+         %26 = OpAccessChain %25 %22 %24 %24
+         %27 = OpLoad %6 %26
+         %28 = OpCompositeConstruct %10 %27 %27 %27 %27
+               OpStore %16 %28
+         %31 = OpAccessChain %30 %9 %29
+         %32 = OpLoad %6 %31
+         %33 = OpAccessChain %25 %22 %24 %24
+         %34 = OpLoad %6 %33
+         %36 = OpFOrdGreaterThanEqual %35 %32 %34
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %37 %38
+         %37 = OpLabel
+         %40 = OpAccessChain %25 %22 %24 %39
+         %41 = OpLoad %6 %40
+         %43 = OpAccessChain %30 %16 %42
+               OpStore %43 %41
+         %44 = OpAccessChain %25 %22 %24 %24
+         %45 = OpLoad %6 %44
+         %46 = OpAccessChain %30 %16 %29
+               OpStore %46 %45
+         %47 = OpAccessChain %25 %22 %24 %24
+         %48 = OpLoad %6 %47
+         %50 = OpAccessChain %30 %16 %49
+               OpStore %50 %48
+         %51 = OpAccessChain %25 %22 %24 %39
+         %52 = OpLoad %6 %51
+         %54 = OpAccessChain %30 %16 %53
+               OpStore %54 %52
+               OpBranch %38
+         %38 = OpLabel
+         %56 = OpAccessChain %25 %22 %24 %39
+         %57 = OpLoad %6 %56
+               OpStore %55 %57
+         %66 = OpAccessChain %65 %63 %24 %64
+         %67 = OpLoad %23 %66
+               OpStore %59 %67
+               OpBranch %68
+         %68 = OpLabel
+               OpLoopMerge %70 %71 None
+               OpBranch %72
+         %72 = OpLabel
+         %73 = OpLoad %23 %59
+         %74 = OpAccessChain %65 %63 %24 %24
+         %75 = OpLoad %23 %74
+         %76 = OpSLessThan %35 %73 %75
+               OpBranchConditional %76 %69 %70
+         %69 = OpLabel
+         %77 = OpAccessChain %25 %22 %24 %39
+         %78 = OpLoad %6 %77
+         %79 = OpAccessChain %25 %22 %24 %24
+         %80 = OpLoad %6 %79
+         %81 = OpFOrdLessThan %35 %78 %80
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %82 %83
+         %82 = OpLabel
+               OpKill
+         %83 = OpLabel
+         %85 = OpAccessChain %30 %16 %42
+         %86 = OpLoad %6 %85
+         %87 = OpAccessChain %30 %16 %29
+         %88 = OpLoad %6 %87
+         %89 = OpFAdd %6 %86 %88
+         %90 = OpAccessChain %30 %16 %49
+         %91 = OpLoad %6 %90
+         %92 = OpFAdd %6 %89 %91
+         %93 = OpAccessChain %30 %16 %53
+         %94 = OpLoad %6 %93
+         %95 = OpFAdd %6 %92 %94
+         %97 = OpAccessChain %25 %22 %24 %96
+         %98 = OpLoad %6 %97
+         %99 = OpExtInst %6 %1 Pow %95 %98
+               OpStore %55 %99
+               OpBranch %71
+         %71 = OpLabel
+        %100 = OpLoad %23 %59
+        %101 = OpIAdd %23 %100 %64
+               OpStore %59 %101
+               OpBranch %68
+         %70 = OpLabel
+        %102 = OpLoad %6 %55
+        %103 = OpAccessChain %25 %22 %24 %64
+        %104 = OpLoad %6 %103
+        %105 = OpFOrdEqual %35 %102 %104
+               OpSelectionMerge %107 None
+               OpBranchConditional %105 %106 %111
+        %106 = OpLabel
+        %110 = OpLoad %10 %16
+               OpStore %109 %110
+               OpBranch %107
+        %111 = OpLabel
+        %112 = OpAccessChain %65 %63 %24 %64
+        %113 = OpLoad %23 %112
+        %114 = OpConvertSToF %6 %113
+        %115 = OpCompositeConstruct %10 %114 %114 %114 %114
+               OpStore %109 %115
+               OpBranch %107
+        %107 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 4.0 1.0 2.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 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-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard.amber
new file mode 100644 (file)
index 0000000..7bf46aa
--- /dev/null
@@ -0,0 +1,245 @@
+#!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 register coalescer, live intervals and target 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_10 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [10, 0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_v1;
+#
+# void main()
+# {
+#     for (int i = _int_0; i < _int_10; i++)
+#     {
+#         // Always false.
+#         if (_float_0_0 > _float_1_0)
+#         {
+#             discard;
+#         }
+#         for (int j = _int_0; j < _int_10; j++)
+#         {
+#             // Always false.
+#             if (gl_FragCoord.x < _float_0_0)
+#             {
+#                 discard;
+#             }
+#             _GLF_v1 = 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: 90
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %59 %71
+               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 %33 "buf0"
+               OpMemberName %33 0 "_GLF_uniform_float_values"
+               OpName %35 ""
+               OpName %45 "j"
+               OpName %59 "gl_FragCoord"
+               OpName %71 "_GLF_v1"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 1
+               OpDecorate %32 ArrayStride 16
+               OpMemberDecorate %33 0 Offset 0
+               OpDecorate %33 Block
+               OpDecorate %35 DescriptorSet 0
+               OpDecorate %35 Binding 0
+               OpDecorate %59 BuiltIn FragCoord
+               OpDecorate %71 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 = OpTypeFloat 32
+         %31 = OpConstant %9 2
+         %32 = OpTypeArray %30 %31
+         %33 = OpTypeStruct %32
+         %34 = OpTypePointer Uniform %33
+         %35 = OpVariable %34 Uniform
+         %36 = OpTypePointer Uniform %30
+         %57 = OpTypeVector %30 4
+         %58 = OpTypePointer Input %57
+         %59 = OpVariable %58 Input
+         %60 = OpConstant %9 0
+         %61 = OpTypePointer Input %30
+         %70 = OpTypePointer Output %57
+         %71 = OpVariable %70 Output
+         %72 = OpConstant %6 2
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %45 = 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
+         %37 = OpAccessChain %36 %35 %15 %15
+         %38 = OpLoad %30 %37
+         %39 = OpAccessChain %36 %35 %15 %16
+         %40 = OpLoad %30 %39
+         %41 = OpFOrdGreaterThan %28 %38 %40
+               OpSelectionMerge %43 None
+               OpBranchConditional %41 %42 %43
+         %42 = OpLabel
+               OpKill
+         %43 = OpLabel
+         %46 = OpAccessChain %17 %14 %15 %16
+         %47 = OpLoad %6 %46
+               OpStore %45 %47
+               OpBranch %48
+         %48 = OpLabel
+               OpLoopMerge %50 %51 None
+               OpBranch %52
+         %52 = OpLabel
+         %53 = OpLoad %6 %45
+         %54 = OpAccessChain %17 %14 %15 %15
+         %55 = OpLoad %6 %54
+         %56 = OpSLessThan %28 %53 %55
+               OpBranchConditional %56 %49 %50
+         %49 = OpLabel
+         %62 = OpAccessChain %61 %59 %60
+         %63 = OpLoad %30 %62
+         %64 = OpAccessChain %36 %35 %15 %15
+         %65 = OpLoad %30 %64
+         %66 = OpFOrdLessThan %28 %63 %65
+               OpSelectionMerge %68 None
+               OpBranchConditional %66 %67 %68
+         %67 = OpLabel
+               OpKill
+         %68 = OpLabel
+         %73 = OpAccessChain %17 %14 %15 %72
+         %74 = OpLoad %6 %73
+         %75 = OpConvertSToF %30 %74
+         %76 = OpAccessChain %17 %14 %15 %16
+         %77 = OpLoad %6 %76
+         %78 = OpConvertSToF %30 %77
+         %79 = OpAccessChain %17 %14 %15 %16
+         %80 = OpLoad %6 %79
+         %81 = OpConvertSToF %30 %80
+         %82 = OpAccessChain %17 %14 %15 %72
+         %83 = OpLoad %6 %82
+         %84 = OpConvertSToF %30 %83
+         %85 = OpCompositeConstruct %57 %75 %78 %81 %84
+               OpStore %71 %85
+               OpBranch %51
+         %51 = OpLabel
+         %86 = OpLoad %6 %45
+         %87 = OpIAdd %6 %86 %16
+               OpStore %45 %87
+               OpBranch %48
+         %50 = OpLabel
+               OpBranch %23
+         %23 = OpLabel
+         %88 = OpLoad %6 %8
+         %89 = OpIAdd %6 %88 %16
+               OpStore %8 %89
+               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
+ 10 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-scaled-number-nested-loops-array-access.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-scaled-number-nested-loops-array-access.amber
new file mode 100644 (file)
index 0000000..d847094
--- /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 covers a specific scaled number 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_12 _GLF_uniform_int_values[3]
+# #define _int_4 _GLF_uniform_int_values[4]
+# #define _int_8 _GLF_uniform_int_values[5]
+# #define _int_3 _GLF_uniform_int_values[6]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_6912_0 _GLF_uniform_float_values[1]
+# #define _float_1_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [2, 0, 1, 12, 4, 8, 3]
+# layout(set = 0, binding = 0) uniform buf0 {
+#     int _GLF_uniform_int_values[7];
+# };
+# // Contents of _GLF_uniform_float_values: [0.0, 6912.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 sums[2];
+#     sums[_int_0] = _float_0_0;
+#     sums[_int_1] = _float_0_0;
+#
+#     for(int a = _int_0; a < _int_2; a ++)
+#         for(int b = _int_8; b < _int_12; b ++) // Loops 4 times.
+#             for(int c = _int_3; c <= _int_4; c ++) // Loops 2 times.
+#                 for(int d = _int_0; d < _int_3; d ++) // Loops 3 times.
+#                     for(int e = _int_2; e <= _int_4; e ++) // Loops 3 times.
+#                         for(int f = _int_0; f < _int_2; f ++) // Loops 2 times.
+#                             for(int g = _int_0; g < _int_3; g ++) // Loops 3 times.
+#                                 for(int h = _int_0; h < _int_2; h ++) // Loops 2 times.
+#                                     for(int i = _int_0; i < _int_4; i ++) // Loops 4 times.
+#                                         for(int j = _int_2; j > _int_0; j --) // Loops 2 times.
+#                                         {
+#                                             sums[a] += _float_1_0;
+#                                         }
+#
+#     if(sums[_int_0] == _float_6912_0 && sums[_int_1] == _float_6912_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: 232
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %213
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "sums"
+               OpName %15 "buf0"
+               OpMemberName %15 0 "_GLF_uniform_int_values"
+               OpName %17 ""
+               OpName %25 "buf1"
+               OpMemberName %25 0 "_GLF_uniform_float_values"
+               OpName %27 ""
+               OpName %40 "a"
+               OpName %53 "b"
+               OpName %67 "c"
+               OpName %81 "d"
+               OpName %93 "e"
+               OpName %105 "f"
+               OpName %117 "g"
+               OpName %129 "h"
+               OpName %141 "i"
+               OpName %153 "j"
+               OpName %213 "_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 0
+               OpDecorate %22 RelaxedPrecision
+               OpDecorate %24 ArrayStride 16
+               OpMemberDecorate %25 0 Offset 0
+               OpDecorate %25 Block
+               OpDecorate %27 DescriptorSet 0
+               OpDecorate %27 Binding 1
+               OpDecorate %35 RelaxedPrecision
+               OpDecorate %40 RelaxedPrecision
+               OpDecorate %42 RelaxedPrecision
+               OpDecorate %48 RelaxedPrecision
+               OpDecorate %50 RelaxedPrecision
+               OpDecorate %53 RelaxedPrecision
+               OpDecorate %56 RelaxedPrecision
+               OpDecorate %62 RelaxedPrecision
+               OpDecorate %65 RelaxedPrecision
+               OpDecorate %67 RelaxedPrecision
+               OpDecorate %70 RelaxedPrecision
+               OpDecorate %76 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 %165 RelaxedPrecision
+               OpDecorate %172 RelaxedPrecision
+               OpDecorate %173 RelaxedPrecision
+               OpDecorate %174 RelaxedPrecision
+               OpDecorate %175 RelaxedPrecision
+               OpDecorate %176 RelaxedPrecision
+               OpDecorate %177 RelaxedPrecision
+               OpDecorate %178 RelaxedPrecision
+               OpDecorate %179 RelaxedPrecision
+               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 %193 RelaxedPrecision
+               OpDecorate %202 RelaxedPrecision
+               OpDecorate %213 Location 0
+               OpDecorate %215 RelaxedPrecision
+               OpDecorate %218 RelaxedPrecision
+               OpDecorate %221 RelaxedPrecision
+               OpDecorate %224 RelaxedPrecision
+               OpDecorate %229 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 7
+         %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
+         %31 = OpTypePointer Function %6
+         %33 = OpConstant %12 2
+         %39 = OpTypePointer Function %12
+         %51 = OpTypeBool
+         %54 = OpConstant %12 5
+         %63 = OpConstant %12 3
+         %68 = OpConstant %12 6
+         %77 = OpConstant %12 4
+        %211 = OpTypeVector %6 4
+        %212 = OpTypePointer Output %211
+        %213 = OpVariable %212 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %11 = OpVariable %10 Function
+         %40 = OpVariable %39 Function
+         %53 = OpVariable %39 Function
+         %67 = OpVariable %39 Function
+         %81 = OpVariable %39 Function
+         %93 = OpVariable %39 Function
+        %105 = OpVariable %39 Function
+        %117 = OpVariable %39 Function
+        %129 = OpVariable %39 Function
+        %141 = OpVariable %39 Function
+        %153 = OpVariable %39 Function
+         %21 = OpAccessChain %20 %17 %18 %19
+         %22 = OpLoad %12 %21
+         %29 = OpAccessChain %28 %27 %18 %18
+         %30 = OpLoad %6 %29
+         %32 = OpAccessChain %31 %11 %22
+               OpStore %32 %30
+         %34 = OpAccessChain %20 %17 %18 %33
+         %35 = OpLoad %12 %34
+         %36 = OpAccessChain %28 %27 %18 %18
+         %37 = OpLoad %6 %36
+         %38 = OpAccessChain %31 %11 %35
+               OpStore %38 %37
+         %41 = OpAccessChain %20 %17 %18 %19
+         %42 = OpLoad %12 %41
+               OpStore %40 %42
+               OpBranch %43
+         %43 = OpLabel
+               OpLoopMerge %45 %46 None
+               OpBranch %47
+         %47 = OpLabel
+         %48 = OpLoad %12 %40
+         %49 = OpAccessChain %20 %17 %18 %18
+         %50 = OpLoad %12 %49
+         %52 = OpSLessThan %51 %48 %50
+               OpBranchConditional %52 %44 %45
+         %44 = OpLabel
+         %55 = OpAccessChain %20 %17 %18 %54
+         %56 = OpLoad %12 %55
+               OpStore %53 %56
+               OpBranch %57
+         %57 = OpLabel
+               OpLoopMerge %59 %60 None
+               OpBranch %61
+         %61 = OpLabel
+         %62 = OpLoad %12 %53
+         %64 = OpAccessChain %20 %17 %18 %63
+         %65 = OpLoad %12 %64
+         %66 = OpSLessThan %51 %62 %65
+               OpBranchConditional %66 %58 %59
+         %58 = OpLabel
+         %69 = OpAccessChain %20 %17 %18 %68
+         %70 = OpLoad %12 %69
+               OpStore %67 %70
+               OpBranch %71
+         %71 = OpLabel
+               OpLoopMerge %73 %74 None
+               OpBranch %75
+         %75 = OpLabel
+         %76 = OpLoad %12 %67
+         %78 = OpAccessChain %20 %17 %18 %77
+         %79 = OpLoad %12 %78
+         %80 = OpSLessThanEqual %51 %76 %79
+               OpBranchConditional %80 %72 %73
+         %72 = OpLabel
+         %82 = OpAccessChain %20 %17 %18 %19
+         %83 = OpLoad %12 %82
+               OpStore %81 %83
+               OpBranch %84
+         %84 = OpLabel
+               OpLoopMerge %86 %87 None
+               OpBranch %88
+         %88 = OpLabel
+         %89 = OpLoad %12 %81
+         %90 = OpAccessChain %20 %17 %18 %68
+         %91 = OpLoad %12 %90
+         %92 = OpSLessThan %51 %89 %91
+               OpBranchConditional %92 %85 %86
+         %85 = OpLabel
+         %94 = OpAccessChain %20 %17 %18 %18
+         %95 = OpLoad %12 %94
+               OpStore %93 %95
+               OpBranch %96
+         %96 = OpLabel
+               OpLoopMerge %98 %99 None
+               OpBranch %100
+        %100 = OpLabel
+        %101 = OpLoad %12 %93
+        %102 = OpAccessChain %20 %17 %18 %77
+        %103 = OpLoad %12 %102
+        %104 = OpSLessThanEqual %51 %101 %103
+               OpBranchConditional %104 %97 %98
+         %97 = OpLabel
+        %106 = OpAccessChain %20 %17 %18 %19
+        %107 = OpLoad %12 %106
+               OpStore %105 %107
+               OpBranch %108
+        %108 = OpLabel
+               OpLoopMerge %110 %111 None
+               OpBranch %112
+        %112 = OpLabel
+        %113 = OpLoad %12 %105
+        %114 = OpAccessChain %20 %17 %18 %18
+        %115 = OpLoad %12 %114
+        %116 = OpSLessThan %51 %113 %115
+               OpBranchConditional %116 %109 %110
+        %109 = OpLabel
+        %118 = OpAccessChain %20 %17 %18 %19
+        %119 = OpLoad %12 %118
+               OpStore %117 %119
+               OpBranch %120
+        %120 = OpLabel
+               OpLoopMerge %122 %123 None
+               OpBranch %124
+        %124 = OpLabel
+        %125 = OpLoad %12 %117
+        %126 = OpAccessChain %20 %17 %18 %68
+        %127 = OpLoad %12 %126
+        %128 = OpSLessThan %51 %125 %127
+               OpBranchConditional %128 %121 %122
+        %121 = OpLabel
+        %130 = OpAccessChain %20 %17 %18 %19
+        %131 = OpLoad %12 %130
+               OpStore %129 %131
+               OpBranch %132
+        %132 = OpLabel
+               OpLoopMerge %134 %135 None
+               OpBranch %136
+        %136 = OpLabel
+        %137 = OpLoad %12 %129
+        %138 = OpAccessChain %20 %17 %18 %18
+        %139 = OpLoad %12 %138
+        %140 = OpSLessThan %51 %137 %139
+               OpBranchConditional %140 %133 %134
+        %133 = OpLabel
+        %142 = OpAccessChain %20 %17 %18 %19
+        %143 = OpLoad %12 %142
+               OpStore %141 %143
+               OpBranch %144
+        %144 = OpLabel
+               OpLoopMerge %146 %147 None
+               OpBranch %148
+        %148 = OpLabel
+        %149 = OpLoad %12 %141
+        %150 = OpAccessChain %20 %17 %18 %77
+        %151 = OpLoad %12 %150
+        %152 = OpSLessThan %51 %149 %151
+               OpBranchConditional %152 %145 %146
+        %145 = OpLabel
+        %154 = OpAccessChain %20 %17 %18 %18
+        %155 = OpLoad %12 %154
+               OpStore %153 %155
+               OpBranch %156
+        %156 = OpLabel
+               OpLoopMerge %158 %159 None
+               OpBranch %160
+        %160 = OpLabel
+        %161 = OpLoad %12 %153
+        %162 = OpAccessChain %20 %17 %18 %19
+        %163 = OpLoad %12 %162
+        %164 = OpSGreaterThan %51 %161 %163
+               OpBranchConditional %164 %157 %158
+        %157 = OpLabel
+        %165 = OpLoad %12 %40
+        %166 = OpAccessChain %28 %27 %18 %33
+        %167 = OpLoad %6 %166
+        %168 = OpAccessChain %31 %11 %165
+        %169 = OpLoad %6 %168
+        %170 = OpFAdd %6 %169 %167
+        %171 = OpAccessChain %31 %11 %165
+               OpStore %171 %170
+               OpBranch %159
+        %159 = OpLabel
+        %172 = OpLoad %12 %153
+        %173 = OpISub %12 %172 %19
+               OpStore %153 %173
+               OpBranch %156
+        %158 = OpLabel
+               OpBranch %147
+        %147 = OpLabel
+        %174 = OpLoad %12 %141
+        %175 = OpIAdd %12 %174 %19
+               OpStore %141 %175
+               OpBranch %144
+        %146 = OpLabel
+               OpBranch %135
+        %135 = OpLabel
+        %176 = OpLoad %12 %129
+        %177 = OpIAdd %12 %176 %19
+               OpStore %129 %177
+               OpBranch %132
+        %134 = OpLabel
+               OpBranch %123
+        %123 = OpLabel
+        %178 = OpLoad %12 %117
+        %179 = OpIAdd %12 %178 %19
+               OpStore %117 %179
+               OpBranch %120
+        %122 = OpLabel
+               OpBranch %111
+        %111 = OpLabel
+        %180 = OpLoad %12 %105
+        %181 = OpIAdd %12 %180 %19
+               OpStore %105 %181
+               OpBranch %108
+        %110 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %182 = OpLoad %12 %93
+        %183 = OpIAdd %12 %182 %19
+               OpStore %93 %183
+               OpBranch %96
+         %98 = OpLabel
+               OpBranch %87
+         %87 = OpLabel
+        %184 = OpLoad %12 %81
+        %185 = OpIAdd %12 %184 %19
+               OpStore %81 %185
+               OpBranch %84
+         %86 = OpLabel
+               OpBranch %74
+         %74 = OpLabel
+        %186 = OpLoad %12 %67
+        %187 = OpIAdd %12 %186 %19
+               OpStore %67 %187
+               OpBranch %71
+         %73 = OpLabel
+               OpBranch %60
+         %60 = OpLabel
+        %188 = OpLoad %12 %53
+        %189 = OpIAdd %12 %188 %19
+               OpStore %53 %189
+               OpBranch %57
+         %59 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+        %190 = OpLoad %12 %40
+        %191 = OpIAdd %12 %190 %19
+               OpStore %40 %191
+               OpBranch %43
+         %45 = OpLabel
+        %192 = OpAccessChain %20 %17 %18 %19
+        %193 = OpLoad %12 %192
+        %194 = OpAccessChain %31 %11 %193
+        %195 = OpLoad %6 %194
+        %196 = OpAccessChain %28 %27 %18 %19
+        %197 = OpLoad %6 %196
+        %198 = OpFOrdEqual %51 %195 %197
+               OpSelectionMerge %200 None
+               OpBranchConditional %198 %199 %200
+        %199 = OpLabel
+        %201 = OpAccessChain %20 %17 %18 %33
+        %202 = OpLoad %12 %201
+        %203 = OpAccessChain %31 %11 %202
+        %204 = OpLoad %6 %203
+        %205 = OpAccessChain %28 %27 %18 %19
+        %206 = OpLoad %6 %205
+        %207 = OpFOrdEqual %51 %204 %206
+               OpBranch %200
+        %200 = OpLabel
+        %208 = OpPhi %51 %198 %45 %207 %199
+               OpSelectionMerge %210 None
+               OpBranchConditional %208 %209 %227
+        %209 = OpLabel
+        %214 = OpAccessChain %20 %17 %18 %33
+        %215 = OpLoad %12 %214
+        %216 = OpConvertSToF %6 %215
+        %217 = OpAccessChain %20 %17 %18 %19
+        %218 = OpLoad %12 %217
+        %219 = OpConvertSToF %6 %218
+        %220 = OpAccessChain %20 %17 %18 %19
+        %221 = OpLoad %12 %220
+        %222 = OpConvertSToF %6 %221
+        %223 = OpAccessChain %20 %17 %18 %33
+        %224 = OpLoad %12 %223
+        %225 = OpConvertSToF %6 %224
+        %226 = OpCompositeConstruct %211 %216 %219 %222 %225
+               OpStore %213 %226
+               OpBranch %210
+        %227 = OpLabel
+        %228 = OpAccessChain %20 %17 %18 %19
+        %229 = OpLoad %12 %228
+        %230 = OpConvertSToF %6 %229
+        %231 = OpCompositeConstruct %211 %230 %230 %230 %230
+               OpStore %213 %231
+               OpBranch %210
+        %210 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 6912.0 1.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 2 0 1 12 4 8 3
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 16 16
+  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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-simplify-for-bitwise-condition.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-simplify-for-bitwise-condition.amber
new file mode 100644 (file)
index 0000000..58d0e06
--- /dev/null
@@ -0,0 +1,193 @@
+#!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.
+
+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()
+# {
+#     int a = _int_0;
+#     for (int i = -_int_1; (i | _int_1) < _int_1; i++)
+#     {
+#         a = i * _int_1;
+#     }
+#
+#     if (a == -_int_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: 71
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %53
+               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 %53 "_GLF_color"
+               OpDecorate %11 ArrayStride 16
+               OpMemberDecorate %12 0 Offset 0
+               OpDecorate %12 Block
+               OpDecorate %14 DescriptorSet 0
+               OpDecorate %14 Binding 0
+               OpDecorate %53 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %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 = OpConstant %6 0
+         %16 = OpConstant %6 1
+         %17 = OpTypePointer Uniform %6
+         %35 = OpTypeBool
+         %50 = OpTypeFloat 32
+         %51 = OpTypeVector %50 4
+         %52 = OpTypePointer Output %51
+         %53 = OpVariable %52 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %20 = OpVariable %7 Function
+         %18 = OpAccessChain %17 %14 %15 %16
+         %19 = OpLoad %6 %18
+               OpStore %8 %19
+         %21 = OpAccessChain %17 %14 %15 %15
+         %22 = OpLoad %6 %21
+         %23 = OpSNegate %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
+         %32 = OpBitwiseOr %6 %29 %31
+         %33 = OpAccessChain %17 %14 %15 %15
+         %34 = OpLoad %6 %33
+         %36 = OpSLessThan %35 %32 %34
+               OpBranchConditional %36 %25 %26
+         %25 = OpLabel
+         %37 = OpLoad %6 %20
+         %38 = OpAccessChain %17 %14 %15 %15
+         %39 = OpLoad %6 %38
+         %40 = OpIMul %6 %37 %39
+               OpStore %8 %40
+               OpBranch %27
+         %27 = OpLabel
+         %41 = OpLoad %6 %20
+         %42 = OpIAdd %6 %41 %16
+               OpStore %20 %42
+               OpBranch %24
+         %26 = OpLabel
+         %43 = OpLoad %6 %8
+         %44 = OpAccessChain %17 %14 %15 %15
+         %45 = OpLoad %6 %44
+         %46 = OpSNegate %6 %45
+         %47 = OpIEqual %35 %43 %46
+               OpSelectionMerge %49 None
+               OpBranchConditional %47 %48 %67
+         %48 = OpLabel
+         %54 = OpAccessChain %17 %14 %15 %15
+         %55 = OpLoad %6 %54
+         %56 = OpConvertSToF %50 %55
+         %57 = OpAccessChain %17 %14 %15 %16
+         %58 = OpLoad %6 %57
+         %59 = OpConvertSToF %50 %58
+         %60 = OpAccessChain %17 %14 %15 %16
+         %61 = OpLoad %6 %60
+         %62 = OpConvertSToF %50 %61
+         %63 = OpAccessChain %17 %14 %15 %15
+         %64 = OpLoad %6 %63
+         %65 = OpConvertSToF %50 %64
+         %66 = OpCompositeConstruct %51 %56 %59 %62 %65
+               OpStore %53 %66
+               OpBranch %49
+         %67 = OpLabel
+         %68 = OpLoad %6 %8
+         %69 = OpConvertSToF %50 %68
+         %70 = OpCompositeConstruct %51 %69 %69 %69 %69
+               OpStore %53 %70
+               OpBranch %49
+         %49 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-simplify-right-shift-greater-than-zero.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-simplify-right-shift-greater-than-zero.amber
new file mode 100644 (file)
index 0000000..d665a7d
--- /dev/null
@@ -0,0 +1,150 @@
+#!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 specific instruction simplify and combine compare 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]
+#
+# 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()
+# {
+#     if ((1 >> _int_0) > 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: 45
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %26
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %11 "buf0"
+               OpMemberName %11 0 "_GLF_uniform_int_values"
+               OpName %13 ""
+               OpName %26 "_GLF_color"
+               OpDecorate %10 ArrayStride 16
+               OpMemberDecorate %11 0 Offset 0
+               OpDecorate %11 Block
+               OpDecorate %13 DescriptorSet 0
+               OpDecorate %13 Binding 0
+               OpDecorate %26 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpConstant %6 1
+          %8 = OpTypeInt 32 0
+          %9 = OpConstant %8 2
+         %10 = OpTypeArray %6 %9
+         %11 = OpTypeStruct %10
+         %12 = OpTypePointer Uniform %11
+         %13 = OpVariable %12 Uniform
+         %14 = OpConstant %6 0
+         %15 = OpTypePointer Uniform %6
+         %19 = OpTypeBool
+         %23 = OpTypeFloat 32
+         %24 = OpTypeVector %23 4
+         %25 = OpTypePointer Output %24
+         %26 = OpVariable %25 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %16 = OpAccessChain %15 %13 %14 %14
+         %17 = OpLoad %6 %16
+         %18 = OpShiftRightArithmetic %6 %7 %17
+         %20 = OpSGreaterThan %19 %18 %14
+               OpSelectionMerge %22 None
+               OpBranchConditional %20 %21 %40
+         %21 = OpLabel
+         %27 = OpAccessChain %15 %13 %14 %7
+         %28 = OpLoad %6 %27
+         %29 = OpConvertSToF %23 %28
+         %30 = OpAccessChain %15 %13 %14 %14
+         %31 = OpLoad %6 %30
+         %32 = OpConvertSToF %23 %31
+         %33 = OpAccessChain %15 %13 %14 %14
+         %34 = OpLoad %6 %33
+         %35 = OpConvertSToF %23 %34
+         %36 = OpAccessChain %15 %13 %14 %7
+         %37 = OpLoad %6 %36
+         %38 = OpConvertSToF %23 %37
+         %39 = OpCompositeConstruct %24 %29 %32 %35 %38
+               OpStore %26 %39
+               OpBranch %22
+         %40 = OpLabel
+         %41 = OpAccessChain %15 %13 %14 %14
+         %42 = OpLoad %6 %41
+         %43 = OpConvertSToF %23 %42
+         %44 = OpCompositeConstruct %24 %43 %43 %43 %43
+               OpStore %26 %44
+               OpBranch %22
+         %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
+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-tail-duplicator-for-for-for.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-tail-duplicator-for-for-for.amber
new file mode 100644 (file)
index 0000000..66614f2
--- /dev/null
@@ -0,0 +1,265 @@
+#!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 tail duplicator 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_4 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: 0
+# layout(set = 0, binding = 0) uniform buf0
+# {
+#     int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: 0.0
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     vec4 color = vec4(1.0);
+#
+#     for (int i = _int_0; i < _int_4; i++)
+#     {
+#         switch (i)
+#         {
+#             case 1:
+#                 // Never entered.
+#                 for (int j = _int_0; i > i; j++)
+#                 {
+#                     for (int k = _int_0; k < i; k++)
+#                     {
+#                         color[k] = _float_0_0;
+#                     }
+#                 }
+#
+#                 color[i] = _float_0_0;
+#                 break;
+#
+#             case 2:
+#                 color[i] = _float_0_0;
+#                 break;
+#         }
+#     }
+#
+#     _GLF_color = color;
+# }
+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" %91
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "color"
+               OpName %14 "i"
+               OpName %18 "buf0"
+               OpMemberName %18 0 "_GLF_uniform_int_values"
+               OpName %20 ""
+               OpName %40 "j"
+               OpName %51 "k"
+               OpName %65 "buf1"
+               OpMemberName %65 0 "_GLF_uniform_float_values"
+               OpName %67 ""
+               OpName %91 "_GLF_color"
+               OpDecorate %17 ArrayStride 16
+               OpMemberDecorate %18 0 Offset 0
+               OpDecorate %18 Block
+               OpDecorate %20 DescriptorSet 0
+               OpDecorate %20 Binding 0
+               OpDecorate %64 ArrayStride 16
+               OpMemberDecorate %65 0 Offset 0
+               OpDecorate %65 Block
+               OpDecorate %67 DescriptorSet 0
+               OpDecorate %67 Binding 1
+               OpDecorate %91 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Function %7
+         %10 = OpConstant %6 1
+         %11 = OpConstantComposite %7 %10 %10 %10 %10
+         %12 = OpTypeInt 32 1
+         %13 = OpTypePointer Function %12
+         %15 = OpTypeInt 32 0
+         %16 = OpConstant %15 2
+         %17 = OpTypeArray %12 %16
+         %18 = OpTypeStruct %17
+         %19 = OpTypePointer Uniform %18
+         %20 = OpVariable %19 Uniform
+         %21 = OpConstant %12 0
+         %22 = OpTypePointer Uniform %12
+         %31 = OpConstant %12 1
+         %34 = OpTypeBool
+         %63 = OpConstant %15 1
+         %64 = OpTypeArray %6 %63
+         %65 = OpTypeStruct %64
+         %66 = OpTypePointer Uniform %65
+         %67 = OpVariable %66 Uniform
+         %68 = OpTypePointer Uniform %6
+         %71 = OpTypePointer Function %6
+         %90 = OpTypePointer Output %7
+         %91 = OpVariable %90 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %9 = OpVariable %8 Function
+         %14 = OpVariable %13 Function
+         %40 = OpVariable %13 Function
+         %51 = OpVariable %13 Function
+               OpStore %9 %11
+         %23 = OpAccessChain %22 %20 %21 %21
+         %24 = OpLoad %12 %23
+               OpStore %14 %24
+               OpBranch %25
+         %25 = OpLabel
+               OpLoopMerge %27 %28 None
+               OpBranch %29
+         %29 = OpLabel
+         %30 = OpLoad %12 %14
+         %32 = OpAccessChain %22 %20 %21 %31
+         %33 = OpLoad %12 %32
+         %35 = OpSLessThan %34 %30 %33
+               OpBranchConditional %35 %26 %27
+         %26 = OpLabel
+         %36 = OpLoad %12 %14
+               OpSelectionMerge %39 None
+               OpSwitch %36 %39 1 %37 2 %38
+         %37 = OpLabel
+         %41 = OpAccessChain %22 %20 %21 %21
+         %42 = OpLoad %12 %41
+               OpStore %40 %42
+               OpBranch %43
+         %43 = OpLabel
+               OpLoopMerge %45 %46 None
+               OpBranch %47
+         %47 = OpLabel
+         %48 = OpLoad %12 %14
+         %49 = OpLoad %12 %14
+         %50 = OpSGreaterThan %34 %48 %49
+               OpBranchConditional %50 %44 %45
+         %44 = OpLabel
+         %52 = OpAccessChain %22 %20 %21 %21
+         %53 = OpLoad %12 %52
+               OpStore %51 %53
+               OpBranch %54
+         %54 = OpLabel
+               OpLoopMerge %56 %57 None
+               OpBranch %58
+         %58 = OpLabel
+         %59 = OpLoad %12 %51
+         %60 = OpLoad %12 %14
+         %61 = OpSLessThan %34 %59 %60
+               OpBranchConditional %61 %55 %56
+         %55 = OpLabel
+         %62 = OpLoad %12 %51
+         %69 = OpAccessChain %68 %67 %21 %21
+         %70 = OpLoad %6 %69
+         %72 = OpAccessChain %71 %9 %62
+               OpStore %72 %70
+               OpBranch %57
+         %57 = OpLabel
+         %73 = OpLoad %12 %51
+         %74 = OpIAdd %12 %73 %31
+               OpStore %51 %74
+               OpBranch %54
+         %56 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %75 = OpLoad %12 %40
+         %76 = OpIAdd %12 %75 %31
+               OpStore %40 %76
+               OpBranch %43
+         %45 = OpLabel
+         %77 = OpLoad %12 %14
+         %78 = OpAccessChain %68 %67 %21 %21
+         %79 = OpLoad %6 %78
+         %80 = OpAccessChain %71 %9 %77
+               OpStore %80 %79
+               OpBranch %39
+         %38 = OpLabel
+         %82 = OpLoad %12 %14
+         %83 = OpAccessChain %68 %67 %21 %21
+         %84 = OpLoad %6 %83
+         %85 = OpAccessChain %71 %9 %82
+               OpStore %85 %84
+               OpBranch %39
+         %39 = OpLabel
+               OpBranch %28
+         %28 = OpLabel
+         %88 = OpLoad %12 %14
+         %89 = OpIAdd %12 %88 %31
+               OpStore %14 %89
+               OpBranch %25
+         %27 = OpLabel
+         %92 = OpLoad %7 %9
+               OpStore %91 %92
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 4
+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 0
+  BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+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-x86-isel-lowering-machine-value-type-uint-to-float.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-x86-isel-lowering-machine-value-type-uint-to-float.amber
new file mode 100644 (file)
index 0000000..751206e
--- /dev/null
@@ -0,0 +1,225 @@
+#!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 specific X86 ISel lowering and machine value type 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 _uint_1 _GLF_uniform_uint_values[0]
+# #define _uint_0 _GLF_uniform_uint_values[1]
+# #define _float_0_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_uint_values: 1
+# layout(set = 0, binding = 1) uniform buf1
+# {
+#     uint _GLF_uniform_uint_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: 0.0
+# layout(set = 0, binding = 2) uniform buf2
+# {
+#     float _GLF_uniform_float_values[1];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#     uint a = _uint_1 >> uint(_float_0_0);
+#     float b = uintBitsToFloat(a);
+#     uint c = floatBitsToUint(b);
+#
+#     if (c == _uint_1)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(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: 69
+; 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 %11 "buf1"
+               OpMemberName %11 0 "_GLF_uniform_uint_values"
+               OpName %13 ""
+               OpName %22 "buf2"
+               OpMemberName %22 0 "_GLF_uniform_float_values"
+               OpName %24 ""
+               OpName %31 "b"
+               OpName %34 "c"
+               OpName %46 "_GLF_color"
+               OpName %48 "buf0"
+               OpMemberName %48 0 "_GLF_uniform_int_values"
+               OpName %50 ""
+               OpDecorate %10 ArrayStride 16
+               OpMemberDecorate %11 0 Offset 0
+               OpDecorate %11 Block
+               OpDecorate %13 DescriptorSet 0
+               OpDecorate %13 Binding 1
+               OpDecorate %21 ArrayStride 16
+               OpMemberDecorate %22 0 Offset 0
+               OpDecorate %22 Block
+               OpDecorate %24 DescriptorSet 0
+               OpDecorate %24 Binding 2
+               OpDecorate %46 Location 0
+               OpDecorate %47 ArrayStride 16
+               OpMemberDecorate %48 0 Offset 0
+               OpDecorate %48 Block
+               OpDecorate %50 DescriptorSet 0
+               OpDecorate %50 Binding 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 0
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 2
+         %10 = OpTypeArray %6 %9
+         %11 = OpTypeStruct %10
+         %12 = OpTypePointer Uniform %11
+         %13 = OpVariable %12 Uniform
+         %14 = OpTypeInt 32 1
+         %15 = OpConstant %14 0
+         %16 = OpTypePointer Uniform %6
+         %19 = OpTypeFloat 32
+         %20 = OpConstant %6 1
+         %21 = OpTypeArray %19 %20
+         %22 = OpTypeStruct %21
+         %23 = OpTypePointer Uniform %22
+         %24 = OpVariable %23 Uniform
+         %25 = OpTypePointer Uniform %19
+         %30 = OpTypePointer Function %19
+         %40 = OpTypeBool
+         %44 = OpTypeVector %19 4
+         %45 = OpTypePointer Output %44
+         %46 = OpVariable %45 Output
+         %47 = OpTypeArray %14 %9
+         %48 = OpTypeStruct %47
+         %49 = OpTypePointer Uniform %48
+         %50 = OpVariable %49 Uniform
+         %51 = OpTypePointer Uniform %14
+         %55 = OpConstant %14 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %31 = OpVariable %30 Function
+         %34 = OpVariable %7 Function
+         %17 = OpAccessChain %16 %13 %15 %15
+         %18 = OpLoad %6 %17
+         %26 = OpAccessChain %25 %24 %15 %15
+         %27 = OpLoad %19 %26
+         %28 = OpConvertFToU %6 %27
+         %29 = OpShiftRightLogical %6 %18 %28
+               OpStore %8 %29
+         %32 = OpLoad %6 %8
+         %33 = OpBitcast %19 %32
+               OpStore %31 %33
+         %35 = OpLoad %19 %31
+         %36 = OpBitcast %6 %35
+               OpStore %34 %36
+         %37 = OpLoad %6 %34
+         %38 = OpAccessChain %16 %13 %15 %15
+         %39 = OpLoad %6 %38
+         %41 = OpIEqual %40 %37 %39
+               OpSelectionMerge %43 None
+               OpBranchConditional %41 %42 %66
+         %42 = OpLabel
+         %52 = OpAccessChain %51 %50 %15 %15
+         %53 = OpLoad %14 %52
+         %54 = OpConvertSToF %19 %53
+         %56 = OpAccessChain %51 %50 %15 %55
+         %57 = OpLoad %14 %56
+         %58 = OpConvertSToF %19 %57
+         %59 = OpAccessChain %51 %50 %15 %55
+         %60 = OpLoad %14 %59
+         %61 = OpConvertSToF %19 %60
+         %62 = OpAccessChain %51 %50 %15 %15
+         %63 = OpLoad %14 %62
+         %64 = OpConvertSToF %19 %63
+         %65 = OpCompositeConstruct %44 %54 %58 %61 %64
+               OpStore %46 %65
+               OpBranch %43
+         %66 = OpLabel
+         %67 = OpLoad %19 %31
+         %68 = OpCompositeConstruct %44 %67 %67 %67 %67
+               OpStore %46 %68
+               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
+ 0.0
+END
+# _GLF_uniform_uint_values
+BUFFER variant__GLF_uniform_uint_values DATA_TYPE int32[] 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_float_values AS uniform DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER variant__GLF_uniform_uint_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-x86-isel-lowering-selection-dag-struct-array-clamp-index.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-x86-isel-lowering-selection-dag-struct-array-clamp-index.amber
new file mode 100644 (file)
index 0000000..c73b000
--- /dev/null
@@ -0,0 +1,224 @@
+#!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 a specific X86 ISel lowering and DAG selection 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]
+#
+# 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;
+#
+# struct S {
+#     int a;
+#     int b;
+#     int c;
+# };
+#
+# void main()
+# {
+#     S A[2];
+#
+#     A[_int_0] = S(_int_0, _int_0, _int_0);
+#     A[_int_1] = S(_int_0, _int_0, _int_0);
+#
+#     // Always true.
+#     if (A[_int_0].b == _int_0)
+#     {
+#         // A[1].b becomes 1.
+#         A[clamp(_int_0, 1, 2)].b = _int_1;
+#     }
+#
+#     if (A[_int_1].b == _int_1)
+#     {
+#         _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#     }
+#     else
+#     {
+#         _GLF_color = vec4(_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: 90
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %71
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %7 "S"
+               OpMemberName %7 0 "a"
+               OpMemberName %7 1 "b"
+               OpMemberName %7 2 "c"
+               OpName %12 "A"
+               OpName %14 "buf0"
+               OpMemberName %14 0 "_GLF_uniform_int_values"
+               OpName %16 ""
+               OpName %71 "_GLF_color"
+               OpDecorate %13 ArrayStride 16
+               OpMemberDecorate %14 0 Offset 0
+               OpDecorate %14 Block
+               OpDecorate %16 DescriptorSet 0
+               OpDecorate %16 Binding 0
+               OpDecorate %71 Location 0
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypeStruct %6 %6 %6
+          %8 = OpTypeInt 32 0
+          %9 = OpConstant %8 2
+         %10 = OpTypeArray %7 %9
+         %11 = OpTypePointer Function %10
+         %13 = OpTypeArray %6 %9
+         %14 = OpTypeStruct %13
+         %15 = OpTypePointer Uniform %14
+         %16 = OpVariable %15 Uniform
+         %17 = OpConstant %6 0
+         %18 = OpConstant %6 1
+         %19 = OpTypePointer Uniform %6
+         %29 = OpTypePointer Function %7
+         %43 = OpTypePointer Function %6
+         %48 = OpTypeBool
+         %54 = OpConstant %6 2
+         %68 = OpTypeFloat 32
+         %69 = OpTypeVector %68 4
+         %70 = OpTypePointer Output %69
+         %71 = OpVariable %70 Output
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %12 = OpVariable %11 Function
+         %20 = OpAccessChain %19 %16 %17 %18
+         %21 = OpLoad %6 %20
+         %22 = OpAccessChain %19 %16 %17 %18
+         %23 = OpLoad %6 %22
+         %24 = OpAccessChain %19 %16 %17 %18
+         %25 = OpLoad %6 %24
+         %26 = OpAccessChain %19 %16 %17 %18
+         %27 = OpLoad %6 %26
+         %28 = OpCompositeConstruct %7 %23 %25 %27
+         %30 = OpAccessChain %29 %12 %21
+               OpStore %30 %28
+         %31 = OpAccessChain %19 %16 %17 %17
+         %32 = OpLoad %6 %31
+         %33 = OpAccessChain %19 %16 %17 %18
+         %34 = OpLoad %6 %33
+         %35 = OpAccessChain %19 %16 %17 %18
+         %36 = OpLoad %6 %35
+         %37 = OpAccessChain %19 %16 %17 %18
+         %38 = OpLoad %6 %37
+         %39 = OpCompositeConstruct %7 %34 %36 %38
+         %40 = OpAccessChain %29 %12 %32
+               OpStore %40 %39
+         %41 = OpAccessChain %19 %16 %17 %18
+         %42 = OpLoad %6 %41
+         %44 = OpAccessChain %43 %12 %42 %18
+         %45 = OpLoad %6 %44
+         %46 = OpAccessChain %19 %16 %17 %18
+         %47 = OpLoad %6 %46
+         %49 = OpIEqual %48 %45 %47
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %50 %51
+         %50 = OpLabel
+         %52 = OpAccessChain %19 %16 %17 %18
+         %53 = OpLoad %6 %52
+         %55 = OpExtInst %6 %1 SClamp %53 %18 %54
+         %56 = OpAccessChain %19 %16 %17 %17
+         %57 = OpLoad %6 %56
+         %58 = OpAccessChain %43 %12 %55 %18
+               OpStore %58 %57
+               OpBranch %51
+         %51 = OpLabel
+         %59 = OpAccessChain %19 %16 %17 %17
+         %60 = OpLoad %6 %59
+         %61 = OpAccessChain %43 %12 %60 %18
+         %62 = OpLoad %6 %61
+         %63 = OpAccessChain %19 %16 %17 %17
+         %64 = OpLoad %6 %63
+         %65 = OpIEqual %48 %62 %64
+               OpSelectionMerge %67 None
+               OpBranchConditional %65 %66 %85
+         %66 = OpLabel
+         %72 = OpAccessChain %19 %16 %17 %17
+         %73 = OpLoad %6 %72
+         %74 = OpConvertSToF %68 %73
+         %75 = OpAccessChain %19 %16 %17 %18
+         %76 = OpLoad %6 %75
+         %77 = OpConvertSToF %68 %76
+         %78 = OpAccessChain %19 %16 %17 %18
+         %79 = OpLoad %6 %78
+         %80 = OpConvertSToF %68 %79
+         %81 = OpAccessChain %19 %16 %17 %17
+         %82 = OpLoad %6 %81
+         %83 = OpConvertSToF %68 %82
+         %84 = OpCompositeConstruct %69 %74 %77 %80 %83
+               OpStore %71 %84
+               OpBranch %67
+         %85 = OpLabel
+         %86 = OpAccessChain %19 %16 %17 %17
+         %87 = OpLoad %6 %86
+         %88 = OpConvertSToF %68 %87
+         %89 = OpCompositeConstruct %69 %88 %88 %88 %88
+               OpStore %71 %89
+               OpBranch %67
+         %67 = OpLabel
+               OpReturn
+               OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+  ATTACH variant_vertex_shader
+  ATTACH variant_fragment_shader
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER variant_framebuffer AS color LOCATION 0
+  BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 256 256
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 256 256 EQ_RGBA 255 0 0 255
index 934ad32..6bce536 100644 (file)
 {      "control-flow-in-function.amber",                                                                                                                       "control-flow-in-function",                                                                                                                     "A fragment shader with a lot of control flow"                                                                          },
 {      "control-flow-switch.amber",                                                                                                                            "control-flow-switch",                                                                                                                          "A fragment shader with somewhat complex control flow and a switch"                                     },
 {      "cosh-return-inf-unused.amber",                                                                                                                         "cosh-return-inf-unused",                                                                                                                       "Cosh returns inf for one component which is never used"                                                        },
+{      "cov-access-array-dot.amber",                                                                                                                           "cov-access-array-dot",                                                                                                                         "Covers instruction combine casting, combine shifting and DAG code paths"                       },
 {      "cov-analysis-reachable-from-many.amber",                                                                                                       "cov-analysis-reachable-from-many",                                                                                                     "A fragment shader that covers a specific LLVM analysis code path."                                     },
 {      "cov-apfloat-acos-ldexp.amber",                                                                                                                         "cov-apfloat-acos-ldexp",                                                                                                                       "A fragment shader that covers a specific AP float code path."                                          },
 {      "cov-apfloat-determinant.amber",                                                                                                                        "cov-apfloat-determinant",                                                                                                                      "A fragment shader that covers a specific arbitrary precision float usage."                     },
+{      "cov-apfloat-negative-step-func.amber",                                                                                                         "cov-apfloat-negative-step-func",                                                                                                       "A fragment shader that covers a specific floating point code path"                                     },
 {      "cov-apfloat-tanh.amber",                                                                                                                                       "cov-apfloat-tanh",                                                                                                                                     "A fragment shader that covers a specific arbitrary precision float usage."                     },
+{      "cov-apfloat-undefined-matrix-mul.amber",                                                                                                       "cov-apfloat-undefined-matrix-mul",                                                                                                     "A fragment shader that covers a specific floating point code path"                                     },
 {      "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-bitfieldinsert-div-one.amber",                                                                                       "cov-const-folding-bitfieldinsert-div-one",                                                                                     "A fragment shader that covers a specific const folding 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"                                        },
 {      "cov-const-folding-dot-determinant.amber",                                                                                                      "cov-const-folding-dot-determinant",                                                                                            "A fragment shader that covers a specific const folding rule path."                                     },
 {      "cov-const-folding-gte-const-first.amber",                                                                                                      "cov-const-folding-gte-const-first",                                                                                            "A fragment shader that covers a specific constant folding path"                                        },
 {      "cov-const-folding-min-as-loop-range.amber",                                                                                            "cov-const-folding-min-as-loop-range",                                                                                          "A fragment shader that covers a specific constant folding path"                                        },
+{      "cov-const-folding-mod-one-one-lte.amber",                                                                                                      "cov-const-folding-mod-one-one-lte",                                                                                            "A fragment shader that covers a specific const folding path"                                           },
 {      "cov-const-folding-same-condition.amber",                                                                                                       "cov-const-folding-same-condition",                                                                                                     "A fragment shader that covers a specific constant folding code path"                           },
 {      "cov-const-folding-sinh-inf.amber",                                                                                                                     "cov-const-folding-sinh-inf",                                                                                                           "A fragment shader that covers a specific const folding path"                                           },
 {      "cov-const-folding-vector-shuffle.amber",                                                                                                       "cov-const-folding-vector-shuffle",                                                                                                     "A fragment shader that covers a specific const folding rule path."                                     },
 {      "cov-constant-folding-atan-over-tanh.amber",                                                                                            "cov-constant-folding-atan-over-tanh",                                                                                          "A fragment shader that covers a specific constant folding code path."                          },
+{      "cov-constants-combine-add-sub.amber",                                                                                                          "cov-constants-combine-add-sub",                                                                                                        "A fragment shader that covers a specific constants and add/sub combining path"         },
 {      "cov-constants-mix-uniform.amber",                                                                                                                      "cov-constants-mix-uniform",                                                                                                            "A fragment shader that covers a specific constant handling path."                                      },
 {      "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."                           },
@@ -48,6 +54,8 @@
 {      "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-glf_color.amber",                                                                                                                     "cov-dag-combiner-glf_color",                                                                                                           "A fragment shader that covers specific dag combiner code path"                                         },
+{      "cov-dag-combiner-loop-bitfieldreverse.amber",                                                                                          "cov-dag-combiner-loop-bitfieldreverse",                                                                                        "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-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-inst-combine-add-sub-determinant.amber",                                                                                           "cov-inst-combine-add-sub-determinant",                                                                                         "A fragment shader that covers a specific inst combine add sub code path"                       },
+{      "cov-inst-combine-add-sub-increase-negative.amber",                                                                                     "cov-inst-combine-add-sub-increase-negative",                                                                           "A fragment shader that covers a specific inst combine add sub code path"                       },
+{      "cov-inst-combine-add-sub-neg-func-arg.amber",                                                                                          "cov-inst-combine-add-sub-neg-func-arg",                                                                                        "A fragment shader that covers a specific add/sub combining path"                                       },
+{      "cov-inst-combine-and-or-xor-pack-unpack.amber",                                                                                        "cov-inst-combine-and-or-xor-pack-unpack",                                                                                      "A fragment shader that covers a specific inst combine and or xor code path"            },
+{      "cov-inst-combine-and-or-xor-switch.amber",                                                                                                     "cov-inst-combine-and-or-xor-switch",                                                                                           "A fragment shader that covers a specific inst combine and or xor code path"            },
+{      "cov-inst-combine-and-or-xor-xor-add.amber",                                                                                            "cov-inst-combine-and-or-xor-xor-add",                                                                                          "A fragment shader that covers a specific inst combine and or xor code path"            },
+{      "cov-inst-combine-compares-combine-select-uaddcarry.amber",                                                                     "cov-inst-combine-compares-combine-select-uaddcarry",                                                           "Covers a specific instruction combine compares and combine select code paths"          },
+{      "cov-inst-combine-compares-isnan.amber",                                                                                                        "cov-inst-combine-compares-isnan",                                                                                                      "A fragment shader that covers a specific instruction combine compare code path"        },
+{      "cov-inst-combine-compares-ldexp.amber",                                                                                                        "cov-inst-combine-compares-ldexp",                                                                                                      "A fragment shader that covers a specific instruction combine compares code path"       },
+{      "cov-inst-combine-compares-ternary-vector-access.amber",                                                                        "cov-inst-combine-compares-ternary-vector-access",                                                                      "A fragment shader that covers a specific instruction combine compare code path"        },
+{      "cov-inst-combine-shifts-bitfield-bitcount.amber",                                                                                      "cov-inst-combine-shifts-bitfield-bitcount",                                                                            "A fragment shader that covers a specific instruction combine shifts code path"         },
+{      "cov-inst-combine-shifts-mix-mix-clamp.amber",                                                                                          "cov-inst-combine-shifts-mix-mix-clamp",                                                                                        "A fragment shader that covers a specific instruction combine shifts code path"         },
+{      "cov-instr-info-det-mat-min.amber",                                                                                                                     "cov-instr-info-det-mat-min",                                                                                                           "A fragment shader that covers a specific instr info code path"                                         },
+{      "cov-instructions-for-if-less-than-equal.amber",                                                                                        "cov-instructions-for-if-less-than-equal",                                                                                      "Covers specific instruction simplify and combine compare code paths"                           },
 {      "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-machine-scheduler-for-if-pow.amber",                                                                                                       "cov-machine-scheduler-for-if-pow",                                                                                                     "A fragment shader that covers a specific machine scheduler path"                                       },
 {      "cov-machinevaluetype-one-iter-loop.amber",                                                                                                     "cov-machinevaluetype-one-iter-loop",                                                                                           "A fragment shader that covers a specific machine value type code path"                         },
 {      "cov-max-clamp-same-minval.amber",                                                                                                                      "cov-max-clamp-same-minval",                                                                                                            "A fragment shader that covers a specific instruction simplification path"                      },
 {      "cov-mem-pass-sum-struct-members.amber",                                                                                                        "cov-mem-pass-sum-struct-members",                                                                                                      "A fragment shader that covers a specific mem pass code 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-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard.amber",        "cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard",      "Covers register coalescer, live intervals and target instr info code paths"            },
 {      "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-scaled-number-nested-loops-array-access.amber",                                                                            "cov-scaled-number-nested-loops-array-access",                                                                          "A fragment shader that covers a specific scaled number 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-simplify-clamp-max-itself.amber",                                                                                                          "cov-simplify-clamp-max-itself",                                                                                                        "A fragment shader that covers a specific instruction simplification code path"         },
 {      "cov-simplify-component-uniform-idx.amber",                                                                                                     "cov-simplify-component-uniform-idx",                                                                                           "A fragment shader that covers a specific instruction simplification code path"         },
 {      "cov-simplify-div-by-uint-one.amber",                                                                                                           "cov-simplify-div-by-uint-one",                                                                                                         "A fragment shader that covers a specific instruction simplification code path"         },
+{      "cov-simplify-for-bitwise-condition.amber",                                                                                                     "cov-simplify-for-bitwise-condition",                                                                                           "A fragment shader that covers a specific instruction simplify code path"                       },
 {      "cov-simplify-ldexp-exponent-zero.amber",                                                                                                       "cov-simplify-ldexp-exponent-zero",                                                                                                     "A fragment shader that covers a specific instruction simplification code path"         },
 {      "cov-simplify-mul-identity.amber",                                                                                                                      "cov-simplify-mul-identity",                                                                                                            "A fragment shader that covers a specific instruction simplification code path"         },
 {      "cov-simplify-not-less-than-neg.amber",                                                                                                         "cov-simplify-not-less-than-neg",                                                                                                       "A fragment shader that covers a specific instruction simplification code path"         },
+{      "cov-simplify-right-shift-greater-than-zero.amber",                                                                                     "cov-simplify-right-shift-greater-than-zero",                                                                           "Covers specific instruction simplify and combine compare code paths"                           },
 {      "cov-simplify-select-fragcoord.amber",                                                                                                          "cov-simplify-select-fragcoord",                                                                                                        "A fragment shader that covers a specific instruction simplification code path"         },
 {      "cov-simplify-sign-cosh.amber",                                                                                                                         "cov-simplify-sign-cosh",                                                                                                                       "A fragment shader that covers a specific instruction simplification path"                      },
 {      "cov-simplify-smoothstep-undef.amber",                                                                                                          "cov-simplify-smoothstep-undef",                                                                                                        "A fragment shader that covers a specific instruction simplification code path"         },
 {      "cov-single-block-elim-self-assign.amber",                                                                                                      "cov-single-block-elim-self-assign",                                                                                            "A fragment shader that covers a specific single block elimination 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-tail-duplicator-for-for-for.amber",                                                                                                        "cov-tail-duplicator-for-for-for",                                                                                                      "A fragment shader that covers a specific tail duplicator code 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-vector-log2-cosh.amber",                                                                                                                           "cov-vector-log2-cosh",                                                                                                                         "A fragment shader that covers a specific vector log2 and cosh code path."                      },
 {      "cov-wrap-op-kill-for-loop.amber",                                                                                                                      "cov-wrap-op-kill-for-loop",                                                                                                            "A fragment shader that covers a specific OpKill wrapping code path"                            },
 {      "cov-wrap-op-kill-two-branches.amber",                                                                                                          "cov-wrap-op-kill-two-branches",                                                                                                        "A fragment shader that covers a specific OpKill wrapping path."                                        },
+{      "cov-x86-isel-lowering-machine-value-type-uint-to-float.amber",                                                         "cov-x86-isel-lowering-machine-value-type-uint-to-float",                                                       "Covers specific X86 ISel lowering and machine value type code paths"                           },
+{      "cov-x86-isel-lowering-selection-dag-struct-array-clamp-index.amber",                                           "cov-x86-isel-lowering-selection-dag-struct-array-clamp-index",                                         "Covers a specific X86 ISel lowering and DAG selection code paths"                                      },
 {      "create-color-in-do-while-for-loop.amber",                                                                                                      "create-color-in-do-while-for-loop",                                                                                            "A fragment shader that creates the color inside two loops"                                                     },
 {      "dead-barriers-in-loops.amber",                                                                                                                         "dead-barriers-in-loops",                                                                                                                       "A compute shader with dead barriers"                                                                                           },
 {      "dead-struct-init.amber",                                                                                                                                       "dead-struct-init",                                                                                                                                     "A fragment shader that uses struct initializers"                                                                       },
index 861660a..5ccbcd0 100644 (file)
@@ -748219,14 +748219,18 @@ dEQP-VK.graphicsfuzz.continue-and-merge
 dEQP-VK.graphicsfuzz.control-flow-in-function
 dEQP-VK.graphicsfuzz.control-flow-switch
 dEQP-VK.graphicsfuzz.cosh-return-inf-unused
+dEQP-VK.graphicsfuzz.cov-access-array-dot
 dEQP-VK.graphicsfuzz.cov-analysis-reachable-from-many
 dEQP-VK.graphicsfuzz.cov-apfloat-acos-ldexp
 dEQP-VK.graphicsfuzz.cov-apfloat-determinant
+dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
 dEQP-VK.graphicsfuzz.cov-apfloat-tanh
+dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
 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-bitfieldinsert-div-one
 dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp
 dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
@@ -748238,10 +748242,12 @@ dEQP-VK.graphicsfuzz.cov-const-folding-dot-condition-true
 dEQP-VK.graphicsfuzz.cov-const-folding-dot-determinant
 dEQP-VK.graphicsfuzz.cov-const-folding-gte-const-first
 dEQP-VK.graphicsfuzz.cov-const-folding-min-as-loop-range
+dEQP-VK.graphicsfuzz.cov-const-folding-mod-one-one-lte
 dEQP-VK.graphicsfuzz.cov-const-folding-same-condition
 dEQP-VK.graphicsfuzz.cov-const-folding-sinh-inf
 dEQP-VK.graphicsfuzz.cov-const-folding-vector-shuffle
 dEQP-VK.graphicsfuzz.cov-constant-folding-atan-over-tanh
+dEQP-VK.graphicsfuzz.cov-constants-combine-add-sub
 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
@@ -748249,6 +748255,8 @@ 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-glf_color
+dEQP-VK.graphicsfuzz.cov-dag-combiner-loop-bitfieldreverse
 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
@@ -748306,11 +748314,26 @@ 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-inst-combine-add-sub-determinant
+dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-increase-negative
+dEQP-VK.graphicsfuzz.cov-inst-combine-add-sub-neg-func-arg
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-switch
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-xor-add
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-combine-select-uaddcarry
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-isnan
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ldexp
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-ternary-vector-access
+dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-bitfield-bitcount
+dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
+dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
+dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
 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
+dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
 dEQP-VK.graphicsfuzz.cov-machinevaluetype-one-iter-loop
 dEQP-VK.graphicsfuzz.cov-max-clamp-same-minval
 dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
@@ -748323,10 +748346,12 @@ 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-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
 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-scaled-number-nested-loops-array-access
 dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
 dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
@@ -748334,15 +748359,18 @@ dEQP-VK.graphicsfuzz.cov-simplification-while-inside-for
 dEQP-VK.graphicsfuzz.cov-simplify-clamp-max-itself
 dEQP-VK.graphicsfuzz.cov-simplify-component-uniform-idx
 dEQP-VK.graphicsfuzz.cov-simplify-div-by-uint-one
+dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
 dEQP-VK.graphicsfuzz.cov-simplify-ldexp-exponent-zero
 dEQP-VK.graphicsfuzz.cov-simplify-mul-identity
 dEQP-VK.graphicsfuzz.cov-simplify-not-less-than-neg
+dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
 dEQP-VK.graphicsfuzz.cov-simplify-select-fragcoord
 dEQP-VK.graphicsfuzz.cov-simplify-sign-cosh
 dEQP-VK.graphicsfuzz.cov-simplify-smoothstep-undef
 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-tail-duplicator-for-for-for
 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
@@ -748361,6 +748389,8 @@ dEQP-VK.graphicsfuzz.cov-vector-dce-unused-component
 dEQP-VK.graphicsfuzz.cov-vector-log2-cosh
 dEQP-VK.graphicsfuzz.cov-wrap-op-kill-for-loop
 dEQP-VK.graphicsfuzz.cov-wrap-op-kill-two-branches
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index
 dEQP-VK.graphicsfuzz.create-color-in-do-while-for-loop
 dEQP-VK.graphicsfuzz.dead-barriers-in-loops
 dEQP-VK.graphicsfuzz.dead-struct-init