From: Venni Ihanakangas Date: Mon, 16 Dec 2019 11:01:31 +0000 (+0200) Subject: dEQP-VK.graphicsfuzz.switch-case-with-undefined-expression X-Git-Tag: upstream/1.3.5~1630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1180e215fdd46b5f889b3efad016b8f2f3351471;p=platform%2Fupstream%2FVK-GL-CTS.git dEQP-VK.graphicsfuzz.switch-case-with-undefined-expression Components: Vulkan New Tests: dEQP-VK.graphicsfuzz.switch-case-with-undefined-expression Change-Id: Ifc03b32c6e77ea067af4117397b54f19670dcdcd --- diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 3486568..5a72b3a 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -565941,6 +565941,7 @@ dEQP-VK.graphicsfuzz.smoothstep-after-loop dEQP-VK.graphicsfuzz.struct-and-unreachable-infinite-loop dEQP-VK.graphicsfuzz.struct-controlled-loop dEQP-VK.graphicsfuzz.struct-used-as-temporary +dEQP-VK.graphicsfuzz.switch-case-with-undefined-expression dEQP-VK.graphicsfuzz.switch-if-discard dEQP-VK.graphicsfuzz.switch-with-empty-if-false dEQP-VK.graphicsfuzz.swizzle-struct-init-min diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt b/external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt index 24a44c5..a5a7572 100644 --- a/external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt +++ b/external/vulkancts/data/vulkan/amber/graphicsfuzz/index.txt @@ -55,6 +55,7 @@ { "struct-and-unreachable-infinite-loop.amber", "struct-and-unreachable-infinite-loop", "Fragment shader with struct and unreachable infinite loop" }, { "struct-controlled-loop.amber", "struct-controlled-loop", "Shader with loop controlled by struct" }, { "struct-used-as-temporary.amber", "struct-used-as-temporary", "A fragment shader that uses a temporary struct variable" }, +{ "switch-case-with-undefined-expression.amber", "switch-case-with-undefined-expression","A fragment shader with undefined expression" }, { "switch-if-discard.amber", "switch-if-discard", "A fragment shader with a switch, if, and discard" }, { "switch-with-empty-if-false.amber", "switch-with-empty-if-false", "A fragment shader with always false if in switch statement" }, { "swizzle-struct-init-min.amber", "swizzle-struct-init-min", "A fragment shader that uses vector swizzles, struct initializers, and min" }, diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/switch-case-with-undefined-expression.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/switch-case-with-undefined-expression.amber new file mode 100644 index 0000000..60d4098 --- /dev/null +++ b/external/vulkancts/data/vulkan/amber/graphicsfuzz/switch-case-with-undefined-expression.amber @@ -0,0 +1,248 @@ +#!amber + +# Copyright 2019 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 bug found by GraphicsFuzz. + +# Short description: A fragment shader with undefined expression + +# The test passes because main always writes the color red + +# Optimized using spirv-opt with the following arguments: +# '--redundancy-elimination' +# '--eliminate-local-multi-store' +# '--private-to-local' +# '--ccp' +# '--eliminate-dead-branches' +# '--merge-return' +# '--scalar-replacement=100' +# '--redundancy-elimination' +# '--redundancy-elimination' +# '--inline-entry-points-exhaustive' +# '--eliminate-dead-branches' +# '--merge-return' +# '--vector-dce' +# '--simplify-instructions' +# '--private-to-local' +# '--inline-entry-points-exhaustive' +# '--vector-dce' +# '--ccp' +# '--eliminate-local-single-store' +# '--copy-propagate-arrays' +# '--eliminate-local-multi-store' +# spirv-opt commit hash: 6b072126595dd8c2448eb1fda616251c5e6d7079 + + + +SHADER vertex variant_vertex_shader PASSTHROUGH + +# variant_fragment_shader is derived from the following GLSL: +# #version 310 es +# precision highp float; +# +# layout(location = 0) out vec4 _GLF_color; +# +# int search(int target) +# { +# if (1 == target) +# { +# return 1; +# } +# return 1; +# } +# +# void main() +# { +# _GLF_color = vec4(1.0, 0.0, 0.0, 1.0); // Writes the color red +# +# for (int i = 0; i < 1; i++) +# { +# int result; +# search(1); +# switch (result) +# { +# case 0: +# return; +# } +# } +# } +SHADER fragment variant_fragment_shader SPIRV-ASM +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 86 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %24 + OpExecutionMode %4 OriginUpperLeft + OpSource ESSL 310 + OpName %4 "main" + OpName %10 "search(i1;" + OpName %9 "target" + OpName %24 "_GLF_color" + OpName %28 "i" + OpName %37 "param" + OpName %39 "result" + OpDecorate %10 RelaxedPrecision + OpDecorate %9 RelaxedPrecision + OpDecorate %13 RelaxedPrecision + OpDecorate %24 Location 0 + OpDecorate %28 RelaxedPrecision + OpDecorate %39 RelaxedPrecision + OpDecorate %46 RelaxedPrecision + OpDecorate %47 RelaxedPrecision + OpDecorate %61 RelaxedPrecision + OpDecorate %68 RelaxedPrecision + OpDecorate %69 RelaxedPrecision + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeInt 32 1 + %7 = OpTypePointer Function %6 + %8 = OpTypeFunction %6 %7 + %12 = OpConstant %6 1 + %14 = OpTypeBool + %21 = OpTypeFloat 32 + %22 = OpTypeVector %21 4 + %23 = OpTypePointer Output %22 + %24 = OpVariable %23 Output + %25 = OpConstant %21 1 + %26 = OpConstant %21 0 + %27 = OpConstantComposite %22 %25 %26 %26 %25 + %29 = OpConstant %6 0 + %49 = OpUndef %6 + %50 = OpConstantTrue %14 + %55 = OpConstantFalse %14 + %56 = OpTypePointer Function %14 + %83 = OpUndef %14 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %67 = OpVariable %56 Function %55 + %68 = OpVariable %7 Function + %69 = OpVariable %7 Function + %57 = OpVariable %56 Function %55 + %28 = OpVariable %7 Function + %37 = OpVariable %7 Function + %39 = OpVariable %7 Function + OpBranch %52 + %52 = OpLabel + %82 = OpPhi %14 %55 %5 %83 %54 + OpLoopMerge %51 %54 None + OpBranch %53 + %53 = OpLabel + OpStore %24 %27 + OpStore %28 %29 + OpBranch %30 + %30 = OpLabel + %81 = OpPhi %14 %82 %53 %85 %33 + %47 = OpPhi %6 %29 %53 %46 %33 + OpLoopMerge %32 %33 None + OpBranch %34 + %34 = OpLabel + %36 = OpSLessThan %14 %47 %12 + OpBranchConditional %36 %31 %32 + %31 = OpLabel + OpStore %37 %12 + OpStore %67 %55 + OpBranch %70 + %70 = OpLabel + %85 = OpPhi %14 %81 %31 %83 %72 + OpLoopMerge %71 %72 None + OpBranch %73 + %73 = OpLabel + %75 = OpIEqual %14 %12 %12 + OpSelectionMerge %76 None + OpBranchConditional %75 %77 %76 + %77 = OpLabel + OpStore %67 %50 + OpStore %68 %12 + OpBranch %71 + %76 = OpLabel + OpStore %67 %50 + OpStore %68 %12 + OpBranch %71 + %72 = OpLabel + OpBranch %70 + %71 = OpLabel + OpStore %69 %12 + OpSelectionMerge %42 None + OpSwitch %49 %42 0 %41 + %41 = OpLabel + OpStore %57 %50 + OpBranch %32 + %42 = OpLabel + OpBranch %33 + %33 = OpLabel + %46 = OpIAdd %6 %47 %12 + OpStore %28 %46 + OpBranch %30 + %32 = OpLabel + %80 = OpPhi %14 %81 %34 %50 %41 + OpSelectionMerge %58 None + OpBranchConditional %80 %51 %58 + %58 = OpLabel + OpStore %57 %50 + OpBranch %51 + %54 = OpLabel + OpBranch %52 + %51 = OpLabel + OpReturn + OpFunctionEnd + %10 = OpFunction %6 None %8 + %9 = OpFunctionParameter %7 + %11 = OpLabel + %66 = OpVariable %56 Function %55 + %61 = OpVariable %7 Function + OpBranch %63 + %63 = OpLabel + OpLoopMerge %60 %65 None + OpBranch %64 + %64 = OpLabel + %13 = OpLoad %6 %9 + %15 = OpIEqual %14 %12 %13 + OpSelectionMerge %17 None + OpBranchConditional %15 %16 %17 + %16 = OpLabel + OpStore %66 %50 + OpStore %61 %12 + OpBranch %60 + %17 = OpLabel + OpStore %66 %50 + OpStore %61 %12 + OpBranch %60 + %65 = OpLabel + OpBranch %63 + %60 = OpLabel + OpReturnValue %12 + OpFunctionEnd +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 +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/mustpass/master/vk-default-no-waivers.txt b/external/vulkancts/mustpass/master/vk-default-no-waivers.txt index 8ac0806..ed754d9 100644 --- a/external/vulkancts/mustpass/master/vk-default-no-waivers.txt +++ b/external/vulkancts/mustpass/master/vk-default-no-waivers.txt @@ -568186,6 +568186,7 @@ dEQP-VK.graphicsfuzz.smoothstep-after-loop dEQP-VK.graphicsfuzz.struct-and-unreachable-infinite-loop dEQP-VK.graphicsfuzz.struct-controlled-loop dEQP-VK.graphicsfuzz.struct-used-as-temporary +dEQP-VK.graphicsfuzz.switch-case-with-undefined-expression dEQP-VK.graphicsfuzz.switch-if-discard dEQP-VK.graphicsfuzz.switch-with-empty-if-false dEQP-VK.graphicsfuzz.swizzle-struct-init-min diff --git a/external/vulkancts/mustpass/master/vk-default.txt b/external/vulkancts/mustpass/master/vk-default.txt index 741997c..f1d509a 100644 --- a/external/vulkancts/mustpass/master/vk-default.txt +++ b/external/vulkancts/mustpass/master/vk-default.txt @@ -568033,6 +568033,7 @@ dEQP-VK.graphicsfuzz.smoothstep-after-loop dEQP-VK.graphicsfuzz.struct-and-unreachable-infinite-loop dEQP-VK.graphicsfuzz.struct-controlled-loop dEQP-VK.graphicsfuzz.struct-used-as-temporary +dEQP-VK.graphicsfuzz.switch-case-with-undefined-expression dEQP-VK.graphicsfuzz.switch-if-discard dEQP-VK.graphicsfuzz.switch-with-empty-if-false dEQP-VK.graphicsfuzz.swizzle-struct-init-min