dEQP-VK.graphicsfuzz.do-while-loop-in-conditionals
authorAlastair Donaldson <afdx@google.com>
Thu, 4 Jul 2019 13:17:15 +0000 (14:17 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 5 Sep 2019 12:27:26 +0000 (08:27 -0400)
Components: Vulkan

New Tests:

dEQP-VK.graphicsfuzz.do-while-loop-in-conditionals

Change-Id: I232d4bf0010f08d7c9352f7258fda34272e89cbc

android/cts/master/vk-master.txt
external/vulkancts/data/vulkan/amber/graphicsfuzz/do-while-loop-in-conditionals.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 eebe067..fc20ffc 100644 (file)
@@ -464777,6 +464777,7 @@ dEQP-VK.graphicsfuzz.continue-and-merge
 dEQP-VK.graphicsfuzz.control-flow-switch
 dEQP-VK.graphicsfuzz.dead-barriers-in-loops
 dEQP-VK.graphicsfuzz.dead-struct-init
+dEQP-VK.graphicsfuzz.do-while-loop-in-conditionals
 dEQP-VK.graphicsfuzz.early-return-and-barrier
 dEQP-VK.graphicsfuzz.fragcoord-control-flow
 dEQP-VK.graphicsfuzz.fragcoord-control-flow-2
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/do-while-loop-in-conditionals.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/do-while-loop-in-conditionals.amber
new file mode 100644 (file)
index 0000000..e358735
--- /dev/null
@@ -0,0 +1,120 @@
+# 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 do-while loop in conditional nest
+
+# The test passes because the fragment shader writes a red pixel, and the
+# do-while loop is not dynamically reachable
+
+# 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);
+#  if(true)
+#   {
+#    if(gl_FragCoord.x < 0.0)
+#     {
+#      do
+#       {
+#        _GLF_color = vec4(1.0, 0.0, 0.0, 1.0);
+#       }
+#      while(gl_FragCoord.x < 0.0);
+#     }
+#   }
+# }
+
+[require]
+fbsize 256 256
+
+[vertex shader passthrough]
+
+[fragment shader spirv]
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 34
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9 %18
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %9 "_GLF_color"
+               OpName %18 "gl_FragCoord"
+               OpDecorate %9 Location 0
+               OpDecorate %18 BuiltIn FragCoord
+          %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 = OpTypeBool
+         %14 = OpConstantTrue %13
+         %17 = OpTypePointer Input %7
+         %18 = OpVariable %17 Input
+         %19 = OpTypeInt 32 0
+         %20 = OpConstant %19 0
+         %21 = OpTypePointer Input %6
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+               OpStore %9 %12
+               OpSelectionMerge %16 None
+               OpBranchConditional %14 %15 %16
+         %15 = OpLabel
+         %22 = OpAccessChain %21 %18 %20
+         %23 = OpLoad %6 %22
+         %24 = OpFOrdLessThan %13 %23 %11
+               OpSelectionMerge %26 None
+               OpBranchConditional %24 %25 %26
+         %25 = OpLabel
+               OpBranch %27
+         %27 = OpLabel
+               OpLoopMerge %29 %30 None
+               OpBranch %28
+         %28 = OpLabel
+               OpStore %9 %12
+               OpBranch %30
+         %30 = OpLabel
+         %31 = OpAccessChain %21 %18 %20
+         %32 = OpLoad %6 %31
+         %33 = OpFOrdLessThan %13 %32 %11
+               OpBranchConditional %33 %27 %29
+         %29 = OpLabel
+               OpBranch %26
+         %26 = OpLabel
+               OpBranch %16
+         %16 = OpLabel
+               OpReturn
+               OpFunctionEnd
+
+
+[test]
+draw rect -1 -1 2 2
+probe rgba (0, 0) (1, 0, 0, 1)
index 8a88470..7a3698c 100644 (file)
@@ -52,6 +52,7 @@ void createAmberTests (tcu::TestCaseGroup* group)
                {       "control-flow-switch.amber",                                    "control-flow-switch",                                  "A fragment shader with somewhat complex control flow and a switch"                                             },
                {       "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"                                                                               },
+               {       "do-while-loop-in-conditionals.amber",                  "do-while-loop-in-conditionals",                "A fragment shader with do-while loop in conditional nest"                                                              },
                {       "early-return-and-barrier.amber",                               "early-return-and-barrier",                             "A compute shader with an early return and a barrier"                                                                   },
                {       "fragcoord-control-flow.amber",                                 "fragcoord-control-flow",                               "A fragment shader that uses FragCoord and somewhat complex control flow"                               },
                {       "fragcoord-control-flow-2.amber",                               "fragcoord-control-flow-2",                             "A fragment shader that uses FragCoord and somewhat complex control flow"                               },
index a3f7d89..f887ab3 100644 (file)
@@ -466923,6 +466923,7 @@ dEQP-VK.graphicsfuzz.continue-and-merge
 dEQP-VK.graphicsfuzz.control-flow-switch
 dEQP-VK.graphicsfuzz.dead-barriers-in-loops
 dEQP-VK.graphicsfuzz.dead-struct-init
+dEQP-VK.graphicsfuzz.do-while-loop-in-conditionals
 dEQP-VK.graphicsfuzz.early-return-and-barrier
 dEQP-VK.graphicsfuzz.fragcoord-control-flow
 dEQP-VK.graphicsfuzz.fragcoord-control-flow-2
index cfe93ae..737a43a 100644 (file)
@@ -466770,6 +466770,7 @@ dEQP-VK.graphicsfuzz.continue-and-merge
 dEQP-VK.graphicsfuzz.control-flow-switch
 dEQP-VK.graphicsfuzz.dead-barriers-in-loops
 dEQP-VK.graphicsfuzz.dead-struct-init
+dEQP-VK.graphicsfuzz.do-while-loop-in-conditionals
 dEQP-VK.graphicsfuzz.early-return-and-barrier
 dEQP-VK.graphicsfuzz.fragcoord-control-flow
 dEQP-VK.graphicsfuzz.fragcoord-control-flow-2