dEQP-VK.graphicsfuzz.struct-used-as-temporary
authorAlastair Donaldson <afdx@google.com>
Thu, 15 Aug 2019 15:07:13 +0000 (16:07 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 29 Aug 2019 09:20:48 +0000 (05:20 -0400)
Components: Vulkan

New Tests:

dEQP-VK.graphicsfuzz.struct-used-as-temporary

Change-Id: Icf9311a20bbe59302e0df1b75e07f18e5d788f91

android/cts/master/vk-master.txt
external/vulkancts/data/vulkan/amber/graphicsfuzz/struct-used-as-temporary.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 c415699..0209913 100644 (file)
@@ -464750,6 +464750,7 @@ dEQP-VK.graphicsfuzz.matrices-and-return-in-loop
 dEQP-VK.graphicsfuzz.nested-ifs-and-return-in-for-loop
 dEQP-VK.graphicsfuzz.pow-vec4
 dEQP-VK.graphicsfuzz.return-in-loop-in-function
+dEQP-VK.graphicsfuzz.struct-used-as-temporary
 dEQP-VK.graphicsfuzz.swizzle-struct-init-min
 dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
 dEQP-VK.graphicsfuzz.while-inside-switch
diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/struct-used-as-temporary.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/struct-used-as-temporary.amber
new file mode 100644 (file)
index 0000000..e11a82f
--- /dev/null
@@ -0,0 +1,117 @@
+#!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 reduced by GraphicsFuzz.
+
+# Short description: A fragment shader that uses a temporary struct variable
+
+# The test passes because the fragment shader is provided with a red vec4
+# as input, and copies this through to the output (via a struct)
+
+# The following GLSL, produced by SPIRV-Cross (and then manually edited for
+# readability) shows what the shader does.
+
+# Fragment shader GLSL:
+# #version 310 es
+# precision mediump float;
+# precision highp int;
+#
+# struct S
+# {
+#     highp vec4 v;
+# };
+#
+# layout(binding = 0, std140) uniform somename
+# {
+#     highp vec4 v;
+# } buf;
+#
+# layout(location = 0) out highp vec4 color;
+#
+# S undef;
+#
+# void main()
+# {
+#     S temp = undef;
+#     temp.v = buf.v;
+#     color = temp.v;
+# }
+
+SHADER vertex gfz_vert PASSTHROUGH
+
+SHADER fragment gfz_frag SPIRV-ASM
+; SPIR-V
+; Version: 1.3
+; Generator: Khronos SPIR-V Tools Assembler; 0
+; Bound: 22
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main" %9
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpDecorate %9 Location 0
+               OpMemberDecorate %10 0 Offset 0
+               OpDecorate %10 Block
+               OpDecorate %12 DescriptorSet 0
+               OpDecorate %12 Binding 0
+               OpDecorate %21 RelaxedPrecision
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeFloat 32
+          %7 = OpTypeVector %6 4
+          %8 = OpTypePointer Output %7
+          %9 = OpVariable %8 Output
+         %10 = OpTypeStruct %7
+         %11 = OpTypePointer Uniform %10
+         %12 = OpVariable %11 Uniform
+         %13 = OpTypeInt 32 1
+         %14 = OpConstant %13 0
+         %15 = OpTypePointer Uniform %7
+         %18 = OpTypeStruct %7
+         %19 = OpUndef %18
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+         %16 = OpAccessChain %15 %12 %14
+         %17 = OpLoad %7 %16
+         %20 = OpCompositeInsert %18 %17 %19 0
+         %21 = OpCompositeExtract %7 %20 0
+               OpStore %9 %21
+               OpReturn
+               OpFunctionEnd
+END
+
+BUFFER framebuffer FORMAT B8G8R8A8_UNORM
+
+# f
+BUFFER f DATA_TYPE vec4<float> DATA
+ 1.0 0.0 0.0 1.0
+END
+
+PIPELINE graphics gfz_pipeline
+  ATTACH gfz_vert
+  ATTACH gfz_frag
+  FRAMEBUFFER_SIZE 256 256
+  BIND BUFFER framebuffer AS color LOCATION 0
+BIND BUFFER f AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+
+CLEAR_COLOR gfz_pipeline 0 0 0 255
+CLEAR gfz_pipeline
+RUN gfz_pipeline DRAW_RECT POS 0 0 SIZE 256 256
+
+EXPECT framebuffer IDX 0 0 SIZE 256 256 EQ_RGB 255 0 0
index fc0b5c5..630630e 100644 (file)
@@ -61,6 +61,7 @@ void createAmberTests (tcu::TestCaseGroup* group)
                {       "nested-ifs-and-return-in-for-loop.amber",              "nested-ifs-and-return-in-for-loop",    "A fragment shader with return in nest of ifs, inside loop"                                                             },
                {       "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"                                                             },
+               {       "struct-used-as-temporary.amber",                               "struct-used-as-temporary",                             "A fragment shader that uses a temporary struct variable"                                                               },
                {       "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 5e179a6..18c3e34 100644 (file)
@@ -466896,6 +466896,7 @@ dEQP-VK.graphicsfuzz.matrices-and-return-in-loop
 dEQP-VK.graphicsfuzz.nested-ifs-and-return-in-for-loop
 dEQP-VK.graphicsfuzz.pow-vec4
 dEQP-VK.graphicsfuzz.return-in-loop-in-function
+dEQP-VK.graphicsfuzz.struct-used-as-temporary
 dEQP-VK.graphicsfuzz.swizzle-struct-init-min
 dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
 dEQP-VK.graphicsfuzz.while-inside-switch
index e1a9382..79a56c4 100644 (file)
@@ -466743,6 +466743,7 @@ dEQP-VK.graphicsfuzz.matrices-and-return-in-loop
 dEQP-VK.graphicsfuzz.nested-ifs-and-return-in-for-loop
 dEQP-VK.graphicsfuzz.pow-vec4
 dEQP-VK.graphicsfuzz.return-in-loop-in-function
+dEQP-VK.graphicsfuzz.struct-used-as-temporary
 dEQP-VK.graphicsfuzz.swizzle-struct-init-min
 dEQP-VK.graphicsfuzz.unreachable-loops-in-switch
 dEQP-VK.graphicsfuzz.while-inside-switch