-DDEQP_GLES3_RUNTIME_LOAD=1 \
-DDEQP_GLES2_RUNTIME_LOAD=1 \
-DQP_SUPPORT_PNG=1 \
+ -Wall \
+ -Werror \
-Wconversion \
-fwrapv \
-Wno-sign-conversion
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)
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")
-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
<!--
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"/>
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);
# 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
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
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
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__);
--- /dev/null
+/*-------------------------------------------------------------------------
+ * 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();
+}
--- /dev/null
+#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
// Signal completion.
packetIter->signal->increment();
}
+ m_egl.releaseThread();
}
private:
class TestThread : de::Thread
{
public:
- TestThread (const vector<TestContext*> contexts);
+ TestThread (const vector<TestContext*> contexts, const Library& egl);
~TestThread (void);
void start (void);
private:
vector<TestContext*> m_contexts;
+ const Library& m_egl;
bool m_isOk;
string m_errorString;
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)
m_isOk = false;
m_errorString = "Got unknown exception";
}
+
+ m_egl.releaseThread();
}
class SharedRenderingPerfCase : public TestCase
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());
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();
}
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();
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);
THREADSTATUS_NOT_STARTED = 0,
THREADSTATUS_RUNNING,
THREADSTATUS_READY,
-
- THREADSTATUS_NOT_SUPPORTED,
- THREADSTATUS_ERROR
};
TestThread (MultiThreadedTest& test, int id);
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;
try
{
- if (m_test.execTest(*this))
- m_status = THREADSTATUS_READY;
- else
- m_status = THREADSTATUS_ERROR;
+ m_test.execTest(*this);
}
catch (const TestThread::TestStop&)
{
{
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&)
{
}
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++)
}
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++)
throw;
}
-
- return isOk;
}
MultiThreadedTest::MultiThreadedTest (EglTestContext& eglTestCtx, const char* name, const char* description, int threadCount, deUint64 timeoutUs)
, 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)
}
}
-void MultiThreadedTest::barrier (TestThread& thread)
+void MultiThreadedTest::barrier (void)
{
{
const deInt32 waiters = deAtomicIncrement32(&m_barrierWaiters);
}
// Barrier was released due an error in other thread
- if (thread.getStatus() != TestThread::THREADSTATUS_RUNNING)
+ if (!m_ok || !m_supported)
throw TestThread::TestStop();
}
{
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);
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;
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");
de::Random rnd (deInt32Hash(thread.getId() + 10435));
vector<EGLConfig> configs;
- barrier(thread);
+ barrier();
for (int getConfigsNdx = 0; getConfigsNdx < m_getConfigs; getConfigsNdx++)
{
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)
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)
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(¬ES1Config, 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(¬ES2Config, 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);
+ }
}
}
#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)
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);
// Signal completion.
packetIter->signal->increment();
}
+ m_egl.releaseThread();
}
private:
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);
{
m_error = error;
}
+
+ m_egl.releaseThread();
}
private:
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;
IterateResult iterate (void);
protected:
- virtual void createTexture (void) = 0;
+ virtual void createTexture (GLuint texture) = 0;
tcu::TestContext& m_testCtx;
glu::RenderContext& m_renderCtx;
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;
IterateResult iterate (void);
protected:
- virtual void createTexture (void) = 0;
+ virtual void createTexture (GLuint texture) = 0;
tcu::TestContext& m_testCtx;
glu::RenderContext& m_renderCtx;
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++)
{
allFacesOk = false;
}
+ glDeleteTextures(1, &texture);
+
m_testCtx.setTestResult(allFacesOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
allFacesOk ? "Pass" : "Image comparison failed");
return STOP;
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;
{
}
-void Incomplete2DSizeCase::createTexture (void)
+void Incomplete2DSizeCase::createTexture (GLuint texture)
{
static const char* const s_relaxingExtensions[] =
{
tcu::TextureLevel levelData (fmt);
TestLog& log = m_testCtx.getLog();
- GLuint texture;
- glGenTextures (1, &texture);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glBindTexture (GL_TEXTURE_2D, texture);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-void Incomplete2DEmptyObjectCase::createTexture (void)
+void Incomplete2DEmptyObjectCase::createTexture (GLuint texture)
{
- GLuint texture;
- glGenTextures (1, &texture);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glBindTexture (GL_TEXTURE_2D, texture);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-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);
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;
{
}
-void IncompleteCubeEmptyObjectCase::createTexture (void)
+void IncompleteCubeEmptyObjectCase::createTexture (GLuint texture)
{
- GLuint texture;
- glGenTextures (1, &texture);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glBindTexture (GL_TEXTURE_2D, texture);
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)
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)
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
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;
}
};
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:
--- /dev/null
+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})