Have just one definition of AmberTestCase
authorChris Forbes <chrisforbes@google.com>
Thu, 29 Aug 2019 02:13:38 +0000 (19:13 -0700)
committerChris Forbes <chrisforbes@google.com>
Thu, 29 Aug 2019 04:43:28 +0000 (00:43 -0400)
There were two -- an empty stub in the util header, and the real one.
This made it impossible to actually use the full API to set
feature/extension requirements, etc.

Instead, I have forward-declared the Amber Recipe type so that including
vktAmberTestCase.hpp does not involve pulling in Amber headers.

Add geometryShader feature requirement to provoking vertex Amber tests,
allowing them to skip properly on devices which do not support geometry
shaders.

Affects: dEQP-VK.rasterization.provoking_vertex.*
VK-GL-CTS Issue: 1964

Change-Id: Id6d1068c45b2aacc29d07527edd53d65953c49a3

external/vulkancts/modules/vulkan/amber/CMakeLists.txt
external/vulkancts/modules/vulkan/amber/vktAmberExampleTests.cpp
external/vulkancts/modules/vulkan/amber/vktAmberGraphicsFuzzTests.cpp
external/vulkancts/modules/vulkan/amber/vktAmberTestCase.cpp
external/vulkancts/modules/vulkan/amber/vktAmberTestCase.hpp
external/vulkancts/modules/vulkan/amber/vktAmberTestCaseUtil.hpp [deleted file]
external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexOnlyTests.cpp
external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmPtrAccessChainTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmSignedIntCompareTests.cpp

