dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
authorAlastair Donaldson <afdx@google.com>
Thu, 4 Jul 2019 22:14:06 +0000 (23:14 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 23 Jul 2019 18:00:54 +0000 (14:00 -0400)
Components: Vulkan

New Tests:

dEQP-VK.graphicsfuzz.unreachable-loops-in-switch

Change-Id: If080620b03201031c0e7cf5af67fa30d0fee57d3

android/cts/master/vk-master.txt
external/vulkancts/data/vulkan/amber/graphicsfuzz/unreachable-loops-in-switch.amber [new file with mode: 0644]
external/vulkancts/modules/vulkan/amber/vktAmberGraphicsFuzzTests.cpp
external/vulkancts/mustpass/master/vk-default-no-waivers.txt
external/vulkancts/mustpass/master/vk-default.txt

index a287e6e..9a4810c 100644 (file)
@@ -462572,6 +462572,7 @@ dEQP-VK.graphicsfuzz.matrices-and-return-in-loop
 dEQP-VK.graphicsfuzz.pow-vec4
 dEQP-VK.graphicsfuzz.return-in-loop-in-function
 dEQP-VK.graphicsfuzz.swizzle-struct-init-min
+dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
 dEQP-VK.graphicsfuzz.while-inside-switch
 dEQP-VK.transform_feedback.simple.basic_1_256
 dEQP-VK.transform_feedback.simple.basic_beginqueryindexed_streamid_0_1_256
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/unreachable-loops-in-switch.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/unreachable-loops-in-switch.amber
new file mode 100644 (file)
index 0000000..2becdff
--- /dev/null
@@ -0,0 +1,183 @@
+# 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 unreachable loops in a switch
+
+# The test passes because the fragment shader writes a red pixel, and then
+# terminates without further output manipulation
+
+# Derived from the following GLSL.
+
+# Fragment shader GLSL:
+# #version 310 es
+#
+# precision highp float;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#  _GLF_color = vec4(1.0, 0.0, 0.0, 1.0);
+#  float data[1];
+#  for(int i = 0; i < 1; i++) {
+#   if(data[i] < data[0]) {
+#    if(false) {
+#     if(float(i) >= 1.0) { }
+#    }
+#    switch(0) {
+#     case 1:
+#      for(; 1 > 0;) { }
+#      for(;;) { }
+#     case 0:
+#      data[0] = 2.0;
+#      break;
+#    }
+#   }
+#  }
+# }
+
+[require]
+fbsize 256 256
+
+[vertex shader passthrough]
+
+[fragment shader spirv]
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 67
+; 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 %15 "i"
+               OpName %30 "data"
+               OpDecorate %9 Location 0
+               OpDecorate %15 RelaxedPrecision
+               OpDecorate %22 RelaxedPrecision
+               OpDecorate %31 RelaxedPrecision
+               OpDecorate %43 RelaxedPrecision
+               OpDecorate %65 RelaxedPrecision
+               OpDecorate %66 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpConstant %6 1
+         %11 = OpConstant %6 0
+         %12 = OpConstantComposite %7 %10 %11 %11 %10
+         %13 = OpTypeInt 32 1
+         %14 = OpTypePointer Function %13
+         %16 = OpConstant %13 0
+         %23 = OpConstant %13 1
+         %24 = OpTypeBool
+         %26 = OpTypeInt 32 0
+         %27 = OpConstant %26 1
+         %28 = OpTypeArray %6 %27
+         %29 = OpTypePointer Function %28
+         %32 = OpTypePointer Function %6
+         %40 = OpConstantFalse %24
+         %56 = OpConstantTrue %24
+         %61 = OpConstant %6 2
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %15 = OpVariable %14 Function
+         %30 = OpVariable %29 Function
+               OpStore %9 %12
+               OpStore %15 %16
+               OpBranch %17
+         %17 = OpLabel
+               OpLoopMerge %19 %20 None
+               OpBranch %21
+         %21 = OpLabel
+         %22 = OpLoad %13 %15
+         %25 = OpSLessThan %24 %22 %23
+               OpBranchConditional %25 %18 %19
+         %18 = OpLabel
+         %31 = OpLoad %13 %15
+         %33 = OpAccessChain %32 %30 %31
+         %34 = OpLoad %6 %33
+         %35 = OpAccessChain %32 %30 %16
+         %36 = OpLoad %6 %35
+         %37 = OpFOrdLessThan %24 %34 %36
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %38 %39
+         %38 = OpLabel
+               OpSelectionMerge %42 None
+               OpBranchConditional %40 %41 %42
+         %41 = OpLabel
+         %43 = OpLoad %13 %15
+         %44 = OpConvertSToF %6 %43
+         %45 = OpFOrdGreaterThanEqual %24 %44 %10
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %46 %47
+         %46 = OpLabel
+               OpBranch %47
+         %47 = OpLabel
+               OpBranch %42
+         %42 = OpLabel
+               OpSelectionMerge %50 None
+               OpSwitch %16 %50 1 %48 0 %49
+         %48 = OpLabel
+               OpBranch %51
+         %51 = OpLabel
+               OpLoopMerge %53 %54 None
+               OpBranch %55
+         %55 = OpLabel
+               OpBranchConditional %56 %52 %53
+         %52 = OpLabel
+               OpBranch %54
+         %54 = OpLabel
+               OpBranch %51
+         %53 = OpLabel
+               OpBranch %57
+         %57 = OpLabel
+               OpLoopMerge %59 %60 None
+               OpBranch %58
+         %58 = OpLabel
+               OpBranch %60
+         %60 = OpLabel
+               OpBranch %57
+         %59 = OpLabel
+               OpBranch %49
+         %49 = OpLabel
+         %62 = OpAccessChain %32 %30 %16
+               OpStore %62 %61
+               OpBranch %50
+         %50 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
+               OpBranch %20
+         %20 = OpLabel
+         %65 = OpLoad %13 %15
+         %66 = OpIAdd %13 %65 %23
+               OpStore %15 %66
+               OpBranch %17
+         %19 = OpLabel
+               OpReturn
+               OpFunctionEnd
+
+
+[test]
+draw rect -1 -1 2 2
+probe rgba (0, 0) (1, 0, 0, 1)
index 9fb4474..73e7acc 100644 (file)
@@ -61,6 +61,7 @@ void createAmberTests (tcu::TestCaseGroup* group)
                {       "pow-vec4.amber",                                                               "pow-vec4",                                                             "A fragment shader that uses pow"                                                                                                               },
                {       "return-in-loop-in-function.amber",                             "return-in-loop-in-function",                   "A fragment shader with early return from loop in function"                                                             },
                {       "swizzle-struct-init-min.amber",                                "swizzle-struct-init-min",                              "A fragment shader that uses vector swizzles, struct initializers, and min"                             },
+               {       "unreachable-loops-in-switch.amber",                    "unreachable-loops-in-switch",                  "A fragment shader with unreachable loops in a switch"                                                                  },
                {       "while-inside-switch.amber",                                    "while-inside-switch",                                  "A fragment shader that uses a while loop inside a switch"                                                              },
        };
 
index cc625cb..c013da5 100644 (file)
@@ -464718,6 +464718,7 @@ dEQP-VK.graphicsfuzz.matrices-and-return-in-loop
 dEQP-VK.graphicsfuzz.pow-vec4
 dEQP-VK.graphicsfuzz.return-in-loop-in-function
 dEQP-VK.graphicsfuzz.swizzle-struct-init-min
+dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
 dEQP-VK.graphicsfuzz.while-inside-switch
 dEQP-VK.transform_feedback.simple.basic_1_256
 dEQP-VK.transform_feedback.simple.basic_beginqueryindexed_streamid_0_1_256
index 10170d8..7020994 100644 (file)
@@ -464565,6 +464565,7 @@ dEQP-VK.graphicsfuzz.matrices-and-return-in-loop
 dEQP-VK.graphicsfuzz.pow-vec4
 dEQP-VK.graphicsfuzz.return-in-loop-in-function
 dEQP-VK.graphicsfuzz.swizzle-struct-init-min
+dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
 dEQP-VK.graphicsfuzz.while-inside-switch
 dEQP-VK.transform_feedback.simple.basic_1_256
 dEQP-VK.transform_feedback.simple.basic_beginqueryindexed_streamid_0_1_256