First steps towards running ES3.1 functional tests on GL4.5 drivers
authorAlexander Galazin <alexander.galazin@arm.com>
Mon, 14 Dec 2020 08:16:53 +0000 (09:16 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 29 Dec 2020 10:25:13 +0000 (10:25 +0000)
This commit creates a minimal necessary infastrcuture, e.g. the
package files, but doesn't make any functional changes to the tests.

Components: AOSP, OpenGL

Affects: dEQP-GLES31.*

Change-Id: I22c91224459d390377cdd6fbfc534522d958eb58

AndroidGen.mk
external/openglcts/modules/glcTestPackageRegistry.cpp
modules/gles31/CMakeLists.txt
modules/gles31/tes31Context.cpp
modules/gles31/tes31Context.hpp
modules/gles31/tes31TestCaseWrapper.hpp [new file with mode: 0644]
modules/gles31/tes31TestPackage.cpp
modules/gles31/tgl45TestPackage.cpp [new file with mode: 0644]
modules/gles31/tgl45TestPackage.hpp [new file with mode: 0644]

index 833f49f..3c2f313 100644 (file)
@@ -1138,6 +1138,7 @@ LOCAL_SRC_FILES := \
        modules/gles31/tes31TestCase.cpp \
        modules/gles31/tes31TestPackage.cpp \
        modules/gles31/tes31TestPackageEntry.cpp \
+       modules/gles31/tgl45TestPackage.cpp \
        modules/glshared/glsAttributeLocationTests.cpp \
        modules/glshared/glsBufferTestUtil.cpp \
        modules/glshared/glsBuiltinPrecisionTests.cpp \
index 0162907..55d5126 100644 (file)
@@ -44,6 +44,7 @@
 #include "es31cTestPackage.hpp"
 #include "esextcTestPackage.hpp"
 #include "tes31TestPackage.hpp"
+#include "tgl45TestPackage.hpp"
 
 #if defined(DEQP_GTF_AVAILABLE)
 #include "gtfES31TestPackage.hpp"
@@ -129,6 +130,10 @@ static tcu::TestPackage* createdEQPES31Package(tcu::TestContext& testCtx)
 {
        return new deqp::gles31::TestPackage(testCtx);
 }
+static tcu::TestPackage* createdEQPGL45Package(tcu::TestContext& testCtx)
+{
+       return new deqp::gles31::TestPackageGL45(testCtx);
+}
 #endif
 static tcu::TestPackage* createES31Package(tcu::TestContext& testCtx)
 {
@@ -292,6 +297,7 @@ void registerPackages(void)
 
 #if DE_OS != DE_OS_ANDROID
        registry->registerPackage("dEQP-GLES31", createdEQPES31Package);
+       registry->registerPackage("dEQP-GL45", createdEQPGL45Package);
 #endif
        registry->registerPackage("KHR-GLES31", createES31Package);
        registry->registerPackage("KHR-GLESEXT", createESEXTPackage);
index 0d4cfc9..42b2859 100644 (file)
@@ -22,6 +22,8 @@ set(DEQP_GLES31_SRCS
        tes31TestCase.hpp
        tes31TestPackage.cpp
        tes31TestPackage.hpp
+       tgl45TestPackage.cpp
+       tgl45TestPackage.hpp
        )
 
 set(DEQP_GLES31_LIBS
index 438f2b8..22eda99 100644 (file)
@@ -22,7 +22,6 @@
  *//*--------------------------------------------------------------------*/
 
 #include "tes31Context.hpp"
-#include "gluRenderContext.hpp"
 #include "gluRenderConfig.hpp"
 #include "gluFboRenderContext.hpp"
 #include "gluContextInfo.hpp"
@@ -34,10 +33,11 @@ namespace deqp
 namespace gles31
 {
 
-Context::Context (tcu::TestContext& testCtx)
+Context::Context (tcu::TestContext& testCtx, glu::ApiType apiType)
        : m_testCtx             (testCtx)
        , m_renderCtx   (DE_NULL)
        , m_contextInfo (DE_NULL)
+       , m_apiType             (apiType)
 {
        if (m_testCtx.getCommandLine().getRunMode() == tcu::RUNMODE_EXECUTE)
                createRenderContext();
@@ -63,11 +63,12 @@ void Context::createRenderContext (void)
        {
                try
                {
-                       m_renderCtx             = glu::createDefaultRenderContext(m_testCtx.getPlatform(), m_testCtx.getCommandLine(), glu::ApiType::es(3, 2));
+                       m_renderCtx             = glu::createDefaultRenderContext(m_testCtx.getPlatform(), m_testCtx.getCommandLine(), m_apiType);
                }
                catch (...)
                {
-                       m_renderCtx             = glu::createDefaultRenderContext(m_testCtx.getPlatform(), m_testCtx.getCommandLine(), glu::ApiType::es(3, 1));
+                       m_apiType               = glu::ApiType::es(3, 1);
+                       m_renderCtx             = glu::createDefaultRenderContext(m_testCtx.getPlatform(), m_testCtx.getCommandLine(), m_apiType);
                }
                m_contextInfo   = glu::ContextInfo::create(*m_renderCtx);
        }
index e09f9c5..1a91595 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "tcuDefs.hpp"
 #include "tcuTestContext.hpp"
+#include "gluRenderContext.hpp"
 
 namespace glu
 {
@@ -45,7 +46,7 @@ namespace gles31
 class Context
 {
 public:
-                                                                       Context                                 (tcu::TestContext& testCtx);
+                                                                       Context                                 (tcu::TestContext& testCtx, glu::ApiType apiType = glu::ApiType::es(3,2));
                                                                        ~Context                                (void);
 
        tcu::TestContext&                               getTestContext                  (void)                  { return m_testCtx;                     }
@@ -63,6 +64,7 @@ private:
        tcu::TestContext&                               m_testCtx;
        glu::RenderContext*                             m_renderCtx;
        glu::ContextInfo*                               m_contextInfo;
+       glu::ApiType                                    m_apiType;
 };
 
 } // gles31
diff --git a/modules/gles31/tes31TestCaseWrapper.hpp b/modules/gles31/tes31TestCaseWrapper.hpp
new file mode 100644 (file)
index 0000000..03bbe44
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef _TES31TESTCASEWRAPPER_HPP
+#define _TES31TESTCASEWRAPPER_HPP
+/*-------------------------------------------------------------------------
+ * OpenGL Conformance Test Suite
+ * -----------------------------
+ *
+ * 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.
+ *
+ */ /*!
+ * \file
+ * \brief OpenGL ES 3.1 Test Package that runs on GL4.5 context
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuTestLog.hpp"
+#include "tes31Context.hpp"
+#include "tcuWaiverUtil.hpp"
+#include "gluStateReset.hpp"
+
+namespace deqp
+{
+namespace gles31
+{
+
+template <typename TEST_PACKAGE>
+class TestCaseWrapper : public tcu::TestCaseExecutor
+{
+public:
+                                                                       TestCaseWrapper         (TEST_PACKAGE& package, de::SharedPtr<tcu::WaiverUtil> waiverMechanism);
+                                                                       ~TestCaseWrapper        (void);
+
+       void                                                    init                            (tcu::TestCase* testCase, const std::string& path);
+       void                                                    deinit                          (tcu::TestCase* testCase);
+       tcu::TestNode::IterateResult    iterate                         (tcu::TestCase* testCase);
+
+private:
+       TEST_PACKAGE&                                   m_testPackage;
+       de::SharedPtr<tcu::WaiverUtil>  m_waiverMechanism;
+};
+
+template <typename TEST_PACKAGE>
+TestCaseWrapper<TEST_PACKAGE>::TestCaseWrapper (TEST_PACKAGE& package, de::SharedPtr<tcu::WaiverUtil> waiverMechanism)
+       : m_testPackage(package)
+       , m_waiverMechanism (waiverMechanism)
+{
+}
+
+template <typename TEST_PACKAGE>
+TestCaseWrapper<TEST_PACKAGE>::~TestCaseWrapper (void)
+{
+}
+
+template <typename TEST_PACKAGE>
+void TestCaseWrapper<TEST_PACKAGE>::init (tcu::TestCase* testCase, const std::string& path)
+{
+       if (m_waiverMechanism->isOnWaiverList(path))
+               throw tcu::TestException("Waived test", QP_TEST_RESULT_WAIVER);
+
+       testCase->init();
+}
+
+template <typename TEST_PACKAGE>
+void TestCaseWrapper<TEST_PACKAGE>::deinit (tcu::TestCase* testCase)
+{
+       testCase->deinit();
+
+       DE_ASSERT(m_testPackage.getContext());
+       glu::resetState(m_testPackage.getContext()->getRenderContext(), m_testPackage.getContext()->getContextInfo());
+}
+
+template <typename TEST_PACKAGE>
+tcu::TestNode::IterateResult TestCaseWrapper<TEST_PACKAGE>::iterate (tcu::TestCase* testCase)
+{
+       tcu::TestContext&                                       testCtx = m_testPackage.getContext()->getTestContext();
+       const tcu::TestCase::IterateResult      result  = testCase->iterate();
+
+       // Call implementation specific post-iterate routine (usually handles native events and swaps buffers)
+       try
+       {
+               m_testPackage.getContext()->getRenderContext().postIterate();
+               return result;
+       }
+       catch (const tcu::ResourceError& e)
+       {
+               testCtx.getLog() << e;
+               testCtx.setTestResult(QP_TEST_RESULT_RESOURCE_ERROR, "Resource error in context post-iteration routine");
+               testCtx.setTerminateAfter(true);
+               return tcu::TestNode::STOP;
+       }
+       catch (const std::exception& e)
+       {
+               testCtx.getLog() << e;
+               testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error in context post-iteration routine");
+               return tcu::TestNode::STOP;
+       }
+}
+
+} // gles31
+} // deqp
+
+#endif // _TES31TESTCASEWRAPPER_HPP
index 40aa24e..7c7bfce 100644 (file)
@@ -22,6 +22,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include "tes31TestPackage.hpp"
+#include "tes31TestCaseWrapper.hpp"
 #include "tes31InfoTests.hpp"
 #include "es31fFunctionalTests.hpp"
 #include "es31sStressTests.hpp"
@@ -38,73 +39,6 @@ namespace deqp
 namespace gles31
 {
 
-class TestCaseWrapper : public tcu::TestCaseExecutor
-{
-public:
-                                                                       TestCaseWrapper         (TestPackage& package, de::SharedPtr<tcu::WaiverUtil> waiverMechanism);
-                                                                       ~TestCaseWrapper        (void);
-
-       void                                                    init                            (tcu::TestCase* testCase, const std::string& path);
-       void                                                    deinit                          (tcu::TestCase* testCase);
-       tcu::TestNode::IterateResult    iterate                         (tcu::TestCase* testCase);
-
-private:
-       TestPackage&                                    m_testPackage;
-       de::SharedPtr<tcu::WaiverUtil>  m_waiverMechanism;
-};
-
-TestCaseWrapper::TestCaseWrapper (TestPackage& package, de::SharedPtr<tcu::WaiverUtil> waiverMechanism)
-       : m_testPackage         (package)
-       , m_waiverMechanism     (waiverMechanism)
-{
-}
-
-TestCaseWrapper::~TestCaseWrapper (void)
-{
-}
-
-void TestCaseWrapper::init (tcu::TestCase* testCase, const std::string& path)
-{
-       if (m_waiverMechanism->isOnWaiverList(path))
-               throw tcu::TestException("Waived test", QP_TEST_RESULT_WAIVER);
-
-       testCase->init();
-}
-
-void TestCaseWrapper::deinit (tcu::TestCase* testCase)
-{
-       testCase->deinit();
-
-       DE_ASSERT(m_testPackage.getContext());
-       glu::resetState(m_testPackage.getContext()->getRenderContext(), m_testPackage.getContext()->getContextInfo());
-}
-
-tcu::TestNode::IterateResult TestCaseWrapper::iterate (tcu::TestCase* testCase)
-{
-       tcu::TestContext&                                       testCtx = m_testPackage.getContext()->getTestContext();
-       const tcu::TestCase::IterateResult      result  = testCase->iterate();
-
-       // Call implementation specific post-iterate routine (usually handles native events and swaps buffers)
-       try
-       {
-               m_testPackage.getContext()->getRenderContext().postIterate();
-               return result;
-       }
-       catch (const tcu::ResourceError& e)
-       {
-               testCtx.getLog() << e;
-               testCtx.setTestResult(QP_TEST_RESULT_RESOURCE_ERROR, "Resource error in context post-iteration routine");
-               testCtx.setTerminateAfter(true);
-               return tcu::TestNode::STOP;
-       }
-       catch (const std::exception& e)
-       {
-               testCtx.getLog() << e;
-               testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error in context post-iteration routine");
-               return tcu::TestNode::STOP;
-       }
-}
-
 TestPackage::TestPackage (tcu::TestContext& testCtx)
        : tcu::TestPackage      (testCtx, "dEQP-GLES31", "dEQP OpenGL ES 3.1 Tests")
        , m_archive                     (testCtx.getRootArchive(), "gles31/")
@@ -162,7 +96,7 @@ void TestPackage::deinit (void)
 
 tcu::TestCaseExecutor* TestPackage::createExecutor (void) const
 {
-       return new TestCaseWrapper(const_cast<TestPackage&>(*this), m_waiverMechanism);
+       return new TestCaseWrapper<TestPackage>(const_cast<TestPackage&>(*this), m_waiverMechanism);
 }
 
 } // gles31
diff --git a/modules/gles31/tgl45TestPackage.cpp b/modules/gles31/tgl45TestPackage.cpp
new file mode 100644 (file)
index 0000000..0fe3f83
--- /dev/null
@@ -0,0 +1,102 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.1 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2019 The Android Open Source Project
+ *
+ * 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.
+ *
+ *//*!
+ * \file
+ * \brief OpenGL ES 3.1 Test Package that runs on GL4.5 context
+ *//*--------------------------------------------------------------------*/
+
+#include "tgl45TestPackage.hpp"
+#include "tes31TestCaseWrapper.hpp"
+#include "tes31InfoTests.hpp"
+#include "es31fFunctionalTests.hpp"
+#include "es31sStressTests.hpp"
+#include "gluStateReset.hpp"
+#include "gluRenderContext.hpp"
+#include "gluContextInfo.hpp"
+#include "tcuTestLog.hpp"
+#include "tcuCommandLine.hpp"
+#include "tcuWaiverUtil.hpp"
+#include "glwEnums.hpp"
+
+namespace deqp
+{
+namespace gles31
+{
+
+TestPackageGL45::TestPackageGL45 (tcu::TestContext& testCtx)
+       : tcu::TestPackage      (testCtx, "dEQP-GL45", "dEQP OpenGL ES 3.1 Tests On GL4.5 Context")
+       , m_archive                     (testCtx.getRootArchive(), "gles31/")
+       , m_context                     (DE_NULL)
+       , m_waiverMechanism (new tcu::WaiverUtil)
+{
+}
+
+TestPackageGL45::~TestPackageGL45 (void)
+{
+       // Destroy children first since destructors may access context.
+       TestNode::deinit();
+       delete m_context;
+}
+
+void TestPackageGL45::init (void)
+{
+       try
+       {
+               // Create context
+               m_context = new Context(m_testCtx, glu::ApiType::core(4, 5));
+
+               // Setup waiver mechanism
+               if (m_testCtx.getCommandLine().getRunMode() == tcu::RUNMODE_EXECUTE)
+               {
+                       const glu::ContextInfo& contextInfo = m_context->getContextInfo();
+                       std::string                             vendor          = contextInfo.getString(GL_VENDOR);
+                       std::string                             renderer        = contextInfo.getString(GL_RENDERER);
+                       const tcu::CommandLine& commandLine     = m_context->getTestContext().getCommandLine();
+                       tcu::SessionInfo                sessionInfo     (vendor, renderer, commandLine.getInitialCmdLine());
+                       m_waiverMechanism->setup(commandLine.getWaiverFileName(), m_name, vendor, renderer, sessionInfo);
+                       m_context->getTestContext().getLog().writeSessionInfo(sessionInfo.get());
+               }
+
+               // Add main test groups
+               addChild(new InfoTests                                          (*m_context));
+               addChild(new Functional::FunctionalTests        (*m_context));
+       }
+       catch (...)
+       {
+               delete m_context;
+               m_context = DE_NULL;
+
+               throw;
+       }
+}
+
+void TestPackageGL45::deinit (void)
+{
+       TestNode::deinit();
+       delete m_context;
+       m_context = DE_NULL;
+}
+
+tcu::TestCaseExecutor* TestPackageGL45::createExecutor (void) const
+{
+       return new TestCaseWrapper<TestPackageGL45>(const_cast<TestPackageGL45&>(*this), m_waiverMechanism);
+}
+
+} // gles31
+} // deqp
diff --git a/modules/gles31/tgl45TestPackage.hpp b/modules/gles31/tgl45TestPackage.hpp
new file mode 100644 (file)
index 0000000..2641396
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef _TGL45TESTPACKAGE_HPP
+#define _TGL45TESTPACKAGE_HPP
+/*-------------------------------------------------------------------------
+ * OpenGL Conformance Test Suite
+ * -----------------------------
+ *
+ * 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.
+ *
+ */ /*!
+ * \file
+ * \brief OpenGL ES 3.1 Test Package that runs on GL4.5 context
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestPackage.hpp"
+#include "tes31Context.hpp"
+#include "tcuResource.hpp"
+#include "deSharedPtr.hpp"
+
+namespace tcu
+{
+    class WaiverUtil;
+};
+
+namespace deqp
+{
+namespace gles31
+{
+
+class TestPackageGL45 : public tcu::TestPackage
+{
+public:
+                                                                       TestPackageGL45                 (tcu::TestContext& testCtx);
+       virtual                                                 ~TestPackageGL45                (void);
+
+       virtual void                                    init                                    (void);
+       virtual void                                    deinit                                  (void);
+
+       tcu::TestCaseExecutor*                  createExecutor                  (void) const;
+
+       tcu::Archive*                                   getArchive                              (void) { return &m_archive; }
+       Context*                                                getContext                              (void) { return m_context; }
+
+private:
+       tcu::ResourcePrefix                             m_archive;
+       Context*                                                m_context;
+    de::SharedPtr<tcu::WaiverUtil>     m_waiverMechanism;
+};
+
+} // gles31
+} // deqp
+
+#endif // _TGL45TESTPACKAGE_HPP