Merge changes from topic "am-2a5d4fce01b44aa8af624fa955e78159" into nyc-mr1-dev am...
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>
Sat, 13 Jan 2018 05:17:44 +0000 (05:17 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Sat, 13 Jan 2018 05:17:44 +0000 (05:17 +0000)
am: 1dba891b50

Change-Id: I365d4244082dda8b2088f2e54b78f166e5fad367

25 files changed:
Android.mk
CMakeLists.txt
OWNERS
android/cts/AndroidTest.xml
framework/common/tcuFuzzyImageCompare.cpp
framework/delibs/cmake/CFlags.cmake
framework/platform/CMakeLists.txt
framework/platform/android/tcuAndroidMain.cpp
framework/platform/lnx/X11/tcuLnxX11.cpp
framework/platform/surfaceless/tcuSurfacelessPlatform.cpp [new file with mode: 0644]
framework/platform/surfaceless/tcuSurfacelessPlatform.hpp [new file with mode: 0644]
modules/egl/teglColorClearCase.cpp
modules/egl/teglGLES2SharedRenderingPerfTests.cpp
modules/egl/teglImageTests.cpp
modules/egl/teglMultiThreadTests.cpp
modules/egl/teglNegativeApiTests.cpp
modules/egl/teglRenderTests.cpp
modules/egl/teglThreadCleanUpTests.cpp
modules/egl/teglWideColorTests.cpp
modules/gles2/functional/es2fTextureCompletenessTests.cpp
modules/gles31/functional/es31fFboSRGBWriteControlTests.cpp
modules/gles31/functional/es31fNegativeComputeTests.cpp
modules/glshared/glsBuiltinPrecisionTests.cpp
scripts/mustpass.py
targets/surfaceless/surfaceless.cmake [new file with mode: 0644]

index 7d60924..68e62b8 100644 (file)
@@ -1027,6 +1027,8 @@ deqp_compile_flags := \
        -DDEQP_GLES3_RUNTIME_LOAD=1 \
        -DDEQP_GLES2_RUNTIME_LOAD=1 \
        -DQP_SUPPORT_PNG=1 \
+       -Wall \
+       -Werror \
        -Wconversion \
        -fwrapv \
        -Wno-sign-conversion
@@ -1049,9 +1051,14 @@ LOCAL_CFLAGS += \
 
 LOCAL_SDK_VERSION := 22
 LOCAL_CPPFLAGS += -Wno-non-virtual-dtor -Wno-delete-non-virtual-dtor
-LOCAL_NDK_STL_VARIANT := gnustl_static
+LOCAL_NDK_STL_VARIANT := c++_static
 LOCAL_RTTI_FLAG := -frtti -fexceptions
 LOCAL_MULTILIB := both
+LOCAL_TIDY_CHECKS := \
+    -google-build-explicit-make-pair, \
+    -google-global-names-in-headers, \
+    -google-runtime-member-string-references, \
+    -google-runtime-operator, \
 
 include $(BUILD_SHARED_LIBRARY)
 
index 1ecdd52..445cf7c 100644 (file)
@@ -57,8 +57,14 @@ endif ()
 include_directories(${ZLIB_INCLUDE_PATH})
 
 # libpng
-find_path(PNG_INCLUDE_PATH     png.h)
-find_library(PNG_LIBRARY       png)
+#
+# The FindPNG module defines PNG_INCLUDE_DIRS and PNG_LIBRARIES. But dEQP's
+# CMake files expect the non-standard PNG_INCLUDE_PATH and PNG_LIBRARY. Set the
+# non-standard variables here to retain compatibility with dEQP's existing
+# CMake files.
+include(FindPNG)
+set(PNG_INCLUDE_PATH ${PNG_INCLUDE_DIRS})
+set(PNG_LIBRARY ${PNG_LIBRARIES})
 
 if (NOT PNG_INCLUDE_PATH OR NOT PNG_LIBRARY)
        message(STATUS "System version of libpng not found, using external/libpng")
diff --git a/OWNERS b/OWNERS
index 03695dd..579961c 100644 (file)
--- a/OWNERS
+++ b/OWNERS
@@ -1,4 +1,7 @@
-phaulos@google.com
 tinazh@google.com
-misojarvi@google.com
-kraita@google.com
+chrisforbes@google.com
+
+# We miss you
+# phaulos@google.com
+# kraita@google.com
+# misojarvi@google.com
index a880b85..1851772 100644 (file)
@@ -18,6 +18,7 @@
        <!--
      This file has been automatically generated. Edit with caution.
      -->
+       <option name="test-suite-tag" value="cts"/>
        <option key="component" name="config-descriptor:metadata" value="deqp"/>
        <test class="com.drawelements.deqp.runner.DeqpTestRunner">
                <option name="deqp-package" value="dEQP-EGL"/>
index 596ab83..4e76476 100644 (file)
@@ -318,7 +318,7 @@ float fuzzyCompare (const FuzzyCompareParams& params, const ConstPixelBufferAcce
 
        for (int y = 1; y < height-1; y++)
        {
-               for (int x = 1; x < width-1; x += params.maxSampleSkip > 0 ? (int)rnd.getInt(0, params.maxSampleSkip) : 1)
+               for (int x = 1; x < width-1; x += 1 + (int)rnd.getInt(0, params.maxSampleSkip))
                {
                        const deUint32  minDist2RefToCmp        = distSquaredToNeighbor<4>(rnd, readUnorm8<4>(refAccess, x, y), cmpAccess, x, y);
                        const deUint32  minDist2CmpToRef        = distSquaredToNeighbor<4>(rnd, readUnorm8<4>(cmpAccess, x, y), refAccess, x, y);
index 8a4b9ad..bcb11ab 100644 (file)
@@ -53,6 +53,11 @@ if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
        # Turn on -Wstrict-overflow=5 and check all warnings before removing
        set(CMAKE_C_FLAGS                       "${CMAKE_C_FLAGS} -fwrapv")
        set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fwrapv")
+
+       # Force compiler to not export any symbols.
+       # Any static libraries build are linked into the standalone executable binaries.
+       set(CMAKE_C_FLAGS                       "${CMAKE_C_FLAGS} -fvisibility=hidden")
+       set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
 elseif (DE_COMPILER_IS_MSC)
        # Compiler flags for msc
 
index d13f8c9..77a5447 100644 (file)
@@ -83,6 +83,12 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
                        include_directories(wayland)
                endif()
 
+       elseif (DE_OS_IS_UNIX AND DEQP_USE_SURFACELESS)
+               set(TCUTIL_PLATFORM_SRCS
+                       surfaceless/tcuSurfacelessPlatform.hpp
+                       surfaceless/tcuSurfacelessPlatform.cpp
+                       )
+
        elseif (DE_OS_IS_ANDROID)
                set(TCUTIL_PLATFORM_SRCS
                        android/tcuAndroidExecService.cpp
index fa14c1e..620b9f6 100644 (file)
@@ -34,7 +34,7 @@
 
 DE_BEGIN_EXTERN_C
 
-void createTestActivity (ANativeActivity* activity, void* savedState, size_t savedStateSize)
+JNIEXPORT void JNICALL createTestActivity (ANativeActivity* activity, void* savedState, size_t savedStateSize)
 {
        DE_UNREF(savedState && savedStateSize);
        try
index 3f72b2b..5aef054 100644 (file)
@@ -55,6 +55,13 @@ WindowBase::~WindowBase (void)
 XlibDisplay::XlibDisplay (EventState& eventState, const char* name)
        : DisplayBase   (eventState)
 {
+       // From man:XinitThreads(3):
+       //
+       //     The XInitThreads function initializes Xlib support for concurrent
+       //     threads.  This function must be the first Xlib function
+       //     a multi-threaded program calls, and it must complete before any other
+       //     Xlib call is made.
+       DE_CHECK_RUNTIME_ERR(XInitThreads() != 0);
        m_display = XOpenDisplay((char*)name); // Won't modify argument string.
        if (!m_display)
                throw ResourceError("Failed to open display", name, __FILE__, __LINE__);
diff --git a/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp b/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
new file mode 100644 (file)
index 0000000..f1fb2d5
--- /dev/null
@@ -0,0 +1,476 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2015 Intel Corporation
+ *
+ * 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 surfaceless platform
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuSurfacelessPlatform.hpp"
+
+#include <string>
+#include <vector>
+#include <sys/utsname.h>
+
+#include "deDynamicLibrary.hpp"
+#include "deMemory.h"
+#include "deSTLUtil.hpp"
+#include "egluUtil.hpp"
+#include "egluGLUtil.hpp"
+#include "eglwEnums.hpp"
+#include "eglwLibrary.hpp"
+#include "gluPlatform.hpp"
+#include "gluRenderConfig.hpp"
+#include "glwInitES20Direct.hpp"
+#include "glwInitES30Direct.hpp"
+#include "glwInitFunctions.hpp"
+#include "tcuFunctionLibrary.hpp"
+#include "tcuPixelFormat.hpp"
+#include "tcuPlatform.hpp"
+#include "tcuRenderTarget.hpp"
+#include "vkPlatform.hpp"
+
+#include <EGL/egl.h>
+
+using std::string;
+using std::vector;
+
+#if !defined(EGL_KHR_create_context)
+       #define EGL_CONTEXT_FLAGS_KHR                                   0x30FC
+       #define EGL_CONTEXT_MAJOR_VERSION_KHR                           0x3098
+       #define EGL_CONTEXT_MINOR_VERSION_KHR                           0x30FB
+       #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR        0x00000002
+       #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR                 0x00000001
+       #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR                        0x00000001
+       #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR           0x00000002
+       #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR                     0x30FD
+       #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR      0x31BD
+       #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR                0x00000004
+       #define EGL_KHR_create_context                                  1
+       #define EGL_LOSE_CONTEXT_ON_RESET_KHR                           0x31BF
+       #define EGL_NO_RESET_NOTIFICATION_KHR                           0x31BE
+       #define EGL_OPENGL_ES3_BIT_KHR                                  0x00000040
+#endif // EGL_KHR_create_context
+
+// Default library names
+#if !defined(DEQP_GLES2_LIBRARY_PATH)
+#      define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so"
+#endif
+
+#if !defined(DEQP_GLES3_LIBRARY_PATH)
+#      define DEQP_GLES3_LIBRARY_PATH DEQP_GLES2_LIBRARY_PATH
+#endif
+
+#if !defined(DEQP_OPENGL_LIBRARY_PATH)
+#      define DEQP_OPENGL_LIBRARY_PATH "libGL.so"
+#endif
+
+namespace tcu
+{
+namespace surfaceless
+{
+
+class VulkanLibrary : public vk::Library
+{
+public:
+       VulkanLibrary (void)
+               : m_library     ("libvulkan.so.1")
+               , m_driver      (m_library)
+       {
+       }
+
+       const vk::PlatformInterface& getPlatformInterface (void) const
+       {
+               return m_driver;
+       }
+
+private:
+       const tcu::DynamicFunctionLibrary       m_library;
+       const vk::PlatformDriver                        m_driver;
+};
+
+// Copied from tcuX11Platform.cpp
+class VulkanPlatform : public vk::Platform
+{
+public:
+       vk::Library* createLibrary (void) const
+       {
+               return new VulkanLibrary();
+       }
+
+       void describePlatform (std::ostream& dst) const
+       {
+               utsname         sysInfo;
+
+               deMemset(&sysInfo, 0, sizeof(sysInfo));
+
+               if (uname(&sysInfo) != 0)
+                       throw std::runtime_error("uname() failed");
+
+               dst << "OS: " << sysInfo.sysname << " " << sysInfo.release << " " << sysInfo.version << "\n";
+               dst << "CPU: " << sysInfo.machine << "\n";
+       }
+
+       // FINISHME: Query actual memory limits.
+       //
+       // These hard-coded memory limits were copied from tcuX11Platform.cpp,
+       // and they work well enough for Intel platforms.
+       void getMemoryLimits (vk::PlatformMemoryLimits& limits) const
+       {
+               limits.totalSystemMemory                                        = 256*1024*1024;
+               limits.totalDeviceLocalMemory                           = 128*1024*1024;
+               limits.deviceMemoryAllocationGranularity        = 64*1024;
+               limits.devicePageSize                                           = 4096;
+               limits.devicePageTableEntrySize                         = 8;
+               limits.devicePageTableHierarchyLevels           = 3;
+       }
+};
+
+bool isEGLExtensionSupported(
+               const eglw::Library& egl,
+               eglw::EGLDisplay display,
+               const std::string& extName)
+{
+       const vector<string> exts = eglu::getClientExtensions(egl);
+       return de::contains(exts.begin(), exts.end(), extName);
+}
+
+class GetProcFuncLoader : public glw::FunctionLoader
+{
+public:
+       GetProcFuncLoader(const eglw::Library& egl): m_egl(egl)
+       {
+       }
+
+       glw::GenericFuncType get(const char* name) const
+       {
+               return (glw::GenericFuncType)m_egl.getProcAddress(name);
+       }
+protected:
+       const eglw::Library& m_egl;
+};
+
+class DynamicFuncLoader : public glw::FunctionLoader
+{
+public:
+       DynamicFuncLoader(de::DynamicLibrary* library): m_library(library)
+       {
+       }
+
+       glw::GenericFuncType get(const char* name) const
+       {
+               return (glw::GenericFuncType)m_library->getFunction(name);
+       }
+
+private:
+       de::DynamicLibrary*             m_library;
+};
+
+class Platform : public tcu::Platform, public glu::Platform
+{
+public:
+                                       Platform        (void);
+       const glu::Platform&            getGLPlatform   (void) const { return *this; }
+       const vk::Platform&                     getVulkanPlatform       (void) const { return m_vkPlatform; }
+
+private:
+       VulkanPlatform          m_vkPlatform;
+};
+
+class ContextFactory : public glu::ContextFactory
+{
+public:
+                                       ContextFactory  (void);
+       glu::RenderContext*             createContext   (const glu::RenderConfig& config, const tcu::CommandLine& cmdLine) const;
+};
+
+class EglRenderContext : public glu::RenderContext
+{
+public:
+                                       EglRenderContext(const glu::RenderConfig& config, const tcu::CommandLine& cmdLine);
+                                       ~EglRenderContext(void);
+
+       glu::ContextType                getType         (void) const    { return m_contextType; }
+       const glw::Functions&           getFunctions    (void) const    { return m_glFunctions; }
+       const tcu::RenderTarget&        getRenderTarget (void) const;
+       void                            postIterate     (void);
+
+private:
+       const eglw::DefaultLibrary      m_egl;
+       const glu::ContextType          m_contextType;
+       eglw::EGLDisplay                m_eglDisplay;
+       eglw::EGLContext                m_eglContext;
+       de::DynamicLibrary*             m_glLibrary;
+       glw::Functions                  m_glFunctions;
+       tcu::RenderTarget               m_renderTarget;
+};
+
+Platform::Platform(void)
+{
+       m_contextFactoryRegistry.registerFactory(new ContextFactory());
+}
+
+ContextFactory::ContextFactory()
+       : glu::ContextFactory("default", "EGL surfaceless context")
+{}
+
+glu::RenderContext* ContextFactory::createContext(const glu::RenderConfig& config, const tcu::CommandLine& cmdLine) const
+{
+       return new EglRenderContext(config, cmdLine);
+}
+
+EglRenderContext::EglRenderContext(const glu::RenderConfig& config, const tcu::CommandLine& cmdLine)
+       : m_egl("libEGL.so")
+       , m_contextType(config.type)
+       , m_eglDisplay(EGL_NO_DISPLAY)
+       , m_eglContext(EGL_NO_CONTEXT)
+       , m_renderTarget(
+                       config.width,
+                       config.height,
+                       tcu::PixelFormat(
+                                       config.redBits,
+                                       config.greenBits,
+                                       config.blueBits,
+                                       config.alphaBits),
+                       config.depthBits,
+                       config.stencilBits,
+                       config.numSamples)
+
+{
+       vector<eglw::EGLint>    context_attribs;
+       vector<eglw::EGLint>    frame_buffer_attribs;
+       vector<eglw::EGLint>    surface_attribs;
+
+       const glu::ContextType& contextType = config.type;
+       eglw::EGLint            eglMajorVersion;
+       eglw::EGLint            eglMinorVersion;
+       eglw::EGLint            flags = 0;
+       eglw::EGLint            num_configs;
+       eglw::EGLConfig         egl_config;
+       eglw::EGLSurface        egl_surface;
+
+       (void) cmdLine;
+
+       m_eglDisplay = m_egl.getDisplay(NULL);
+       EGLU_CHECK_MSG(m_egl, "eglGetDisplay()");
+       if (m_eglDisplay == EGL_NO_DISPLAY)
+               throw tcu::ResourceError("eglGetDisplay() failed");
+
+       EGLU_CHECK_CALL(m_egl, initialize(m_eglDisplay, &eglMajorVersion, &eglMinorVersion));
+
+       frame_buffer_attribs.push_back(EGL_RENDERABLE_TYPE);
+       switch(contextType.getMajorVersion())
+       {
+               case 3:
+                       frame_buffer_attribs.push_back(EGL_OPENGL_ES3_BIT);
+                       break;
+               case 2:
+                       frame_buffer_attribs.push_back(EGL_OPENGL_ES2_BIT);
+                       break;
+               default:
+                       frame_buffer_attribs.push_back(EGL_OPENGL_ES_BIT);
+       }
+
+       frame_buffer_attribs.push_back(EGL_SURFACE_TYPE);
+       switch (config.surfaceType)
+       {
+               case glu::RenderConfig::SURFACETYPE_DONT_CARE:
+                       frame_buffer_attribs.push_back(EGL_DONT_CARE);
+                       break;
+               case glu::RenderConfig::SURFACETYPE_OFFSCREEN_NATIVE:
+                       break;
+               case glu::RenderConfig::SURFACETYPE_OFFSCREEN_GENERIC:
+                       frame_buffer_attribs.push_back(EGL_PBUFFER_BIT);
+                       surface_attribs.push_back(EGL_WIDTH);
+                       surface_attribs.push_back(config.width);
+                       surface_attribs.push_back(EGL_HEIGHT);
+                       surface_attribs.push_back(config.height);
+                       break;
+               case glu::RenderConfig::SURFACETYPE_WINDOW:
+                       throw tcu::NotSupportedError("surfaceless platform does not support --deqp-surface-type=window");
+               case glu::RenderConfig::SURFACETYPE_LAST:
+                       TCU_CHECK_INTERNAL(false);
+       }
+
+       surface_attribs.push_back(EGL_NONE);
+
+       frame_buffer_attribs.push_back(EGL_RED_SIZE);
+       frame_buffer_attribs.push_back(config.redBits);
+
+       frame_buffer_attribs.push_back(EGL_GREEN_SIZE);
+       frame_buffer_attribs.push_back(config.greenBits);
+
+       frame_buffer_attribs.push_back(EGL_BLUE_SIZE);
+       frame_buffer_attribs.push_back(config.blueBits);
+
+       frame_buffer_attribs.push_back(EGL_ALPHA_SIZE);
+       frame_buffer_attribs.push_back(config.alphaBits);
+
+       frame_buffer_attribs.push_back(EGL_DEPTH_SIZE);
+       frame_buffer_attribs.push_back(config.depthBits);
+
+       frame_buffer_attribs.push_back(EGL_STENCIL_SIZE);
+       frame_buffer_attribs.push_back(config.stencilBits);
+
+       frame_buffer_attribs.push_back(EGL_NONE);
+
+       if (!eglChooseConfig(m_eglDisplay, &frame_buffer_attribs[0], NULL, 0, &num_configs))
+               throw tcu::ResourceError("surfaceless couldn't find any config");
+
+       if (!eglChooseConfig(m_eglDisplay, &frame_buffer_attribs[0], &egl_config, 1, &num_configs))
+               throw tcu::ResourceError("surfaceless couldn't find any config");
+
+       switch (config.surfaceType)
+       {
+               case glu::RenderConfig::SURFACETYPE_DONT_CARE:
+                       egl_surface = EGL_NO_SURFACE;
+                       break;
+               case glu::RenderConfig::SURFACETYPE_OFFSCREEN_GENERIC:
+                       egl_surface = eglCreatePbufferSurface(m_eglDisplay, egl_config, &surface_attribs[0]);
+                       break;
+       }
+
+       context_attribs.push_back(EGL_CONTEXT_MAJOR_VERSION_KHR);
+       context_attribs.push_back(contextType.getMajorVersion());
+       context_attribs.push_back(EGL_CONTEXT_MINOR_VERSION_KHR);
+       context_attribs.push_back(contextType.getMinorVersion());
+
+       switch (contextType.getProfile())
+       {
+               case glu::PROFILE_ES:
+                       EGLU_CHECK_CALL(m_egl, bindAPI(EGL_OPENGL_ES_API));
+                       break;
+               case glu::PROFILE_CORE:
+                       EGLU_CHECK_CALL(m_egl, bindAPI(EGL_OPENGL_API));
+                       context_attribs.push_back(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
+                       context_attribs.push_back(EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR);
+                       break;
+               case glu::PROFILE_COMPATIBILITY:
+                       EGLU_CHECK_CALL(m_egl, bindAPI(EGL_OPENGL_API));
+                       context_attribs.push_back(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
+                       context_attribs.push_back(EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR);
+                       break;
+               case glu::PROFILE_LAST:
+                       TCU_CHECK_INTERNAL(false);
+       }
+
+       if ((contextType.getFlags() & glu::CONTEXT_DEBUG) != 0)
+               flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
+
+       if ((contextType.getFlags() & glu::CONTEXT_ROBUST) != 0)
+               flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
+
+       if ((contextType.getFlags() & glu::CONTEXT_FORWARD_COMPATIBLE) != 0)
+               flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
+
+       context_attribs.push_back(EGL_CONTEXT_FLAGS_KHR);
+       context_attribs.push_back(flags);
+
+       context_attribs.push_back(EGL_NONE);
+
+       m_eglContext = m_egl.createContext(m_eglDisplay, egl_config, EGL_NO_CONTEXT, &context_attribs[0]);
+       EGLU_CHECK_MSG(m_egl, "eglCreateContext()");
+       if (!m_eglContext)
+               throw tcu::ResourceError("eglCreateContext failed");
+
+       EGLU_CHECK_CALL(m_egl, makeCurrent(m_eglDisplay, egl_surface, egl_surface, m_eglContext));
+
+       if ((eglMajorVersion == 1 && eglMinorVersion >= 5) ||
+               isEGLExtensionSupported(m_egl, m_eglDisplay, "EGL_KHR_get_all_proc_addresses") ||
+               isEGLExtensionSupported(m_egl, EGL_NO_DISPLAY, "EGL_KHR_client_get_all_proc_addresses"))
+       {
+               // Use eglGetProcAddress() for core functions
+               GetProcFuncLoader funcLoader(m_egl);
+               glu::initCoreFunctions(&m_glFunctions, &funcLoader, contextType.getAPI());
+       }
+#if !defined(DEQP_GLES2_RUNTIME_LOAD)
+       else if (contextType.getAPI() == glu::ApiType::es(2,0))
+       {
+               glw::initES20Direct(&m_glFunctions);
+       }
+#endif
+#if !defined(DEQP_GLES3_RUNTIME_LOAD)
+       else if (contextType.getAPI() == glu::ApiType::es(3,0))
+       {
+               glw::initES30Direct(&m_glFunctions);
+       }
+#endif
+       else
+       {
+               const char* libraryPath = NULL;
+
+               if (glu::isContextTypeES(contextType))
+               {
+                       if (contextType.getMinorVersion() <= 2)
+                               libraryPath = DEQP_GLES2_LIBRARY_PATH;
+                       else
+                               libraryPath = DEQP_GLES3_LIBRARY_PATH;
+               }
+               else
+               {
+                       libraryPath = DEQP_OPENGL_LIBRARY_PATH;
+               }
+
+               m_glLibrary = new de::DynamicLibrary(libraryPath);
+
+               DynamicFuncLoader funcLoader(m_glLibrary);
+               glu::initCoreFunctions(&m_glFunctions, &funcLoader, contextType.getAPI());
+       }
+
+       {
+               GetProcFuncLoader extLoader(m_egl);
+               glu::initExtensionFunctions(&m_glFunctions, &extLoader, contextType.getAPI());
+       }
+}
+
+EglRenderContext::~EglRenderContext(void)
+{
+       try
+       {
+               if (m_eglDisplay != EGL_NO_DISPLAY)
+               {
+                       EGLU_CHECK_CALL(m_egl, makeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
+
+                       if (m_eglContext != EGL_NO_CONTEXT)
+                               EGLU_CHECK_CALL(m_egl, destroyContext(m_eglDisplay, m_eglContext));
+               }
+
+               EGLU_CHECK_CALL(m_egl, terminate(m_eglDisplay));
+       }
+       catch (...)
+       {
+       }
+}
+
+const tcu::RenderTarget& EglRenderContext::getRenderTarget(void) const
+{
+       return m_renderTarget;
+}
+
+void EglRenderContext::postIterate(void)
+{
+       this->getFunctions().finish();
+}
+
+} // namespace surfaceless
+} // namespace tcu
+
+tcu::Platform* createPlatform(void)
+{
+       return new tcu::surfaceless::Platform();
+}
diff --git a/framework/platform/surfaceless/tcuSurfacelessPlatform.hpp b/framework/platform/surfaceless/tcuSurfacelessPlatform.hpp
new file mode 100644 (file)
index 0000000..81978a3
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _TCUSURFACELESSPLATFORM_HPP
+#define _TCUSURFACELESSPLATFORM_HPP
+
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2015 Intel Corporation
+ *
+ * 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 DRM platform
+ *//*--------------------------------------------------------------------*/
+
+namespace tcu
+{
+       class Platform;
+}
+
+tcu::Platform* createPlatform (void);
+
+#endif // _TCUSURFACELESSPLATFORM_HPP
index 8ae8b4c..92cbd8f 100644 (file)
@@ -310,6 +310,7 @@ public:
                        // Signal completion.
                        packetIter->signal->increment();
                }
+               m_egl.releaseThread();
        }
 
 private:
index bc13aad..7d334c9 100644 (file)
@@ -717,7 +717,7 @@ void TestContext::render (void)
 class TestThread : de::Thread
 {
 public:
-                                       TestThread              (const vector<TestContext*> contexts);
+                                       TestThread              (const vector<TestContext*> contexts, const Library& egl);
                                        ~TestThread             (void);
 
        void                    start                   (void);
@@ -727,6 +727,7 @@ public:
 
 private:
        vector<TestContext*>    m_contexts;
+       const Library&                  m_egl;
        bool                                    m_isOk;
        string                                  m_errorString;
 
@@ -746,8 +747,9 @@ private:
                                        TestThread      (const TestThread&);
 };
 
-TestThread::TestThread (const vector<TestContext*> contexts)
+TestThread::TestThread (const vector<TestContext*> contexts, const Library& egl)
        : m_contexts            (contexts)
+       , m_egl                         (egl)
        , m_isOk                        (false)
        , m_errorString         ("")
        , m_beginTimeUs         (0)
@@ -800,6 +802,8 @@ void TestThread::run (void)
                m_isOk                  = false;
                m_errorString   = "Got unknown exception";
        }
+
+       m_egl.releaseThread();
 }
 
 class SharedRenderingPerfCase : public TestCase
@@ -879,7 +883,7 @@ void SharedRenderingPerfCase::deinit (void)
 namespace
 {
 
-void createThreads (vector<TestThread*>& threads, int threadCount, int perThreadContextCount, vector<TestContext*>& contexts)
+void createThreads (vector<TestThread*>& threads, int threadCount, int perThreadContextCount, vector<TestContext*>& contexts, const Library& egl)
 {
        DE_ASSERT(threadCount * perThreadContextCount == (int)contexts.size());
        DE_ASSERT(threads.empty());
@@ -891,7 +895,7 @@ void createThreads (vector<TestThread*>& threads, int threadCount, int perThread
                for (int contextNdx = 0; contextNdx < perThreadContextCount; contextNdx++)
                        threadContexts.push_back(contexts[threadNdx * perThreadContextCount + contextNdx]);
 
-               threads.push_back(new TestThread(threadContexts));
+               threads.push_back(new TestThread(threadContexts, egl));
 
                threadContexts.clear();
        }
@@ -1036,7 +1040,7 @@ TestCase::IterateResult SharedRenderingPerfCase::iterate (void)
        if (m_results.empty())
                logTestConfig(m_testCtx.getLog(), m_config);
 
-       createThreads(threads, m_config.threadCount, m_config.perThreadContextCount, m_contexts);
+       createThreads(threads, m_config.threadCount, m_config.perThreadContextCount, m_contexts, m_eglTestCtx.getLibrary());
 
        beginTimeUs = deGetMicroseconds();
 
index aa1b666..fd01af3 100644 (file)
@@ -194,6 +194,15 @@ public:
 
        IterateResult iterate (void)
        {
+               const Library& egl = m_eglTestCtx.getLibrary();
+
+               if (eglu::getVersion(egl, m_display) < eglu::Version(1, 5) &&
+                       !eglu::hasExtension(egl, m_display, "EGL_KHR_image") &&
+                       !eglu::hasExtension(egl, m_display, "EGL_KHR_image_base"))
+               {
+                       TCU_THROW(NotSupportedError, "EGLimages not supported");
+               }
+
 #define CHECK_CREATE(MSG, DPY, CONTEXT, SOURCE, ERR) checkCreate(MSG, DPY, #DPY, CONTEXT, #CONTEXT, SOURCE, #SOURCE, ERR)
                CHECK_CREATE("Testing bad display (-1)...", (EGLDisplay)-1, EGL_NO_CONTEXT, EGL_NONE, EGL_BAD_DISPLAY);
                CHECK_CREATE("Testing bad context (-1)...", m_display, (EGLContext)-1, EGL_NONE, EGL_BAD_CONTEXT);
index 21952a9..9a98245 100644 (file)
@@ -110,9 +110,6 @@ public:
                THREADSTATUS_NOT_STARTED = 0,
                THREADSTATUS_RUNNING,
                THREADSTATUS_READY,
-
-               THREADSTATUS_NOT_SUPPORTED,
-               THREADSTATUS_ERROR
        };
 
                                        TestThread      (MultiThreadedTest& test, int id);
@@ -149,18 +146,20 @@ public:
 
        virtual bool                    runThread                       (TestThread& thread) = 0;
        virtual IterateResult   iterate                         (void);
-       bool                                    execTest                        (TestThread& thread);
+       void                                    execTest                        (TestThread& thread);
 
        const Library&                  getLibrary                      (void) const { return m_eglTestCtx.getLibrary(); }
 
 protected:
-       void                                    barrier                         (TestThread& thread);
+       void                                    barrier                         (void);
 
 private:
        int                                             m_threadCount;
        bool                                    m_initialized;
        deUint64                                m_startTimeUs;
        const deUint64                  m_timeoutUs;
+       bool                                    m_ok;
+       bool                                    m_supported;
        vector<TestThread*>             m_threads;
 
        volatile deInt32                m_barrierWaiters;
@@ -189,10 +188,7 @@ void TestThread::run (void)
 
        try
        {
-               if (m_test.execTest(*this))
-                       m_status = THREADSTATUS_READY;
-               else
-                       m_status = THREADSTATUS_ERROR;
+               m_test.execTest(*this);
        }
        catch (const TestThread::TestStop&)
        {
@@ -210,15 +206,17 @@ void TestThread::run (void)
        {
                getLog() << ThreadLog::BeginMessage << "Unknown exception" << ThreadLog::EndMessage;
        }
+
+       getLibrary().releaseThread();
+       m_status = THREADSTATUS_READY;
 }
 
-bool MultiThreadedTest::execTest (TestThread& thread)
+void MultiThreadedTest::execTest (TestThread& thread)
 {
-       bool isOk = false;
-
        try
        {
-               isOk = runThread(thread);
+               if (!runThread(thread))
+                       m_ok = false;
        }
        catch (const TestThread::TestStop&)
        {
@@ -227,9 +225,7 @@ bool MultiThreadedTest::execTest (TestThread& thread)
        }
        catch (const tcu::NotSupportedError&)
        {
-               // Set status of each thread
-               for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
-                       m_threads[threadNdx]->setStatus(TestThread::THREADSTATUS_NOT_SUPPORTED);
+               m_supported = false;
 
                // Release barriers
                for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
@@ -242,9 +238,7 @@ bool MultiThreadedTest::execTest (TestThread& thread)
        }
        catch(...)
        {
-               // Set status of each thread
-               for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
-                       m_threads[threadNdx]->setStatus(TestThread::THREADSTATUS_ERROR);
+               m_ok = false;
 
                // Release barriers
                for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
@@ -255,8 +249,6 @@ bool MultiThreadedTest::execTest (TestThread& thread)
 
                throw;
        }
-
-       return isOk;
 }
 
 MultiThreadedTest::MultiThreadedTest (EglTestContext& eglTestCtx, const char* name, const char* description, int threadCount, deUint64 timeoutUs)
@@ -265,7 +257,8 @@ MultiThreadedTest::MultiThreadedTest (EglTestContext& eglTestCtx, const char* na
        , m_initialized                 (false)
        , m_startTimeUs                 (0)
        , m_timeoutUs                   (timeoutUs)
-
+       , m_ok                                  (true)
+       , m_supported                   (true)
        , m_barrierWaiters              (0)
        , m_barrierSemaphore1   (0, 0)
        , m_barrierSemaphore2   (1, 0)
@@ -295,7 +288,7 @@ void MultiThreadedTest::deinit (void)
        }
 }
 
-void MultiThreadedTest::barrier (TestThread& thread)
+void MultiThreadedTest::barrier (void)
 {
        {
                const deInt32 waiters = deAtomicIncrement32(&m_barrierWaiters);
@@ -328,7 +321,7 @@ void MultiThreadedTest::barrier (TestThread& thread)
        }
 
        // Barrier was released due an error in other thread
-       if (thread.getStatus() != TestThread::THREADSTATUS_RUNNING)
+       if (!m_ok || !m_supported)
                throw TestThread::TestStop();
 }
 
@@ -338,6 +331,9 @@ TestCase::IterateResult MultiThreadedTest::iterate (void)
        {
                m_testCtx.getLog() << tcu::TestLog::Message << "Thread timeout limit: " << m_timeoutUs << "us" << tcu::TestLog::EndMessage;
 
+               m_ok = true;
+               m_supported = true;
+
                // Create threads
                m_threads.reserve(m_threadCount);
 
@@ -366,18 +362,6 @@ TestCase::IterateResult MultiThreadedTest::iterate (void)
                for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
                        m_threads[threadNdx]->join();
 
-               bool isOk                       = true;
-               bool notSupported       = false;
-
-               for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
-               {
-                       if (m_threads[threadNdx]->getStatus() == TestThread::THREADSTATUS_ERROR)
-                               isOk = false;
-
-                       if (m_threads[threadNdx]->getStatus() == TestThread::THREADSTATUS_NOT_SUPPORTED)
-                               notSupported = true;
-               }
-
                // Get logs
                {
                        vector<int> messageNdx;
@@ -417,9 +401,9 @@ TestCase::IterateResult MultiThreadedTest::iterate (void)
                m_threads.clear();
 
                // Set result
-               if (isOk)
+               if (m_ok)
                {
-                       if (notSupported)
+                       if (!m_supported)
                                m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Not Supported");
                        else
                                m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
@@ -553,7 +537,7 @@ bool MultiThreadedConfigTest::runThread (TestThread& thread)
        de::Random                      rnd             (deInt32Hash(thread.getId() + 10435));
        vector<EGLConfig>       configs;
 
-       barrier(thread);
+       barrier();
 
        for (int getConfigsNdx = 0; getConfigsNdx < m_getConfigs; getConfigsNdx++)
        {
@@ -942,7 +926,7 @@ bool MultiThreadedObjectTest::runThread (TestThread& thread)
                        TCU_THROW(NotSupportedError, "No usable config found");
        }
 
-       barrier(thread);
+       barrier();
 
        // Create / Destroy Objects
        if ((m_types & TYPE_SINGLE_WINDOW) != 0 && (m_types & TYPE_PBUFFER) == 0 && (m_types & TYPE_PIXMAP) == 0 && (m_types & TYPE_CONTEXT) == 0)
@@ -957,30 +941,30 @@ bool MultiThreadedObjectTest::runThread (TestThread& thread)
        if (thread.getId() == 0)
                pushObjectsToShared(thread);
 
-       barrier(thread);
+       barrier();
 
        // Push second threads objects to shared
        if (thread.getId() == 1)
                pushObjectsToShared(thread);
 
-       barrier(thread);
+       barrier();
 
        // Make queries from shared surfaces
        querySetSharedObjects(thread, 100);
 
-       barrier(thread);
+       barrier();
 
        // Pull surfaces for first thread from shared surfaces
        if (thread.getId() == 0)
                pullObjectsFromShared(thread, (int)(m_sharedPbuffers.size()/2), (int)(m_sharedNativePixmaps.size()/2), (int)(m_sharedNativeWindows.size()/2), (int)(m_sharedContexts.size()/2));
 
-       barrier(thread);
+       barrier();
 
        // Pull surfaces for second thread from shared surfaces
        if (thread.getId() == 1)
                pullObjectsFromShared(thread, (int)m_sharedPbuffers.size(), (int)m_sharedNativePixmaps.size(), (int)m_sharedNativeWindows.size(), (int)m_sharedContexts.size());
 
-       barrier(thread);
+       barrier();
 
        // Create / Destroy Objects
        if ((m_types & TYPE_SINGLE_WINDOW) == 0)
index a33da58..b0bd938 100644 (file)
@@ -384,31 +384,55 @@ void NegativeApiTests::init (void)
 
                        log << TestLog::EndSection;
 
-                       log << TestLog::Section("Test4", "EGL_BAD_CONFIG is generated if OpenGL ES 1.x context is requested and EGL_RENDERABLE_TYPE attribute of config does not contain EGL_OPENGL_ES_BIT");
+                       log << TestLog::Section("Test4", "EGL_BAD_CONFIG or EGL_BAD_MATCH is generated if OpenGL ES 1.x context is requested and EGL_RENDERABLE_TYPE attribute of config does not contain EGL_OPENGL_ES_BIT");
 
                        if (isAPISupported(EGL_OPENGL_ES_API))
                        {
                                EGLConfig notES1Config;
                                if (getConfig(&notES1Config, FilterList() << notRenderable<EGL_OPENGL_ES_BIT>))
                                {
+                                       // EGL 1.4, EGL 1.5, and EGL_KHR_create_context contain contradictory language about the expected error.
+                                       Version version = eglu::getVersion(m_eglTestCtx.getLibrary(), display);
+                                       bool hasKhrCreateContext = eglu::hasExtension(m_eglTestCtx.getLibrary(), display, "EGL_KHR_create_context");
+
                                        expectTrue(eglBindAPI(EGL_OPENGL_ES_API));
                                        expectNoContext(eglCreateContext(display, notES1Config, EGL_NO_CONTEXT, s_es1ContextAttribList));
-                                       expectError(EGL_BAD_CONFIG);
+                                       if (hasKhrCreateContext)
+                                               expectEitherError(EGL_BAD_CONFIG, EGL_BAD_MATCH);
+                                       else
+                                       {
+                                               if (version >= eglu::Version(1, 5))
+                                                       expectError(EGL_BAD_MATCH);
+                                               else
+                                                       expectError(EGL_BAD_CONFIG);
+                                       }
                                }
                        }
 
                        log << TestLog::EndSection;
 
-                       log << TestLog::Section("Test5", "EGL_BAD_CONFIG is generated if OpenGL ES 2.x context is requested and EGL_RENDERABLE_TYPE attribute of config does not contain EGL_OPENGL_ES2_BIT");
+                       log << TestLog::Section("Test5", "EGL_BAD_CONFIG or EGL_BAD_MATCH is generated if OpenGL ES 2.x context is requested and EGL_RENDERABLE_TYPE attribute of config does not contain EGL_OPENGL_ES2_BIT");
 
                        if (isAPISupported(EGL_OPENGL_ES_API))
                        {
                                EGLConfig notES2Config;
                                if (getConfig(&notES2Config, FilterList() << notRenderable<EGL_OPENGL_ES2_BIT>))
                                {
+                                       // EGL 1.4, EGL 1.5, and EGL_KHR_create_context contain contradictory language about the expected error.
+                                       Version version = eglu::getVersion(m_eglTestCtx.getLibrary(), display);
+                                       bool hasKhrCreateContext = eglu::hasExtension(m_eglTestCtx.getLibrary(), display, "EGL_KHR_create_context");
+
                                        expectTrue(eglBindAPI(EGL_OPENGL_ES_API));
                                        expectNoContext(eglCreateContext(display, notES2Config, EGL_NO_CONTEXT, s_es2ContextAttribList));
-                                       expectError(EGL_BAD_CONFIG);
+                                       if (hasKhrCreateContext)
+                                               expectEitherError(EGL_BAD_CONFIG, EGL_BAD_MATCH);
+                                       else
+                                       {
+                                               if (version >= eglu::Version(1, 5))
+                                                       expectError(EGL_BAD_MATCH);
+                                               else
+                                                       expectError(EGL_BAD_CONFIG);
+                                       }
                                }
                        }
 
index 8b5b5c2..46b1780 100644 (file)
@@ -356,6 +356,37 @@ tcu::TextureFormat getColorFormat (const tcu::PixelFormat& colorBits)
 #undef PACK_FMT
 }
 
+/*
+The getColorThreshold function is used to obtain a
+threshold usable for the fuzzyCompare function.
+
+For 8bit color depths a value of 0.02 should provide
+a good metric for rejecting images above this level.
+For other bit depths other thresholds should be selected.
+Ideally this function would take advantage of the
+getColorThreshold function provided by the PixelFormat class
+as this would also allow setting per channel thresholds.
+However using the PixelFormat provided function can result
+in too strict thresholds for 8bit bit depths (compared to
+the current default of 0.02) or too relaxed for lower bit
+depths if scaled proportionally to the 8bit default.
+*/
+
+float getColorThreshold (const tcu::PixelFormat& colorBits)
+{
+       if ((colorBits.redBits > 0 && colorBits.redBits < 8) ||
+               (colorBits.greenBits > 0 && colorBits.greenBits < 8) ||
+               (colorBits.blueBits > 0 && colorBits.blueBits < 8) ||
+               (colorBits.alphaBits > 0 && colorBits.alphaBits < 8))
+       {
+               return 0.05f;
+       }
+       else
+       {
+               return 0.02f;
+       }
+}
+
 tcu::TextureFormat getDepthFormat (const int depthBits)
 {
        switch (depthBits)
@@ -699,9 +730,9 @@ void SingleThreadRenderCase::executeForContexts (EGLDisplay display, EGLSurface
        const int                               numContexts     = (int)contexts.size();
        const int                               drawsPerCtx     = 2;
        const int                               numIters        = 2;
-       const float                             threshold       = 0.02f;
-
        const tcu::PixelFormat  pixelFmt        = getPixelFormat(egl, display, config.config);
+       const float                             threshold       = getColorThreshold(pixelFmt);
+
        const int                               depthBits       = eglu::getConfigAttribInt(egl, display, config.config, EGL_DEPTH_SIZE);
        const int                               stencilBits     = eglu::getConfigAttribInt(egl, display, config.config, EGL_STENCIL_SIZE);
        const int                               numSamples      = eglu::getConfigAttribInt(egl, display, config.config, EGL_SAMPLES);
@@ -868,6 +899,7 @@ public:
                        // Signal completion.
                        packetIter->signal->increment();
                }
+               m_egl.releaseThread();
        }
 
 private:
@@ -902,9 +934,9 @@ void MultiThreadRenderCase::executeForContexts (EGLDisplay display, EGLSurface s
        const int                               packetsPerThread        = 2;
        const int                               numThreads                      = numContexts;
        const int                               numPackets                      = numThreads * packetsPerThread;
-       const float                             threshold                       = 0.02f;
-
        const tcu::PixelFormat  pixelFmt                        = getPixelFormat(egl, display, config.config);
+       const float                             threshold                       = getColorThreshold(pixelFmt);
+
        const int                               depthBits                       = eglu::getConfigAttribInt(egl, display, config.config, EGL_DEPTH_SIZE);
        const int                               stencilBits                     = eglu::getConfigAttribInt(egl, display, config.config, EGL_STENCIL_SIZE);
        const int                               numSamples                      = eglu::getConfigAttribInt(egl, display, config.config, EGL_SAMPLES);
index ffe3913..a3f64cb 100644 (file)
@@ -120,6 +120,8 @@ public:
                {
                        m_error = error;
                }
+
+               m_egl.releaseThread();
        }
 
 private:
index 20d4fff..31afd28 100644 (file)
@@ -406,7 +406,7 @@ void WideColorTest::checkFP16Support (void)
        if (numConfigs <= 0)
        {
                log << tcu::TestLog::Message << "No configs returned." << tcu::TestLog::EndMessage;
-               TCU_THROW(NotSupportedError, "10:10:10:2 pixel format is not supported");
+               TCU_THROW(NotSupportedError, "16:16:16:16 pixel format is not supported");
        }
 
        log << tcu::TestLog::Message << numConfigs << " configs returned" << tcu::TestLog::EndMessage;
index f83fec6..c81cd94 100644 (file)
@@ -128,7 +128,7 @@ public:
        IterateResult                   iterate                                 (void);
 
 protected:
-       virtual void                    createTexture                   (void) = 0;
+       virtual void                    createTexture                   (GLuint texture) = 0;
 
        tcu::TestContext&               m_testCtx;
        glu::RenderContext&             m_renderCtx;
@@ -160,12 +160,17 @@ Tex2DCompletenessCase::IterateResult Tex2DCompletenessCase::iterate (void)
 
        glViewport                              (offsetX, offsetY, viewportWidth, viewportHeight);
 
-       createTexture                   ();
+       GLuint texture;
+       glGenTextures(1, &texture);
+       createTexture(texture);
+
        renderer.renderQuad             (0, &texCoord[0], glu::TextureTestUtil::TEXTURETYPE_2D);
        glu::readPixels                 (m_renderCtx, offsetX, offsetY, renderedFrame.getAccess());
 
        bool isOk = compareToConstantColor(log, "Result", "Image comparison result", renderedFrame, tcu::COMPARE_LOG_RESULT, m_compareColor);
 
+       glDeleteTextures(1, &texture);
+
        m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS      : QP_TEST_RESULT_FAIL,
                                                        isOk ? "Pass"                           : "Image comparison failed");
        return STOP;
@@ -180,7 +185,7 @@ public:
        IterateResult                   iterate                                         (void);
 
 protected:
-       virtual void                    createTexture                           (void) = 0;
+       virtual void                    createTexture                           (GLuint texture) = 0;
 
        tcu::TestContext&               m_testCtx;
        glu::RenderContext&             m_renderCtx;
@@ -209,7 +214,9 @@ TexCubeCompletenessCase::IterateResult TexCubeCompletenessCase::iterate (void)
        int                                     offsetX                 = random.getInt(0, de::max(0,m_renderCtx.getRenderTarget().getWidth()   - 64));
        int                                     offsetY                 = random.getInt(0, de::max(0,m_renderCtx.getRenderTarget().getHeight()  - 64));
 
-       createTexture();
+       GLuint texture;
+       glGenTextures(1, &texture);
+       createTexture(texture);
 
        for (int face = 0; face < tcu::CUBEFACE_LAST; face++)
        {
@@ -226,6 +233,8 @@ TexCubeCompletenessCase::IterateResult TexCubeCompletenessCase::iterate (void)
                        allFacesOk = false;
        }
 
+       glDeleteTextures(1, &texture);
+
        m_testCtx.setTestResult(allFacesOk ? QP_TEST_RESULT_PASS        : QP_TEST_RESULT_FAIL,
                                                        allFacesOk ? "Pass"                                     : "Image comparison failed");
        return STOP;
@@ -239,7 +248,7 @@ public:
                                                                Incomplete2DSizeCase    (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, IVec2 invalidLevelSize, int invalidLevelNdx, const glu::ContextInfo& ctxInfo);
                                                                ~Incomplete2DSizeCase   (void) {}
 
-       virtual void                            createTexture                   (void);
+       virtual void                            createTexture                   (GLuint texture);
 
 private:
        int                                                     m_invalidLevelNdx;
@@ -257,7 +266,7 @@ Incomplete2DSizeCase::Incomplete2DSizeCase (tcu::TestContext& testCtx, glu::Rend
 {
 }
 
-void Incomplete2DSizeCase::createTexture (void)
+void Incomplete2DSizeCase::createTexture (GLuint texture)
 {
        static const char* const s_relaxingExtensions[] =
        {
@@ -269,8 +278,6 @@ void Incomplete2DSizeCase::createTexture (void)
        tcu::TextureLevel               levelData               (fmt);
        TestLog&                                log                             = m_testCtx.getLog();
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
@@ -315,7 +322,7 @@ public:
                                                        Incomplete2DFormatCase  (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, deUint32 format, deUint32 invalidFormat, int invalidLevelNdx);
                                                        ~Incomplete2DFormatCase (void) {}
 
-       virtual void                    createTexture                   (void);
+       virtual void                    createTexture                   (GLuint texture);
 
 private:
        int                                             m_invalidLevelNdx;
@@ -333,13 +340,11 @@ Incomplete2DFormatCase::Incomplete2DFormatCase (tcu::TestContext& testCtx, glu::
 {
 }
 
-void Incomplete2DFormatCase::createTexture (void)
+void Incomplete2DFormatCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(m_format, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
@@ -372,7 +377,7 @@ public:
                                                Incomplete2DMissingLevelCase    (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, int missingLevelNdx);
                                                ~Incomplete2DMissingLevelCase   (void) {}
 
-       virtual void            createTexture                                   (void);
+       virtual void            createTexture                                   (GLuint texture);
 
 private:
        int                                     m_missingLevelNdx;
@@ -386,13 +391,11 @@ Incomplete2DMissingLevelCase::Incomplete2DMissingLevelCase (tcu::TestContext& te
 {
 }
 
-void Incomplete2DMissingLevelCase::createTexture (void)
+void Incomplete2DMissingLevelCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
@@ -425,7 +428,7 @@ public:
                                                                Incomplete2DWrapModeCase        (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, deUint32 wrapT, deUint32 wrapS, const glu::ContextInfo& ctxInfo);
                                                                ~Incomplete2DWrapModeCase       (void) {}
 
-       virtual void                            createTexture                           (void);
+       virtual void                            createTexture                           (GLuint texture);
 
 private:
        deUint32                                        m_wrapT;
@@ -443,14 +446,12 @@ Incomplete2DWrapModeCase::Incomplete2DWrapModeCase (tcu::TestContext& testCtx, g
 {
 }
 
-void Incomplete2DWrapModeCase::createTexture (void)
+void Incomplete2DWrapModeCase::createTexture (GLuint texture)
 {
        TestLog&                        log                     = m_testCtx.getLog();
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures(1, &texture);
        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        glBindTexture(GL_TEXTURE_2D, texture);
 
@@ -480,7 +481,7 @@ public:
                                                Complete2DExtraLevelCase        (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size);
                                                ~Complete2DExtraLevelCase       (void) {}
 
-       virtual void            createTexture                           (void);
+       virtual void            createTexture                           (GLuint texture);
 
 private:
        IVec2                           m_size;
@@ -492,13 +493,11 @@ Complete2DExtraLevelCase::Complete2DExtraLevelCase (tcu::TestContext& testCtx, g
 {
 }
 
-void Complete2DExtraLevelCase::createTexture (void)
+void Complete2DExtraLevelCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
@@ -533,7 +532,7 @@ public:
                                                Incomplete2DEmptyObjectCase             (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size);
                                                ~Incomplete2DEmptyObjectCase    (void) {}
 
-       virtual void            createTexture                                   (void);
+       virtual void            createTexture                                   (GLuint texture);
 
 private:
        IVec2                           m_size;
@@ -545,10 +544,8 @@ Incomplete2DEmptyObjectCase::Incomplete2DEmptyObjectCase (tcu::TestContext& test
 {
 }
 
-void Incomplete2DEmptyObjectCase::createTexture (void)
+void Incomplete2DEmptyObjectCase::createTexture (GLuint texture)
 {
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
@@ -569,7 +566,7 @@ public:
                                                        IncompleteCubeSizeCase  (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, IVec2 invalidLevelSize, int invalidLevelNdx, tcu::CubeFace invalidCubeFace);
                                                        ~IncompleteCubeSizeCase (void) {}
 
-       virtual void                    createTexture                   (void);
+       virtual void                    createTexture                   (GLuint texture);
 
 private:
        int                                             m_invalidLevelNdx;
@@ -596,13 +593,11 @@ IncompleteCubeSizeCase::IncompleteCubeSizeCase (tcu::TestContext& testCtx, glu::
 {
 }
 
-void IncompleteCubeSizeCase::createTexture (void)
+void IncompleteCubeSizeCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_CUBE_MAP, texture);
 
@@ -641,7 +636,7 @@ public:
                                                        IncompleteCubeFormatCase        (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, deUint32 format, deUint32 invalidFormat, tcu::CubeFace invalidCubeFace);
                                                        ~IncompleteCubeFormatCase       (void) {}
 
-       virtual void                    createTexture                           (void);
+       virtual void                    createTexture                           (GLuint texture);
 
 private:
        deUint32                                m_format;
@@ -668,13 +663,11 @@ IncompleteCubeFormatCase::IncompleteCubeFormatCase (tcu::TestContext& testCtx, g
 {
 }
 
-void IncompleteCubeFormatCase::createTexture (void)
+void IncompleteCubeFormatCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_CUBE_MAP, texture);
 
@@ -713,7 +706,7 @@ public:
                                                        IncompleteCubeMissingLevelCase  (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, int invalidLevelNdx, tcu::CubeFace invalidCubeFace);
                                                        ~IncompleteCubeMissingLevelCase (void) {}
 
-       virtual void                    createTexture                                   (void);
+       virtual void                    createTexture                                   (GLuint texture);
 
 private:
        int                                             m_invalidLevelNdx;
@@ -737,13 +730,11 @@ IncompleteCubeMissingLevelCase::IncompleteCubeMissingLevelCase (tcu::TestContext
 {
 }
 
-void IncompleteCubeMissingLevelCase::createTexture (void)
+void IncompleteCubeMissingLevelCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_CUBE_MAP, texture);
 
@@ -782,7 +773,7 @@ public:
                                                                IncompleteCubeWrapModeCase      (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size, deUint32 wrapT, deUint32 wrapS, const glu::ContextInfo& ctxInfo);
                                                                ~IncompleteCubeWrapModeCase     (void) {}
 
-       virtual void                            createTexture                           (void);
+       virtual void                            createTexture                           (GLuint texture);
 
 private:
        deUint32                                        m_wrapT;
@@ -800,14 +791,12 @@ IncompleteCubeWrapModeCase::IncompleteCubeWrapModeCase (tcu::TestContext& testCt
 {
 }
 
-void IncompleteCubeWrapModeCase::createTexture (void)
+void IncompleteCubeWrapModeCase::createTexture (GLuint texture)
 {
        TestLog&                        log                     = m_testCtx.getLog();
        tcu::TextureFormat      fmt                     = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel       levelData       (fmt);
 
-       GLuint texture;
-       glGenTextures(1, &texture);
        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        glBindTexture(GL_TEXTURE_2D, texture);
 
@@ -838,7 +827,7 @@ public:
                                                CompleteCubeExtraLevelCase      (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size);
                                                ~CompleteCubeExtraLevelCase     (void) {}
 
-       virtual void            createTexture                           (void);
+       virtual void            createTexture                           (GLuint texture);
 
 private:
        IVec2                           m_size;
@@ -850,13 +839,11 @@ CompleteCubeExtraLevelCase::CompleteCubeExtraLevelCase (tcu::TestContext& testCt
 {
 }
 
-void CompleteCubeExtraLevelCase::createTexture (void)
+void CompleteCubeExtraLevelCase::createTexture (GLuint texture)
 {
        tcu::TextureFormat              fmt                             = glu::mapGLTransferFormat(GL_RGBA, GL_UNSIGNED_BYTE);
        tcu::TextureLevel               levelData               (fmt);
 
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
@@ -894,7 +881,7 @@ public:
                                                        IncompleteCubeEmptyObjectCase   (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, IVec2 size);
                                                        ~IncompleteCubeEmptyObjectCase  (void) {}
 
-       virtual void                    createTexture                           (void);
+       virtual void                    createTexture                           (GLuint texture);
 
 private:
        IVec2                                   m_size;
@@ -906,10 +893,8 @@ IncompleteCubeEmptyObjectCase::IncompleteCubeEmptyObjectCase (tcu::TestContext&
 {
 }
 
-void IncompleteCubeEmptyObjectCase::createTexture (void)
+void IncompleteCubeEmptyObjectCase::createTexture (GLuint texture)
 {
-       GLuint texture;
-       glGenTextures   (1, &texture);
        glPixelStorei   (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture   (GL_TEXTURE_2D, texture);
 
index b4ebcac..5cbdb0c 100644 (file)
@@ -1509,8 +1509,8 @@ FboSRGBQueryCase::~FboSRGBQueryCase (void)
 void FboSRGBQueryCase::init (void)
 {
        // extension requirements for test
-       if (!glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
-               TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control or a context version equal or higher than 3.2");
+       if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
+               TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control");
 }
 
 void FboSRGBQueryCase::deinit (void)
@@ -1797,8 +1797,8 @@ FboSRGBUnsupportedEnumCase::~FboSRGBUnsupportedEnumCase (void)
 void FboSRGBUnsupportedEnumCase::init (void)
 {
        // extension requirements for test
-       if (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) || m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
-               TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control to be unsupported and a context version less than 3.2");
+       if (m_context.getContextInfo().isExtensionSupported("GL_EXT_sRGB_write_control"))
+               TCU_THROW(NotSupportedError, "Test requires extension GL_EXT_sRGB_write_control to be unsupported");
 }
 
 void FboSRGBUnsupportedEnumCase::deinit (void)
index eb2e0ec..813a56a 100644 (file)
@@ -646,7 +646,7 @@ void invalid_maximum_work_group_sizes (NegativeTestContext& ctx)
        ctx.glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &maxWorkGroupInvocations);
        ctx.expectError(GL_NO_ERROR);
 
-       DE_ASSERT((maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations );
+       DE_ASSERT(((deInt64) maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations );
 
        const bool                              isES32                  = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
        const char* const               shaderVersion   = isES32
index da69f89..afe990b 100644 (file)
@@ -2924,12 +2924,32 @@ public:
 protected:
        ExprP<float>    doExpand        (ExpandContext&, const ArgExprs& args) const
        {
-               ExprP<float> val = args.a[0] * args.b[0];
+               ExprP<float> op[Size];
+               // Precompute all products.
+               for (int ndx = 0; ndx < Size; ++ndx)
+                       op[ndx] = args.a[ndx] * args.b[ndx];
 
-               for (int ndx = 1; ndx < Size; ++ndx)
-                       val = val + args.a[ndx] * args.b[ndx];
+               int idx[Size];
+               //Prepare an array of indices.
+               for (int ndx = 0; ndx < Size; ++ndx)
+                       idx[ndx] = ndx;
 
-               return val;
+               ExprP<float> res = op[0];
+               // Compute the first dot alternative: SUM(a[i]*b[i]), i = 0 .. Size-1
+               for (int ndx = 1; ndx < Size; ++ndx)
+                       res = res + op[ndx];
+
+               // Generate all permutations of indices and
+               // using a permutation compute a dot alternative.
+               // Generates all possible variants fo summation of products in the dot product expansion expression.
+               do {
+                       ExprP<float> alt = constant(0.0f);
+                       for (int ndx = 0; ndx < Size; ++ndx)
+                               alt = alt + op[idx[ndx]];
+                       res = alternatives(res, alt);
+               } while (std::next_permutation(idx, idx + Size));
+
+               return res;
        }
 };
 
index 5d5b804..34e11f1 100644 (file)
@@ -306,6 +306,7 @@ def genAndroidTestXml (mustpass):
        configElement = ElementTree.Element("configuration")
 
        # add in metadata option for component name
+       ElementTree.SubElement(configElement, "option", name="test-suite-tag", value="cts")
        ElementTree.SubElement(configElement, "option", name="config-descriptor:metadata", key="component", value="deqp")
 
        for package in mustpass.packages:
diff --git a/targets/surfaceless/surfaceless.cmake b/targets/surfaceless/surfaceless.cmake
new file mode 100644 (file)
index 0000000..f506112
--- /dev/null
@@ -0,0 +1,47 @@
+message("*** Using Surfaceless target")
+
+set(DEQP_TARGET_NAME "Surfaceless")
+
+include(FindPkgConfig)
+
+set(DEQP_USE_SURFACELESS ON)
+
+set(DEQP_SUPPORT_GLES2   ON)
+set(DEQP_SUPPORT_GLES3   ON)
+set(DEQP_SUPPORT_EGL     ON)
+
+find_library(GLES2_LIBRARIES GLESv2)
+find_library(GLES3_LIBRARIES GLESv3)
+find_path(GLES2_INCLUDE_PATH GLES2/gl2.h)
+find_path(GLES3_INCLUDE_PATH GLES3/gl3.h)
+
+if (GLES2_INCLUDE_PATH AND GLES2_LIBRARIES)
+        set(DEQP_GLES2_LIBRARIES ${GLES2_LIBRARIES})
+else ()
+        message (SEND_ERROR "GLESv2 support not found")
+endif ()
+
+if (GLES3_INCLUDE_PATH AND GLES3_LIBRARIES)
+        set(DEQP_GLES3_LIBRARIES ${GLES3_LIBRARIES})
+elseif (GLES3_INCLUDE_PATH AND GLES2_LIBRARIES)
+        # Assume GLESv2 provides ES3 symbols if gl3.h was found
+        # and the GLESv3 library was not.
+        set(DEQP_GLES3_LIBRARIES ${GLES2_LIBRARIES})
+else ()
+        message (FATAL_ERROR "GLESv3 support not found")
+endif ()
+
+pkg_check_modules(EGL REQUIRED egl)
+set(DEQP_EGL_LIBRARIES ${EGL_LIBRARIES})
+
+pkg_check_modules(GBM REQUIRED gbm)
+pkg_check_modules(KMS REQUIRED libkms)
+pkg_check_modules(DRM REQUIRED libdrm)
+
+include_directories(${GLES2_INCLUDE_PATH} ${GLES3_INCLUDE_PATH}
+                    ${EGL_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS}
+                    ${KMS_INCLUDE_DIRS} ${DRM_INCLUDE_DIRS})
+
+set(DEQP_PLATFORM_LIBRARIES ${DEQP_GLES2_LIBRARIES} ${DEQP_GLES3_LIBRARIES}
+                            ${DEQP_EGL_LIBRARIES} ${GBM_LIBRARIES}
+                            ${KMS_LIBRARIES} ${DRM_LIBRARIES})