Commit 2a7ffe16 by Jamie Madill

Add ANGLE platform selection for dEQP.

This gives us the choice between D3D9 and D3D11. We can add more platforms easily using the same patterns. BUG=angleproject:901 Change-Id: Ia8dc77466bd32f0b8b0d638ae839f41288bfe25b Reviewed-on: https://chromium-review.googlesource.com/266889Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarAustin Kinross <aukinros@microsoft.com> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 2cb7b835
...@@ -706,6 +706,35 @@ ...@@ -706,6 +706,35 @@
}, },
'defines': ['<@(deqp_defines)'], 'defines': ['<@(deqp_defines)'],
'include_dirs': ['<@(deqp_include_dirs)'], 'include_dirs': ['<@(deqp_include_dirs)'],
'direct_dependent_settings':
{
'msvs_disabled_warnings':
[
'<@(deqp_msvs_disabled_warnings)',
],
'msvs_settings':
{
'VCCLCompilerTool':
{
'AdditionalOptions':
[
'/EHsc', # dEQP requires exceptions
],
},
'VCLinkerTool':
{
'AdditionalDependencies':
[
'dbghelp.lib',
'gdi32.lib',
'user32.lib',
'ws2_32.lib',
],
},
},
'include_dirs': ['<@(deqp_include_dirs)'],
'defines': ['<@(deqp_defines)'],
},
'sources': 'sources':
[ [
'<(deqp_dir)/framework/delibs/decpp/deArrayBuffer.cpp', '<(deqp_dir)/framework/delibs/decpp/deArrayBuffer.cpp',
...@@ -736,44 +765,38 @@ ...@@ -736,44 +765,38 @@
{ {
'target_name': 'angle_deqp_libtester', 'target_name': 'angle_deqp_libtester',
'type': 'shared_library', 'type': 'static_library',
'dependencies': 'dependencies':
[ [
'angle_deqp_decpp', 'angle_deqp_decpp',
'angle_libpng', 'angle_libpng',
'<(angle_path)/src/angle.gyp:libEGL', '<(angle_path)/src/angle.gyp:libEGL',
], ],
'defines': ['<@(deqp_defines)'],
'include_dirs': 'include_dirs':
[ [
'<(angle_path)/include', '<(angle_path)/include',
'<@(deqp_include_dirs)'
],
'msvs_disabled_warnings':
[
'<@(deqp_msvs_disabled_warnings)',
], ],
'direct_dependent_settings':
{
'include_dirs':
[
'<(angle_path)/include',
],
},
'msvs_settings': 'msvs_settings':
{ {
'VCCLCompilerTool': 'VCCLCompilerTool':
{ {
'AdditionalOptions': 'AdditionalOptions':
[ [
'/EHsc', # dEQP requires exceptions
'/bigobj', # needed for glsBuiltinPrecisionTests.cpp '/bigobj', # needed for glsBuiltinPrecisionTests.cpp
], ],
}, },
'VCLinkerTool':
{
'AdditionalDependencies':
[
'dbghelp.lib',
'gdi32.lib',
'user32.lib',
'ws2_32.lib',
],
},
}, },
'export_dependent_settings':
[
'angle_deqp_decpp',
],
'sources': 'sources':
[ [
'<(deqp_dir)/execserver/xsDefs.cpp', '<(deqp_dir)/execserver/xsDefs.cpp',
...@@ -1010,17 +1033,51 @@ ...@@ -1010,17 +1033,51 @@
'<(deqp_dir)/modules/glshared/glsTextureTestUtil.cpp', '<(deqp_dir)/modules/glshared/glsTextureTestUtil.cpp',
'<(deqp_dir)/modules/glshared/glsUniformBlockCase.cpp', '<(deqp_dir)/modules/glshared/glsUniformBlockCase.cpp',
'<(deqp_dir)/modules/glshared/glsVertexArrayTests.cpp', '<(deqp_dir)/modules/glshared/glsVertexArrayTests.cpp',
# TODO(jmadill): other platforms
'deqp_support/tcuANGLEWin32NativeDisplayFactory.cpp',
],
},
{
'target_name': 'angle_deqp_libgles2',
'type': 'shared_library',
'dependencies':
[
'angle_deqp_libtester',
],
'defines':
[
'ANGLE_DEQP_GLES2_TESTS',
],
'sources':
[
'<@(deqp_gles2_sources)', '<@(deqp_gles2_sources)',
'deqp_support/angle_deqp_libtester_main.cpp',
'deqp_support/tcuANGLEWin32Platform.cpp',
],
},
{
'target_name': 'angle_deqp_libgles3',
'type': 'shared_library',
'dependencies':
[
'angle_deqp_libtester',
],
'defines':
[
'ANGLE_DEQP_GLES3_TESTS',
],
'sources':
[
'<@(deqp_gles3_sources)', '<@(deqp_gles3_sources)',
# TODO(jmadill): other platforms
'deqp_support/angle_deqp_libtester_main.cpp', 'deqp_support/angle_deqp_libtester_main.cpp',
'deqp_support/tcuANGLEWin32NativeDisplayFactory.cpp',
'deqp_support/tcuANGLEWin32Platform.cpp', 'deqp_support/tcuANGLEWin32Platform.cpp',
], ],
}, },
{ {
'target_name': 'angle_deqp_tests', 'target_name': 'angle_deqp_gles2_tests',
'type': 'executable', 'type': 'executable',
'defines': 'defines':
[ [
...@@ -1032,7 +1089,28 @@ ...@@ -1032,7 +1089,28 @@
], ],
'dependencies': 'dependencies':
[ [
'angle_deqp_libtester', 'angle_deqp_libgles2',
],
'sources':
[
'deqp_support/angle_deqp_tests_main.cpp',
],
},
{
'target_name': 'angle_deqp_gles3_tests',
'type': 'executable',
'defines':
[
# Hard-code the path to dEQP. This lets the
# app locate the data folder without need
# for a copy. gyp recursive copies are not
# implemented properly on Windows.
'ANGLE_DEQP_DIR="<(DEPTH)/src/tests/<(deqp_dir)"',
],
'dependencies':
[
'angle_deqp_libgles3',
], ],
'sources': 'sources':
[ [
......
...@@ -59,11 +59,11 @@ static const eglu::NativeWindow::Capability WINDOW_CAPABILITIES = (eglu::Nativ ...@@ -59,11 +59,11 @@ static const eglu::NativeWindow::Capability WINDOW_CAPABILITIES = (eglu::Nativ
eglu::NativeWindow::CAPABILITY_SET_SURFACE_SIZE | eglu::NativeWindow::CAPABILITY_SET_SURFACE_SIZE |
eglu::NativeWindow::CAPABILITY_CHANGE_VISIBILITY); eglu::NativeWindow::CAPABILITY_CHANGE_VISIBILITY);
class NativeDisplay : public eglu::NativeDisplay class ANGLENativeDisplay : public eglu::NativeDisplay
{ {
public: public:
NativeDisplay(); ANGLENativeDisplay(const std::vector<eglw::EGLAttrib> &attribs);
virtual ~NativeDisplay() {} virtual ~ANGLENativeDisplay() {}
void *getPlatformNative() override { return mDeviceContext; } void *getPlatformNative() override { return mDeviceContext; }
const eglw::EGLAttrib *getPlatformAttributes() const override { return &mPlatformAttributes[0]; } const eglw::EGLAttrib *getPlatformAttributes() const override { return &mPlatformAttributes[0]; }
...@@ -90,7 +90,7 @@ class NativePixmapFactory : public eglu::NativePixmapFactory ...@@ -90,7 +90,7 @@ class NativePixmapFactory : public eglu::NativePixmapFactory
class NativePixmap : public eglu::NativePixmap class NativePixmap : public eglu::NativePixmap
{ {
public: public:
NativePixmap(NativeDisplay* nativeDisplay, int width, int height, int bitDepth); NativePixmap(ANGLENativeDisplay* nativeDisplay, int width, int height, int bitDepth);
virtual ~NativePixmap(); virtual ~NativePixmap();
eglw::EGLNativePixmapType getLegacyNative() override { return mBitmap; } eglw::EGLNativePixmapType getLegacyNative() override { return mBitmap; }
...@@ -114,7 +114,7 @@ class NativeWindowFactory : public eglu::NativeWindowFactory ...@@ -114,7 +114,7 @@ class NativeWindowFactory : public eglu::NativeWindowFactory
class NativeWindow : public eglu::NativeWindow class NativeWindow : public eglu::NativeWindow
{ {
public: public:
NativeWindow(NativeDisplay *nativeDisplay, HINSTANCE instance, const eglu::WindowParams &params); NativeWindow(ANGLENativeDisplay *nativeDisplay, HINSTANCE instance, const eglu::WindowParams &params);
~NativeWindow() override; ~NativeWindow() override;
eglw::EGLNativeWindowType getLegacyNative() override { return mWindow.getHandle(); } eglw::EGLNativeWindowType getLegacyNative() override { return mWindow.getHandle(); }
...@@ -131,22 +131,19 @@ class NativeWindow : public eglu::NativeWindow ...@@ -131,22 +131,19 @@ class NativeWindow : public eglu::NativeWindow
deUint64 mSetVisibleTime; //!< Time window was set visible. deUint64 mSetVisibleTime; //!< Time window was set visible.
}; };
// NativeDisplay // ANGLE NativeDisplay
NativeDisplay::NativeDisplay() 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((HDC)EGL_DEFAULT_DISPLAY), mDeviceContext(static_cast<HDC>(EGL_DEFAULT_DISPLAY)),
mLibrary("libEGL.dll") mLibrary("libEGL.dll"),
mPlatformAttributes(attribs)
{ {
mPlatformAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
mPlatformAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
mPlatformAttributes.push_back(EGL_NONE);
mPlatformAttributes.push_back(EGL_NONE);
} }
// NativePixmap // NativePixmap
NativePixmap::NativePixmap(NativeDisplay* nativeDisplay, int width, int height, int bitDepth) NativePixmap::NativePixmap(ANGLENativeDisplay *nativeDisplay, int width, int height, int bitDepth)
: eglu::NativePixmap(BITMAP_CAPABILITIES), : eglu::NativePixmap(BITMAP_CAPABILITIES),
mBitmap(DE_NULL) mBitmap(DE_NULL)
{ {
...@@ -208,13 +205,13 @@ eglu::NativePixmap *NativePixmapFactory::createPixmap (eglu::NativeDisplay* nati ...@@ -208,13 +205,13 @@ eglu::NativePixmap *NativePixmapFactory::createPixmap (eglu::NativeDisplay* nati
bitSum = redBits+greenBits+blueBits+alphaBits; bitSum = redBits+greenBits+blueBits+alphaBits;
return new NativePixmap(dynamic_cast<NativeDisplay*>(nativeDisplay), width, height, bitSum); return new NativePixmap(dynamic_cast<ANGLENativeDisplay*>(nativeDisplay), width, height, bitSum);
} }
eglu::NativePixmap *NativePixmapFactory::createPixmap(eglu::NativeDisplay* nativeDisplay, int width, int height) const eglu::NativePixmap *NativePixmapFactory::createPixmap(eglu::NativeDisplay* nativeDisplay, int width, int height) const
{ {
const int defaultDepth = 32; const int defaultDepth = 32;
return new NativePixmap(dynamic_cast<NativeDisplay*>(nativeDisplay), width, height, defaultDepth); return new NativePixmap(dynamic_cast<ANGLENativeDisplay*>(nativeDisplay), width, height, defaultDepth);
} }
// NativeWindowFactory // NativeWindowFactory
...@@ -227,12 +224,12 @@ NativeWindowFactory::NativeWindowFactory(HINSTANCE instance) ...@@ -227,12 +224,12 @@ NativeWindowFactory::NativeWindowFactory(HINSTANCE instance)
eglu::NativeWindow *NativeWindowFactory::createWindow (eglu::NativeDisplay* nativeDisplay, const eglu::WindowParams& params) const eglu::NativeWindow *NativeWindowFactory::createWindow (eglu::NativeDisplay* nativeDisplay, const eglu::WindowParams& params) const
{ {
return new NativeWindow(dynamic_cast<NativeDisplay*>(nativeDisplay), mInstance, params); return new NativeWindow(dynamic_cast<ANGLENativeDisplay*>(nativeDisplay), mInstance, params);
} }
// NativeWindow // NativeWindow
NativeWindow::NativeWindow(NativeDisplay *nativeDisplay, HINSTANCE instance, const eglu::WindowParams& params) NativeWindow::NativeWindow(ANGLENativeDisplay *nativeDisplay, HINSTANCE instance, const eglu::WindowParams& params)
: eglu::NativeWindow(WINDOW_CAPABILITIES), : eglu::NativeWindow(WINDOW_CAPABILITIES),
mWindow(instance, mWindow(instance,
params.width == eglu::WindowParams::SIZE_DONT_CARE ? DEFAULT_SURFACE_WIDTH : params.width, params.width == eglu::WindowParams::SIZE_DONT_CARE ? DEFAULT_SURFACE_WIDTH : params.width,
...@@ -381,8 +378,12 @@ void NativeWindow::readScreenPixels(tcu::TextureLevel *dst) const ...@@ -381,8 +378,12 @@ void NativeWindow::readScreenPixels(tcu::TextureLevel *dst) const
} // anonymous } // anonymous
ANGLEWin32NativeDisplayFactory::ANGLEWin32NativeDisplayFactory(HINSTANCE instance) ANGLEWin32NativeDisplayFactory::ANGLEWin32NativeDisplayFactory(const std::string &name,
: eglu::NativeDisplayFactory("angle", "Native ANGLE Display", DISPLAY_CAPABILITIES, EGL_PLATFORM_ANGLE_ANGLE, "EGL_EXT_platform_base"), const std::string &description,
const std::vector<eglw::EGLAttrib> &platformAttributes,
HINSTANCE instance)
: eglu::NativeDisplayFactory(name, description, DISPLAY_CAPABILITIES, EGL_PLATFORM_ANGLE_ANGLE, "EGL_EXT_platform_base"),
mPlatformAttributes(platformAttributes),
mInstance(instance) mInstance(instance)
{ {
m_nativeWindowRegistry.registerFactory(new NativeWindowFactory(mInstance)); m_nativeWindowRegistry.registerFactory(new NativeWindowFactory(mInstance));
...@@ -396,7 +397,7 @@ ANGLEWin32NativeDisplayFactory::~ANGLEWin32NativeDisplayFactory() ...@@ -396,7 +397,7 @@ ANGLEWin32NativeDisplayFactory::~ANGLEWin32NativeDisplayFactory()
eglu::NativeDisplay *ANGLEWin32NativeDisplayFactory::createDisplay(const eglw::EGLAttrib *attribList) const eglu::NativeDisplay *ANGLEWin32NativeDisplayFactory::createDisplay(const eglw::EGLAttrib *attribList) const
{ {
DE_UNREF(attribList); DE_UNREF(attribList);
return new NativeDisplay(); return new ANGLENativeDisplay(mPlatformAttributes);
} }
} // tcu } // tcu
...@@ -32,12 +32,16 @@ namespace tcu ...@@ -32,12 +32,16 @@ namespace tcu
class ANGLEWin32NativeDisplayFactory : public eglu::NativeDisplayFactory class ANGLEWin32NativeDisplayFactory : public eglu::NativeDisplayFactory
{ {
public: public:
ANGLEWin32NativeDisplayFactory(HINSTANCE instance); ANGLEWin32NativeDisplayFactory(const std::string &name,
const std::string &description,
const std::vector<eglw::EGLAttrib> &platformAttributes,
HINSTANCE instance);
~ANGLEWin32NativeDisplayFactory() override; ~ANGLEWin32NativeDisplayFactory() override;
eglu::NativeDisplay *createDisplay(const eglw::EGLAttrib* attribList) const override; eglu::NativeDisplay *createDisplay(const eglw::EGLAttrib* attribList) const override;
private: private:
std::vector<eglw::EGLAttrib> mPlatformAttributes;
const HINSTANCE mInstance; const HINSTANCE mInstance;
}; };
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#include "tcuANGLEWin32NativeDisplayFactory.h" #include "tcuANGLEWin32NativeDisplayFactory.h"
#include "egluGLContextFactory.hpp" #include "egluGLContextFactory.hpp"
#include <EGL/egl.h>
#include <EGL/eglext.h>
namespace tcu namespace tcu
{ {
...@@ -31,7 +34,62 @@ ANGLEWin32Platform::ANGLEWin32Platform() ...@@ -31,7 +34,62 @@ ANGLEWin32Platform::ANGLEWin32Platform()
// Set process priority to lower. // Set process priority to lower.
SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
m_nativeDisplayFactoryRegistry.registerFactory(new ANGLEWin32NativeDisplayFactory(mInstance)); #if defined(ANGLE_DEQP_GLES2_TESTS) || defined(ANGLE_DEQP_GLES3_TESTS)
std::vector<eglw::EGLAttrib> d3d11Attribs;
d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
d3d11Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_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(
"angle-d3d11", "ANGLE D3D11 Display", d3d11Attribs, mInstance);
m_nativeDisplayFactoryRegistry.registerFactory(d3d11Factory);
#endif
#if defined(ANGLE_DEQP_GLES2_TESTS)
std::vector<eglw::EGLAttrib> d3d9Attribs;
d3d9Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
d3d9Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE);
d3d9Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_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(
"angle-d3d9", "ANGLE D3D9 Display", d3d9Attribs, mInstance);
m_nativeDisplayFactoryRegistry.registerFactory(d3d9Factory);
std::vector<eglw::EGLAttrib> d3d1193Attribs;
d3d1193Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
d3d1193Attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
d3d1193Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE);
d3d1193Attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
d3d1193Attribs.push_back(EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE);
d3d1193Attribs.push_back(9);
d3d1193Attribs.push_back(EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE);
d3d1193Attribs.push_back(3);
d3d1193Attribs.push_back(EGL_NONE);
d3d1193Attribs.push_back(EGL_NONE);
auto *d3d1193Factory = new ANGLEWin32NativeDisplayFactory(
"angle-d3d11-fl93", "ANGLE D3D11 FL9_3 Display", d3d1193Attribs, mInstance);
m_nativeDisplayFactoryRegistry.registerFactory(d3d1193Factory);
std::vector<eglw::EGLAttrib> glAttribs;
glAttribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
glAttribs.push_back(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE);
glAttribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE);
glAttribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
glAttribs.push_back(EGL_NONE);
glAttribs.push_back(EGL_NONE);
auto *glFactory = new ANGLEWin32NativeDisplayFactory(
"angle-gl", "ANGLE OpenGL Display", glAttribs, mInstance);
m_nativeDisplayFactoryRegistry.registerFactory(glFactory);
#endif
m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry)); m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
} }
......
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