index 36e81fc..158cd0c 100644 (file)
@@ -7,7 +7,6 @@ set(DEQP_VK_AMBER_SRCS
        vktAmberHelper.cpp
        vktAmberTestCase.hpp
        vktAmberTestCase.cpp
-       vktAmberTestCaseUtil.hpp
        vktAmberTestCaseUtil.cpp
        vktAmberExampleTests.hpp
        vktAmberExampleTests.cpp
index 0c81f73..579b122 100644 (file)
@@ -22,8 +22,9 @@
  * \brief Functional tests using amber
  *//*--------------------------------------------------------------------*/
 
+#include "vktTestGroupUtil.hpp"
 #include "vktAmberExampleTests.hpp"
-#include "vktAmberTestCaseUtil.hpp"
+#include "vktAmberTestCase.hpp"
 
 namespace vkt
 {
index 264ad97..be973d2 100644 (file)
@@ -23,8 +23,9 @@
  * \brief GraphicsFuzz tests
  *//*--------------------------------------------------------------------*/
 
+#include "vktTestGroupUtil.hpp"
 #include "vktAmberGraphicsFuzzTests.hpp"
-#include "vktAmberTestCaseUtil.hpp"
+#include "vktAmberTestCase.hpp"
 
 namespace vkt
 {
index e4e2715..e2f039e 100644 (file)
@@ -23,6 +23,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include <amber/amber.h>
+#include "amber/recipe.h"
 
 #include <iostream>
 
index 3846676..0d7a768 100644 (file)
 
 #include <string>
 #include <set>
-#include "amber/recipe.h"
 #include "tcuDefs.hpp"
 #include "tcuTestCase.hpp"
 #include "vktTestCase.hpp"
 
+namespace amber { class Recipe; }
+
 namespace vkt
 {
 namespace cts_amber
@@ -99,6 +100,13 @@ private:
        std::set<std::string> m_required_features;
 };
 
+AmberTestCase* createAmberTestCase (tcu::TestContext&                          testCtx,
+                                                                       const char*                                             name,
+                                                                       const char*                                             description,
+                                                                       const char*                                             category,
+                                                                       const std::string&                              filename,
+                                                                       const std::vector<std::string>  requirements = std::vector<std::string>());
+
 } // cts_amber
 } // vkt
 
diff --git a/external/vulkancts/modules/vulkan/amber/vktAmberTestCaseUtil.hpp b/external/vulkancts/modules/vulkan/amber/vktAmberTestCaseUtil.hpp
deleted file mode 100644 (file)
index 499b392..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _VKTAMBERTESTCASEUTIL_HPP
-#define _VKTAMBERTESTCASEUTIL_HPP
-/*------------------------------------------------------------------------
- * Vulkan Conformance Tests
- * ------------------------
- *
- * Copyright (c) 2019 Google LLC
- * Copyright (c) 2019 The Khronos Group Inc.
- *
- * 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.
- *
- *//*--------------------------------------------------------------------*/
-
-#include "vktTestGroupUtil.hpp"
-
-namespace vkt
-{
-namespace cts_amber
-{
-
-class AmberTestCase : public tcu::TestNode
-{
-};
-
-AmberTestCase* createAmberTestCase (tcu::TestContext&                          testCtx,
-                                                                       const char*                                             name,
-                                                                       const char*                                             description,
-                                                                       const char*                                             category,
-                                                                       const std::string&                              filename,
-                                                                       const std::vector<std::string>  requirements = std::vector<std::string>());
-
-} // cts_amber
-} // vkt
-
-#endif // _VKTAMBERTESTCASEUTIL_HPP
index 6f0afec..295d2f7 100644 (file)
@@ -24,7 +24,8 @@
 
 #include <string>
 
-#include "vktAmberTestCaseUtil.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktAmberTestCase.hpp"
 #include "vktPipelineVertexOnlyTests.hpp"
 
 namespace vkt
index 617fb52..007f452 100644 (file)
@@ -23,7 +23,8 @@
  * \brief Functional rasterization tests.
  *//*--------------------------------------------------------------------*/
 
-#include "vktAmberTestCaseUtil.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktAmberTestCase.hpp"
 #include "vktRasterizationTests.hpp"
 #include "tcuRasterizationVerifier.hpp"
 #include "tcuSurface.hpp"
@@ -37,7 +38,6 @@
 #include "deRandom.hpp"
 #include "vktTestCase.hpp"
 #include "vktTestCaseUtil.hpp"
-#include "vktTestGroupUtil.hpp"
 #include "vkPrograms.hpp"
 #include "vkMemUtil.hpp"
 #include "vkRefUtil.hpp"
@@ -3744,27 +3744,33 @@ void createRasterizationTests (tcu::TestCaseGroup* rasterizationTests)
        {
                tcu::TestCaseGroup* const       provokingVertex         = new tcu::TestCaseGroup(testCtx, "provoking_vertex", "Test provoking vertex");
 
-               const char*                                     primitiveTypes[]        =
-               {
-                       "triangle_list",
-                       "triangle_list_with_adjacency",
-                       "triangle_strip",
-                       "triangle_strip_with_adjacency",
-                       "triangle_fan",
-                       "line_list",
-                       "line_list_with_adjacency",
-                       "line_strip",
-                       "line_strip_with_adjacency"
+               struct Params { const char *type; bool requireGeometryShader; };
+               Params  primitiveTypes[]        =
+               {
+                       { "triangle_list", false },
+                       { "triangle_list_with_adjacency", true },
+                       { "triangle_strip", false },
+                       { "triangle_strip_with_adjacency", true },
+                       { "triangle_fan", false },
+                       { "line_list", false },
+                       { "line_list_with_adjacency", true },
+                       { "line_strip", false },
+                       { "line_strip_with_adjacency", true },
                };
 
                rasterizationTests->addChild(provokingVertex);
 
                for (deUint32 primitiveTypeIdx = 0; primitiveTypeIdx < DE_LENGTH_OF_ARRAY(primitiveTypes); primitiveTypeIdx++)
                {
-                       const char*                     type    = primitiveTypes[primitiveTypeIdx];
-                       const std::string       file    = std::string(type) + ".amber";
+                       Params &                                        params          = primitiveTypes[primitiveTypeIdx];
+                       const std::string                       file            = std::string(params.type) + ".amber";
 
-                       provokingVertex->addChild(cts_amber::createAmberTestCase(testCtx, type, "", "provoking_vertex", file));
+                       cts_amber::AmberTestCase*       testCase        = cts_amber::createAmberTestCase(testCtx, params.type, "", "provoking_vertex", file);
+                       if (params.requireGeometryShader)
+                       {
+                               testCase->addRequirement("Features.geometryShader");
+                       }
+                       provokingVertex->addChild(testCase);
                }
        }
 }
index b2cca24..25b2609 100644 (file)
@@ -21,7 +21,8 @@
 
 #include <string>
 
-#include "vktAmberTestCaseUtil.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktAmberTestCase.hpp"
 #include "vktSpvAsmPtrAccessChainTests.hpp"
 
 namespace vkt
index 3f51828..2f3c9a7 100644 (file)
@@ -24,7 +24,8 @@
 
 #include <string>
 
-#include "vktAmberTestCaseUtil.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktAmberTestCase.hpp"
 #include "vktSpvAsmSignedIntCompareTests.hpp"
 
 namespace vkt