Commit a55e4b7a by Corentin Wallez

Enable compilation of dEQP tests on Linux

BUG=angleproject:1051 Change-Id: I158e59ca581b580825848e831d05064cdcc30d96 Reviewed-on: https://chromium-review.googlesource.com/276202Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent d3e7aa33
...@@ -330,6 +330,9 @@ ...@@ -330,6 +330,9 @@
'cflags': 'cflags':
[ [
'-fPIC', '-fPIC',
],
'cflags_cc':
[
'-std=c++0x', '-std=c++0x',
], ],
}, },
......
...@@ -56,8 +56,6 @@ ...@@ -56,8 +56,6 @@
'<(deqp_path)/framework/common', '<(deqp_path)/framework/common',
'<(deqp_path)/framework/qphelper', '<(deqp_path)/framework/qphelper',
'<(deqp_path)/framework/platform/null', '<(deqp_path)/framework/platform/null',
# TODO(jmadill): other platforms
'<(deqp_path)/framework/platform/win32',
'<(deqp_path)/framework/egl', '<(deqp_path)/framework/egl',
'<(deqp_path)/framework/egl/wrapper', '<(deqp_path)/framework/egl/wrapper',
'<(deqp_path)/framework/opengl', '<(deqp_path)/framework/opengl',
...@@ -579,6 +577,32 @@ ...@@ -579,6 +577,32 @@
'<(deqp_path)/modules/gles3/tes3TestPackage.hpp', '<(deqp_path)/modules/gles3/tes3TestPackage.hpp',
'<(deqp_path)/modules/gles3/tes3TestPackageEntry.cpp', '<(deqp_path)/modules/gles3/tes3TestPackageEntry.cpp',
], ],
'deqp_libtester_decpp_sources':
[
'<(deqp_path)/framework/delibs/decpp/deArrayBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deBlockBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deCommandLine.cpp',
'<(deqp_path)/framework/delibs/decpp/deDefs.cpp',
'<(deqp_path)/framework/delibs/decpp/deDirectoryIterator.cpp',
'<(deqp_path)/framework/delibs/decpp/deDynamicLibrary.cpp',
'<(deqp_path)/framework/delibs/decpp/deFilePath.cpp',
'<(deqp_path)/framework/delibs/decpp/deMemPool.cpp',
'<(deqp_path)/framework/delibs/decpp/deMutex.cpp',
'<(deqp_path)/framework/delibs/decpp/dePoolArray.cpp',
'<(deqp_path)/framework/delibs/decpp/dePoolString.cpp',
'<(deqp_path)/framework/delibs/decpp/deProcess.cpp',
'<(deqp_path)/framework/delibs/decpp/deRandom.cpp',
'<(deqp_path)/framework/delibs/decpp/deRingBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deSemaphore.cpp',
'<(deqp_path)/framework/delibs/decpp/deSharedPtr.cpp',
'<(deqp_path)/framework/delibs/decpp/deSocket.cpp',
'<(deqp_path)/framework/delibs/decpp/deSTLUtil.cpp',
'<(deqp_path)/framework/delibs/decpp/deStringUtil.cpp',
'<(deqp_path)/framework/delibs/decpp/deThread.cpp',
'<(deqp_path)/framework/delibs/decpp/deThreadLocal.cpp',
'<(deqp_path)/framework/delibs/decpp/deThreadSafeRingBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deUniquePtr.cpp',
],
'deqp_libtester_sources': 'deqp_libtester_sources':
[ [
'<(deqp_path)/execserver/xsDefs.cpp', '<(deqp_path)/execserver/xsDefs.cpp',
...@@ -668,16 +692,6 @@ ...@@ -668,16 +692,6 @@
'<(deqp_path)/framework/delibs/dethread/deAtomic.c', '<(deqp_path)/framework/delibs/dethread/deAtomic.c',
'<(deqp_path)/framework/delibs/dethread/deSingleton.c', '<(deqp_path)/framework/delibs/dethread/deSingleton.c',
'<(deqp_path)/framework/delibs/dethread/deThreadTest.c', '<(deqp_path)/framework/delibs/dethread/deThreadTest.c',
# TODO(jmadill): other platforms
'<(deqp_path)/framework/delibs/dethread/win32/deMutexWin32.c',
'<(deqp_path)/framework/delibs/dethread/win32/deSemaphoreWin32.c',
'<(deqp_path)/framework/delibs/dethread/win32/deThreadLocalWin32.c',
'<(deqp_path)/framework/delibs/dethread/win32/deThreadWin32.c',
#'<(deqp_path)/framework/delibs/dethread/unix/deMutexUnix.c',
#'<(deqp_path)/framework/delibs/dethread/unix/deNamedSemaphoreUnix.c',
#'<(deqp_path)/framework/delibs/dethread/unix/deSemaphoreUnix.c',
#'<(deqp_path)/framework/delibs/dethread/unix/deThreadLocalUnix.c',
#'<(deqp_path)/framework/delibs/dethread/unix/deThreadUnix.c',
'<(deqp_path)/framework/delibs/deutil/deClock.c', '<(deqp_path)/framework/delibs/deutil/deClock.c',
'<(deqp_path)/framework/delibs/deutil/deCommandLine.c', '<(deqp_path)/framework/delibs/deutil/deCommandLine.c',
'<(deqp_path)/framework/delibs/deutil/deDynamicLibrary.c', '<(deqp_path)/framework/delibs/deutil/deDynamicLibrary.c',
...@@ -743,7 +757,6 @@ ...@@ -743,7 +757,6 @@
'<(deqp_path)/framework/platform/null/tcuNullContextFactory.cpp', '<(deqp_path)/framework/platform/null/tcuNullContextFactory.cpp',
'<(deqp_path)/framework/platform/null/tcuNullContextFactory.hpp', '<(deqp_path)/framework/platform/null/tcuNullContextFactory.hpp',
'<(deqp_path)/framework/platform/null/tcuNullRenderContext.cpp', '<(deqp_path)/framework/platform/null/tcuNullRenderContext.cpp',
'<(deqp_path)/framework/platform/tcuMain.cpp',
'<(deqp_path)/framework/qphelper/qpCrashHandler.c', '<(deqp_path)/framework/qphelper/qpCrashHandler.c',
'<(deqp_path)/framework/qphelper/qpDebugOut.c', '<(deqp_path)/framework/qphelper/qpDebugOut.c',
'<(deqp_path)/framework/qphelper/qpInfo.c', '<(deqp_path)/framework/qphelper/qpInfo.c',
...@@ -817,18 +830,56 @@ ...@@ -817,18 +830,56 @@
'<(deqp_path)/modules/glshared/glsTextureTestUtil.cpp', '<(deqp_path)/modules/glshared/glsTextureTestUtil.cpp',
'<(deqp_path)/modules/glshared/glsUniformBlockCase.cpp', '<(deqp_path)/modules/glshared/glsUniformBlockCase.cpp',
'<(deqp_path)/modules/glshared/glsVertexArrayTests.cpp', '<(deqp_path)/modules/glshared/glsVertexArrayTests.cpp',
# TODO(jmadill): other platforms '<(angle_path)/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp',
'<(angle_path)/src/tests/deqp_support/tcuANGLEWin32NativeDisplayFactory.cpp', '<(angle_path)/src/tests/deqp_support/tcuANGLENativeDisplayFactory.h',
'<(angle_path)/src/tests/deqp_support/tcuANGLEWin32NativeDisplayFactory.h',
# TODO(jmadill): integrate with dEQP # TODO(jmadill): integrate with dEQP
'<(angle_path)/src/tests/deqp_support/tcuRandomOrderExecutor.cpp', '<(angle_path)/src/tests/deqp_support/tcuRandomOrderExecutor.cpp',
'<(angle_path)/src/tests/deqp_support/tcuRandomOrderExecutor.h', '<(angle_path)/src/tests/deqp_support/tcuRandomOrderExecutor.h',
], ],
'conditions':
[
['OS=="win"',
{
'deqp_include_dirs':
[
'<(deqp_path)/framework/platform/win32',
],
'deqp_libtester_sources':
[
'<(deqp_path)/framework/delibs/dethread/win32/deMutexWin32.c',
'<(deqp_path)/framework/delibs/dethread/win32/deSemaphoreWin32.c',
'<(deqp_path)/framework/delibs/dethread/win32/deThreadLocalWin32.c',
'<(deqp_path)/framework/delibs/dethread/win32/deThreadWin32.c',
],
}],
['OS=="linux" and use_x11==1',
{
'deqp_include_dirs':
[
'<(deqp_path)/framework/platform/x11',
],
'deqp_libtester_sources':
[
'<(deqp_path)/framework/delibs/dethread/unix/deMutexUnix.c',
'<(deqp_path)/framework/delibs/dethread/unix/deNamedSemaphoreUnix.c',
'<(deqp_path)/framework/delibs/dethread/unix/deSemaphoreUnix.c',
'<(deqp_path)/framework/delibs/dethread/unix/deThreadLocalUnix.c',
'<(deqp_path)/framework/delibs/dethread/unix/deThreadUnix.c',
],
'deqp_defines':
[
# Ask the system headers to expose all the regular function otherwise
# dEQP doesn't compile and produces warnings about implicitly defined
# functions.
'_GNU_SOURCE',
],
}],
]
}, },
'conditions': 'conditions':
[ [
['OS=="win" and angle_standalone==1', ['(OS=="win" or OS=="linux") and angle_standalone==1',
{ {
'targets': 'targets':
[ [
...@@ -938,7 +989,7 @@ ...@@ -938,7 +989,7 @@
}, },
], ],
}], }],
['OS=="win"', ['OS=="win" or OS=="linux"',
{ {
'targets': 'targets':
[ [
...@@ -977,6 +1028,10 @@ ...@@ -977,6 +1028,10 @@
}, },
}, },
}, },
'cflags!':
[
'-fno-exceptions', # dEQP requires exceptions
],
'msvs_disabled_warnings': 'msvs_disabled_warnings':
[ [
'<@(deqp_msvs_disabled_warnings)', '<@(deqp_msvs_disabled_warnings)',
...@@ -987,36 +1042,17 @@ ...@@ -987,36 +1042,17 @@
}, },
}, },
# Compile decpp separately because MSVC ignores the extension of the files when
# outputting the obj file, and later thinks that a decpp obj and another obj are the
# same, ignoring one and eventually producing a link error. The problem occurs for
# example between decpp/deRandom.cpp and debase/deRandom.c
{ {
'target_name': 'angle_deqp_decpp', 'target_name': 'angle_deqp_decpp',
'type': 'static_library', 'type': 'static_library',
'dependencies': [ 'angle_deqp_support' ], 'dependencies': [ 'angle_deqp_support' ],
'export_dependent_settings': [ 'angle_deqp_support' ],
'sources': 'sources':
[ [
'<(deqp_path)/framework/delibs/decpp/deArrayBuffer.cpp', '<@(deqp_libtester_decpp_sources)',
'<(deqp_path)/framework/delibs/decpp/deBlockBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deCommandLine.cpp',
'<(deqp_path)/framework/delibs/decpp/deDefs.cpp',
'<(deqp_path)/framework/delibs/decpp/deDirectoryIterator.cpp',
'<(deqp_path)/framework/delibs/decpp/deDynamicLibrary.cpp',
'<(deqp_path)/framework/delibs/decpp/deFilePath.cpp',
'<(deqp_path)/framework/delibs/decpp/deMemPool.cpp',
'<(deqp_path)/framework/delibs/decpp/deMutex.cpp',
'<(deqp_path)/framework/delibs/decpp/dePoolArray.cpp',
'<(deqp_path)/framework/delibs/decpp/dePoolString.cpp',
'<(deqp_path)/framework/delibs/decpp/deProcess.cpp',
'<(deqp_path)/framework/delibs/decpp/deRandom.cpp',
'<(deqp_path)/framework/delibs/decpp/deRingBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deSemaphore.cpp',
'<(deqp_path)/framework/delibs/decpp/deSharedPtr.cpp',
'<(deqp_path)/framework/delibs/decpp/deSocket.cpp',
'<(deqp_path)/framework/delibs/decpp/deSTLUtil.cpp',
'<(deqp_path)/framework/delibs/decpp/deStringUtil.cpp',
'<(deqp_path)/framework/delibs/decpp/deThread.cpp',
'<(deqp_path)/framework/delibs/decpp/deThreadLocal.cpp',
'<(deqp_path)/framework/delibs/decpp/deThreadSafeRingBuffer.cpp',
'<(deqp_path)/framework/delibs/decpp/deUniquePtr.cpp',
], ],
}, },
...@@ -1026,12 +1062,13 @@ ...@@ -1026,12 +1062,13 @@
'dependencies': 'dependencies':
[ [
'angle_deqp_decpp', 'angle_deqp_decpp',
'angle_deqp_support',
'<(angle_path)/src/angle.gyp:libEGL', '<(angle_path)/src/angle.gyp:libEGL',
'<(angle_path)/util/util.gyp:angle_util', '<(angle_path)/util/util.gyp:angle_util',
], ],
'export_dependent_settings': 'export_dependent_settings':
[ [
'angle_deqp_decpp', 'angle_deqp_support',
'<(angle_path)/util/util.gyp:angle_util', '<(angle_path)/util/util.gyp:angle_util',
], ],
'include_dirs': 'include_dirs':
...@@ -1090,7 +1127,8 @@ ...@@ -1090,7 +1127,8 @@
[ [
'<@(deqp_gles2_sources)', '<@(deqp_gles2_sources)',
'deqp_support/angle_deqp_libtester_main.cpp', 'deqp_support/angle_deqp_libtester_main.cpp',
'deqp_support/tcuANGLEWin32Platform.cpp', 'deqp_support/tcuANGLEPlatform.cpp',
'deqp_support/tcuANGLEPlatform.h',
], ],
}, },
...@@ -1109,7 +1147,8 @@ ...@@ -1109,7 +1147,8 @@
[ [
'<@(deqp_gles3_sources)', '<@(deqp_gles3_sources)',
'deqp_support/angle_deqp_libtester_main.cpp', 'deqp_support/angle_deqp_libtester_main.cpp',
'deqp_support/tcuANGLEWin32Platform.cpp', 'deqp_support/tcuANGLEPlatform.cpp',
'deqp_support/tcuANGLEPlatform.h',
], ],
}, },
...@@ -1191,9 +1230,9 @@ ...@@ -1191,9 +1230,9 @@
}], }],
], ],
}, },
], ], # targets
}], }], # OS=="win" or OS=="linux"
['OS=="win" and angle_standalone==1', ['(OS=="win" or OS=="linux") and angle_standalone==1',
{ {
"targets": "targets":
[ [
...@@ -1238,7 +1277,12 @@ ...@@ -1238,7 +1277,12 @@
'deqp_support/angle_deqp_tests_main.cpp', 'deqp_support/angle_deqp_tests_main.cpp',
], ],
}, },
], # targets
}], # (OS=="win" or OS=="linux") and angle_standalone==1
['OS=="win" and angle_standalone==1',
{
"targets":
[
{ {
'target_name': 'angle_deqp_googletest', 'target_name': 'angle_deqp_googletest',
'type': 'executable', 'type': 'executable',
...@@ -1253,6 +1297,6 @@ ...@@ -1253,6 +1297,6 @@
], ],
}, },
], # targets ], # targets
}], # OS == "win" }], # OS=="win" and angle_standalone==1
], # conditions ], # conditions
} }
...@@ -22,10 +22,12 @@ ...@@ -22,10 +22,12 @@
#if (DE_OS == DE_OS_WIN32) #if (DE_OS == DE_OS_WIN32)
#include <Windows.h> #include <Windows.h>
#elif (DE_OS == DE_OS_UNIX)
#include <sys/unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif #endif
// Located in tcuMain.cc in dEQP's sources.
int main(int argc, const char* argv[]);
tcu::Platform *createPlatform(); tcu::Platform *createPlatform();
namespace namespace
...@@ -57,14 +59,15 @@ deBool deIsDir(const char *filename) ...@@ -57,14 +59,15 @@ deBool deIsDir(const char *filename)
return (attribs != INVALID_FILE_ATTRIBUTES) && return (attribs != INVALID_FILE_ATTRIBUTES) &&
((attribs & FILE_ATTRIBUTE_DIRECTORY) > 0); ((attribs & FILE_ATTRIBUTE_DIRECTORY) > 0);
} }
#elif (DE_OS == DE_OS_UNIX)
deBool deIsDir(const char *filename)
{
struct stat st;
int result = stat(filename, &st);
return result == 0 && ((st.st_mode & S_IFDIR) == S_IFDIR);
}
#else #else
#error TODO(jmadill): support other platforms #error TODO(jmadill): support other platforms
//deBool deIsDir(const char *filename)
//{
// struct stat st;
// int result = stat(filename, &st);
// return result == 0 && ((st.st_mode & S_IFDIR) == S_IFDIR);
//}
#endif #endif
const char *FindDataDir() const char *FindDataDir()
...@@ -127,7 +130,27 @@ bool InitPlatform() ...@@ -127,7 +130,27 @@ bool InitPlatform()
// Exported to the tester app. // Exported to the tester app.
ANGLE_LIBTESTER_EXPORT int deqp_libtester_main(int argc, const char *argv[]) ANGLE_LIBTESTER_EXPORT int deqp_libtester_main(int argc, const char *argv[])
{ {
return main(argc, argv); InitPlatform();
try
{
de::UniquePtr<tcu::App> app(new tcu::App(*g_platform, *g_archive, *g_log, *g_cmdLine));
// Main loop.
for (;;)
{
if (!app->iterate())
break;
}
}
catch (const std::exception &e)
{
deqp_libtester_shutdown_platform();
tcu::die("%s", e.what());
}
deqp_libtester_shutdown_platform();
return 0;
} }
ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform() ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform()
......
...@@ -6,18 +6,24 @@ ...@@ -6,18 +6,24 @@
// angle_deqp_tests_main.cpp: Entry point for ANGLE's dEQP tests. // angle_deqp_tests_main.cpp: Entry point for ANGLE's dEQP tests.
#include <direct.h> #include <cstdio>
#include <stdio.h>
#include "angle_deqp_libtester.h" #include "angle_deqp_libtester.h"
#ifdef _WIN32
#include <direct.h>
#define chdir _chdir
#else
#include <unistd.h>
#endif
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
const char * data_dir = ANGLE_DEQP_DIR "/data"; const char * data_dir = ANGLE_DEQP_DIR "/data";
if (_chdir(data_dir) != 0) if (chdir(data_dir) != 0)
{ {
printf("Error setting working directory\n"); printf("Error setting working directory to %s\n", data_dir);
} }
deqp_libtester_main(argc, argv); return deqp_libtester_main(argc, argv);
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* *
*/ */
#include "tcuANGLEWin32NativeDisplayFactory.h" #include "tcuANGLENativeDisplayFactory.h"
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -31,12 +31,14 @@ ...@@ -31,12 +31,14 @@
#include "OSPixmap.h" #include "OSPixmap.h"
#include "OSWindow.h" #include "OSWindow.h"
#include "tcuTexture.hpp" #include "tcuTexture.hpp"
#include "tcuWin32API.h"
// Assume no call translation is needed #if (DE_OS == DE_OS_WIN32)
DE_STATIC_ASSERT(sizeof(eglw::EGLNativeDisplayType) == sizeof(HDC)); #define ANGLE_EGL_LIBRARY_NAME "libEGL.dll"
DE_STATIC_ASSERT(sizeof(eglw::EGLNativePixmapType) == sizeof(HBITMAP)); #elif (DE_OS == DE_OS_UNIX)
DE_STATIC_ASSERT(sizeof(eglw::EGLNativeWindowType) == sizeof(HWND)); #define ANGLE_EGL_LIBRARY_NAME "libEGL.so"
#else
#error "Unsupported platform"
#endif
namespace tcu namespace tcu
{ {
...@@ -70,10 +72,10 @@ class ANGLENativeDisplay : public eglu::NativeDisplay ...@@ -70,10 +72,10 @@ class ANGLENativeDisplay : public eglu::NativeDisplay
const eglw::EGLAttrib *getPlatformAttributes() const override { return &mPlatformAttributes[0]; } const eglw::EGLAttrib *getPlatformAttributes() const override { return &mPlatformAttributes[0]; }
const eglw::Library &getLibrary() const override { return mLibrary; } const eglw::Library &getLibrary() const override { return mLibrary; }
HDC getDeviceContext() { return mDeviceContext; } EGLNativeDisplayType getDeviceContext() { return mDeviceContext; }
private: private:
HDC mDeviceContext; EGLNativeDisplayType mDeviceContext;
eglw::DefaultLibrary mLibrary; eglw::DefaultLibrary mLibrary;
std::vector<eglw::EGLAttrib> mPlatformAttributes; std::vector<eglw::EGLAttrib> mPlatformAttributes;
}; };
...@@ -118,7 +120,7 @@ class NativeWindow : public eglu::NativeWindow ...@@ -118,7 +120,7 @@ class NativeWindow : public eglu::NativeWindow
NativeWindow(ANGLENativeDisplay *nativeDisplay, const eglu::WindowParams &params, EventState *eventState); NativeWindow(ANGLENativeDisplay *nativeDisplay, const eglu::WindowParams &params, EventState *eventState);
~NativeWindow() override; ~NativeWindow() override;
eglw::EGLNativeWindowType getLegacyNative() override { return mWindow->getNativeWindow(); } eglw::EGLNativeWindowType getLegacyNative() override;
IVec2 getSurfaceSize() const override; IVec2 getSurfaceSize() const override;
IVec2 getScreenSize() const override { return getSurfaceSize(); } IVec2 getScreenSize() const override { return getSurfaceSize(); }
void processEvents() override; void processEvents() override;
...@@ -135,8 +137,8 @@ class NativeWindow : public eglu::NativeWindow ...@@ -135,8 +137,8 @@ class NativeWindow : public eglu::NativeWindow
ANGLENativeDisplay::ANGLENativeDisplay(const std::vector<EGLAttrib> &attribs) ANGLENativeDisplay::ANGLENativeDisplay(const std::vector<EGLAttrib> &attribs)
: eglu::NativeDisplay(DISPLAY_CAPABILITIES, EGL_PLATFORM_ANGLE_ANGLE, "EGL_EXT_platform_base"), : eglu::NativeDisplay(DISPLAY_CAPABILITIES, EGL_PLATFORM_ANGLE_ANGLE, "EGL_EXT_platform_base"),
mDeviceContext(static_cast<HDC>(EGL_DEFAULT_DISPLAY)), mDeviceContext(EGL_DEFAULT_DISPLAY),
mLibrary("libEGL.dll"), mLibrary(ANGLE_EGL_LIBRARY_NAME),
mPlatformAttributes(attribs) mPlatformAttributes(attribs)
{ {
} }
...@@ -165,7 +167,7 @@ NativePixmap::~NativePixmap() ...@@ -165,7 +167,7 @@ NativePixmap::~NativePixmap()
eglw::EGLNativePixmapType NativePixmap::getLegacyNative() eglw::EGLNativePixmapType NativePixmap::getLegacyNative()
{ {
return mPixmap->getNativePixmap(); return reinterpret_cast<eglw::EGLNativePixmapType>(mPixmap->getNativePixmap());
} }
// NativePixmapFactory // NativePixmapFactory
...@@ -256,6 +258,11 @@ NativeWindow::~NativeWindow() ...@@ -256,6 +258,11 @@ NativeWindow::~NativeWindow()
delete mWindow; delete mWindow;
} }
eglw::EGLNativeWindowType NativeWindow::getLegacyNative()
{
return reinterpret_cast<eglw::EGLNativeWindowType>(mWindow->getNativeWindow());
}
IVec2 NativeWindow::getSurfaceSize() const IVec2 NativeWindow::getSurfaceSize() const
{ {
return IVec2(mWindow->getWidth(), mWindow->getHeight()); return IVec2(mWindow->getWidth(), mWindow->getHeight());
...@@ -291,10 +298,10 @@ void NativeWindow::readScreenPixels(tcu::TextureLevel *dst) const ...@@ -291,10 +298,10 @@ void NativeWindow::readScreenPixels(tcu::TextureLevel *dst) const
} // anonymous } // anonymous
ANGLEWin32NativeDisplayFactory::ANGLEWin32NativeDisplayFactory(const std::string &name, ANGLENativeDisplayFactory::ANGLENativeDisplayFactory(const std::string &name,
const std::string &description, const std::string &description,
const std::vector<eglw::EGLAttrib> &platformAttributes, const std::vector<eglw::EGLAttrib> &platformAttributes,
EventState *eventState) EventState *eventState)
: eglu::NativeDisplayFactory(name, description, DISPLAY_CAPABILITIES, EGL_PLATFORM_ANGLE_ANGLE, "EGL_EXT_platform_base"), : eglu::NativeDisplayFactory(name, description, DISPLAY_CAPABILITIES, EGL_PLATFORM_ANGLE_ANGLE, "EGL_EXT_platform_base"),
mPlatformAttributes(platformAttributes) mPlatformAttributes(platformAttributes)
{ {
...@@ -302,11 +309,11 @@ ANGLEWin32NativeDisplayFactory::ANGLEWin32NativeDisplayFactory(const std::string ...@@ -302,11 +309,11 @@ ANGLEWin32NativeDisplayFactory::ANGLEWin32NativeDisplayFactory(const std::string
m_nativePixmapRegistry.registerFactory(new NativePixmapFactory()); m_nativePixmapRegistry.registerFactory(new NativePixmapFactory());
} }
ANGLEWin32NativeDisplayFactory::~ANGLEWin32NativeDisplayFactory() ANGLENativeDisplayFactory::~ANGLENativeDisplayFactory()
{ {
} }
eglu::NativeDisplay *ANGLEWin32NativeDisplayFactory::createDisplay(const eglw::EGLAttrib *attribList) const eglu::NativeDisplay *ANGLENativeDisplayFactory::createDisplay(const eglw::EGLAttrib *attribList) const
{ {
DE_UNREF(attribList); DE_UNREF(attribList);
return new ANGLENativeDisplay(mPlatformAttributes); return new ANGLENativeDisplay(mPlatformAttributes);
......
...@@ -31,7 +31,7 @@ namespace tcu ...@@ -31,7 +31,7 @@ namespace tcu
class EventState class EventState
{ {
public: public:
EventState::EventState() EventState()
: mQuit(false) : mQuit(false)
{ {
} }
...@@ -42,14 +42,14 @@ class EventState ...@@ -42,14 +42,14 @@ class EventState
bool mQuit; bool mQuit;
}; };
class ANGLEWin32NativeDisplayFactory : public eglu::NativeDisplayFactory class ANGLENativeDisplayFactory : public eglu::NativeDisplayFactory
{ {
public: public:
ANGLEWin32NativeDisplayFactory(const std::string &name, ANGLENativeDisplayFactory(const std::string &name,
const std::string &description, const std::string &description,
const std::vector<eglw::EGLAttrib> &platformAttributes, const std::vector<eglw::EGLAttrib> &platformAttributes,
EventState *eventState); EventState *eventState);
~ANGLEWin32NativeDisplayFactory() override; ~ANGLENativeDisplayFactory() override;
eglu::NativeDisplay *createDisplay(const eglw::EGLAttrib* attribList) const override; eglu::NativeDisplay *createDisplay(const eglw::EGLAttrib* attribList) const override;
......
...@@ -18,23 +18,24 @@ ...@@ -18,23 +18,24 @@
* *
*/ */
#include "tcuANGLEWin32Platform.h" #include "tcuANGLEPlatform.h"
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include "egluGLContextFactory.hpp" #include "egluGLContextFactory.hpp"
#include "system_utils.h" #include "system_utils.h"
#include "tcuANGLEWin32NativeDisplayFactory.h" #include "tcuANGLENativeDisplayFactory.h"
#include "tcuNullContextFactory.hpp" #include "tcuNullContextFactory.hpp"
namespace tcu namespace tcu
{ {
ANGLEWin32Platform::ANGLEWin32Platform() ANGLEPlatform::ANGLEPlatform()
{ {
angle::SetLowPriorityProcess(); angle::SetLowPriorityProcess();
#if (DE_OS == DE_OS_WIN32)
#if defined(ANGLE_DEQP_GLES2_TESTS) || defined(ANGLE_DEQP_GLES3_TESTS) #if defined(ANGLE_DEQP_GLES2_TESTS) || defined(ANGLE_DEQP_GLES3_TESTS)
std::vector<eglw::EGLAttrib> d3d11Attribs; std::vector<eglw::EGLAttrib> d3d11Attribs;
d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
...@@ -43,10 +44,10 @@ ANGLEWin32Platform::ANGLEWin32Platform() ...@@ -43,10 +44,10 @@ ANGLEWin32Platform::ANGLEWin32Platform()
d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE); d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
d3d11Attribs.push_back(EGL_NONE); d3d11Attribs.push_back(EGL_NONE);
auto *d3d11Factory = new ANGLEWin32NativeDisplayFactory( auto *d3d11Factory = new ANGLENativeDisplayFactory(
"angle-d3d11", "ANGLE D3D11 Display", d3d11Attribs, &mEvents); "angle-d3d11", "ANGLE D3D11 Display", d3d11Attribs, &mEvents);
m_nativeDisplayFactoryRegistry.registerFactory(d3d11Factory); m_nativeDisplayFactoryRegistry.registerFactory(d3d11Factory);
#endif #endif // defined(ANGLE_DEQP_GLES2_TESTS) || defined(ANGLE_DEQP_GLES3_TESTS)
#if defined(ANGLE_DEQP_GLES2_TESTS) #if defined(ANGLE_DEQP_GLES2_TESTS)
std::vector<eglw::EGLAttrib> d3d9Attribs; std::vector<eglw::EGLAttrib> d3d9Attribs;
...@@ -56,7 +57,7 @@ ANGLEWin32Platform::ANGLEWin32Platform() ...@@ -56,7 +57,7 @@ ANGLEWin32Platform::ANGLEWin32Platform()
d3d9Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE); d3d9Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
d3d9Attribs.push_back(EGL_NONE); d3d9Attribs.push_back(EGL_NONE);
auto *d3d9Factory = new ANGLEWin32NativeDisplayFactory( auto *d3d9Factory = new ANGLENativeDisplayFactory(
"angle-d3d9", "ANGLE D3D9 Display", d3d9Attribs, &mEvents); "angle-d3d9", "ANGLE D3D9 Display", d3d9Attribs, &mEvents);
m_nativeDisplayFactoryRegistry.registerFactory(d3d9Factory); m_nativeDisplayFactoryRegistry.registerFactory(d3d9Factory);
...@@ -71,19 +72,22 @@ ANGLEWin32Platform::ANGLEWin32Platform() ...@@ -71,19 +72,22 @@ ANGLEWin32Platform::ANGLEWin32Platform()
d3d1193Attribs.push_back(3); d3d1193Attribs.push_back(3);
d3d1193Attribs.push_back(EGL_NONE); d3d1193Attribs.push_back(EGL_NONE);
auto *d3d1193Factory = new ANGLEWin32NativeDisplayFactory( auto *d3d1193Factory = new ANGLENativeDisplayFactory(
"angle-d3d11-fl93", "ANGLE D3D11 FL9_3 Display", d3d1193Attribs, &mEvents); "angle-d3d11-fl93", "ANGLE D3D11 FL9_3 Display", d3d1193Attribs, &mEvents);
m_nativeDisplayFactoryRegistry.registerFactory(d3d1193Factory); m_nativeDisplayFactoryRegistry.registerFactory(d3d1193Factory);
#endif // defined(ANGLE_DEQP_GLES2_TESTS)
#endif // (DE_OS == DE_OS_WIN32)
#if defined(ANGLE_DEQP_GLES2_TESTS)
std::vector<eglw::EGLAttrib> glAttribs; std::vector<eglw::EGLAttrib> glAttribs;
glAttribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); glAttribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
glAttribs.push_back(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE); glAttribs.push_back(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE);
glAttribs.push_back(EGL_NONE); glAttribs.push_back(EGL_NONE);
auto *glFactory = new ANGLEWin32NativeDisplayFactory( auto *glFactory = new ANGLENativeDisplayFactory(
"angle-gl", "ANGLE OpenGL Display", glAttribs, &mEvents); "angle-gl", "ANGLE OpenGL Display", glAttribs, &mEvents);
m_nativeDisplayFactoryRegistry.registerFactory(glFactory); m_nativeDisplayFactoryRegistry.registerFactory(glFactory);
#endif #endif // defined(ANGLE_DEQP_GLES2_TESTS)
m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry)); m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
...@@ -91,11 +95,11 @@ ANGLEWin32Platform::ANGLEWin32Platform() ...@@ -91,11 +95,11 @@ ANGLEWin32Platform::ANGLEWin32Platform()
m_contextFactoryRegistry.registerFactory(new null::NullGLContextFactory()); m_contextFactoryRegistry.registerFactory(new null::NullGLContextFactory());
} }
ANGLEWin32Platform::~ANGLEWin32Platform() ANGLEPlatform::~ANGLEPlatform()
{ {
} }
bool ANGLEWin32Platform::processEvents() bool ANGLEPlatform::processEvents()
{ {
return !mEvents.quitSignaled(); return !mEvents.quitSignaled();
} }
...@@ -105,5 +109,5 @@ bool ANGLEWin32Platform::processEvents() ...@@ -105,5 +109,5 @@ bool ANGLEWin32Platform::processEvents()
// Create platform // Create platform
tcu::Platform *createPlatform() tcu::Platform *createPlatform()
{ {
return new tcu::ANGLEWin32Platform(); return new tcu::ANGLEPlatform();
} }
...@@ -29,18 +29,18 @@ ...@@ -29,18 +29,18 @@
# include "egluPlatform.hpp" # include "egluPlatform.hpp"
#endif #endif
#include "tcuANGLEWin32NativeDisplayFactory.h" #include "tcuANGLENativeDisplayFactory.h"
namespace tcu namespace tcu
{ {
class ANGLEWin32Platform : public tcu::Platform, class ANGLEPlatform : public tcu::Platform,
private glu::Platform, private glu::Platform,
private eglu::Platform private eglu::Platform
{ {
public: public:
ANGLEWin32Platform(); ANGLEPlatform();
~ANGLEWin32Platform(); ~ANGLEPlatform();
bool processEvents() override; bool processEvents() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment