зеркало из https://github.com/AvaloniaUI/angle.git
Only run tests that the current hardware can support.
For each config, determine if a context can be created at test instantiation time. This allows skipping of ES3 tests when the hardware does not support ES3. Updated the perf_tests to use the EGLPlatformParameters struct so that they can be filtered in the same way. Change-Id: If664604b057cec4005eb4b63bebd83cd4964b7b2 Reviewed-on: https://chromium-review.googlesource.com/276460 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Родитель
34482831b0
Коммит
dd323e9568
|
@ -58,7 +58,9 @@
|
|||
'<(angle_path)/src/tests/egl_tests/EGLSurfaceTest.cpp',
|
||||
'<(angle_path)/src/tests/test_utils/ANGLETest.cpp',
|
||||
'<(angle_path)/src/tests/test_utils/ANGLETest.h',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_configs.cpp',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_configs.h',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_instantiate.cpp',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_instantiate.h',
|
||||
],
|
||||
'angle_end2end_tests_win_sources':
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
'<(angle_path)/src/tests/perf_tests/TexSubImage.cpp',
|
||||
'<(angle_path)/src/tests/perf_tests/third_party/perf/perf_test.cc',
|
||||
'<(angle_path)/src/tests/perf_tests/third_party/perf/perf_test.h',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_configs.cpp',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_configs.h',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_instantiate.cpp',
|
||||
'<(angle_path)/src/tests/test_utils/angle_test_instantiate.h',
|
||||
],
|
||||
'angle_perf_tests_win_sources':
|
||||
|
|
|
@ -46,7 +46,7 @@ class EGLContextCompatibilityTest : public testing::TestWithParam<PlatformParame
|
|||
|
||||
EGLint dispattrs[] =
|
||||
{
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().mEGLPlatformParameters.renderer,
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(),
|
||||
EGL_NONE
|
||||
};
|
||||
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, dispattrs);
|
||||
|
|
|
@ -18,14 +18,14 @@ class EGLQueryContextTest : public testing::TestWithParam<PlatformParameters>
|
|||
public:
|
||||
void SetUp() override
|
||||
{
|
||||
int clientVersion = GetParam().mClientVersion;
|
||||
int clientVersion = GetParam().majorVersion;
|
||||
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
|
||||
EXPECT_TRUE(eglGetPlatformDisplayEXT != NULL);
|
||||
|
||||
EGLint dispattrs[] =
|
||||
{
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().mEGLPlatformParameters.renderer,
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(),
|
||||
EGL_NONE
|
||||
};
|
||||
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, dispattrs);
|
||||
|
@ -96,7 +96,7 @@ TEST_P(EGLQueryContextTest, GetClientVersion)
|
|||
{
|
||||
EGLint clientVersion;
|
||||
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_VERSION, &clientVersion) != EGL_FALSE);
|
||||
EXPECT_TRUE(clientVersion == GetParam().mClientVersion);
|
||||
EXPECT_TRUE(clientVersion == GetParam().majorVersion);
|
||||
}
|
||||
|
||||
TEST_P(EGLQueryContextTest, GetRenderBufferNoSurface)
|
||||
|
|
|
@ -26,7 +26,7 @@ protected:
|
|||
|
||||
TEST_P(DiscardFramebufferEXTTest, ExtensionEnabled)
|
||||
{
|
||||
EGLPlatformParameters platform = GetParam().mEGLPlatformParameters;
|
||||
EGLPlatformParameters platform = GetParam().eglParameters;
|
||||
|
||||
if (platform.renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
|
||||
{
|
||||
|
|
|
@ -77,7 +77,7 @@ class FramebufferFormatsTest : public ANGLETest
|
|||
return;
|
||||
}
|
||||
|
||||
GLint clientVersion = GetParam().mClientVersion;
|
||||
int clientVersion = getClientVersion();
|
||||
if (clientVersion < minESVersion)
|
||||
{
|
||||
return;
|
||||
|
@ -220,7 +220,7 @@ TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F_STENCIL8)
|
|||
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_STENCIL_INDEX8)
|
||||
{
|
||||
// TODO(geofflang): Figure out how to support GLSTENCIL_INDEX8 on desktop GL
|
||||
if (GetParam().mEGLPlatformParameters.renderer == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
|
||||
if (GetParam().getRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
|
||||
{
|
||||
std::cout << "Test skipped on Desktop OpenGL." << std::endl;
|
||||
return;
|
||||
|
|
|
@ -551,7 +551,7 @@ TEST_P(GLSLTest, InvariantVaryingOut)
|
|||
|
||||
TEST_P(GLSLTest, FrontFacingAndVarying)
|
||||
{
|
||||
EGLPlatformParameters platform = GetParam().mEGLPlatformParameters;
|
||||
EGLPlatformParameters platform = GetParam().eglParameters;
|
||||
|
||||
// Disable this test on D3D11 feature level 9_3, since gl_FrontFacing isn't supported.
|
||||
if (platform.renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
|
||||
|
|
|
@ -33,7 +33,7 @@ TEST_P(RendererTest, RequestedRendererCreated)
|
|||
std::string versionString = std::string(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
|
||||
std::transform(versionString.begin(), versionString.end(), versionString.begin(), ::tolower);
|
||||
|
||||
const EGLPlatformParameters &platform = GetParam().mEGLPlatformParameters;
|
||||
const EGLPlatformParameters &platform = GetParam().eglParameters;
|
||||
|
||||
// Ensure that the renderer string contains D3D11, if we requested a D3D11 renderer.
|
||||
if (platform.renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
|
||||
|
@ -101,7 +101,7 @@ TEST_P(RendererTest, RequestedRendererCreated)
|
|||
ASSERT_TRUE(found);
|
||||
}
|
||||
|
||||
EGLint glesMajorVersion = GetParam().mClientVersion;
|
||||
EGLint glesMajorVersion = GetParam().majorVersion;
|
||||
|
||||
// Ensure that the renderer string contains GL ES 3.0, if we requested a GL ES 3.0
|
||||
if (glesMajorVersion == 3)
|
||||
|
|
|
@ -70,7 +70,7 @@ void ANGLEPerfTest::TearDown()
|
|||
|
||||
std::string RenderTestParams::suffix() const
|
||||
{
|
||||
switch (requestedRenderer)
|
||||
switch (getRenderer())
|
||||
{
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE: return "_d3d11";
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE: return "_d3d9";
|
||||
|
@ -81,11 +81,6 @@ std::string RenderTestParams::suffix() const
|
|||
}
|
||||
}
|
||||
|
||||
EGLint RenderTestParams::getRenderer() const
|
||||
{
|
||||
return requestedRenderer;
|
||||
}
|
||||
|
||||
ANGLERenderTest::ANGLERenderTest(const std::string &name, const RenderTestParams &testParams)
|
||||
: ANGLEPerfTest(name, testParams.suffix()),
|
||||
mTestParams(testParams),
|
||||
|
@ -104,16 +99,11 @@ ANGLERenderTest::~ANGLERenderTest()
|
|||
|
||||
void ANGLERenderTest::SetUp()
|
||||
{
|
||||
EGLPlatformParameters platformParams(mTestParams.requestedRenderer,
|
||||
EGL_DONT_CARE,
|
||||
EGL_DONT_CARE,
|
||||
mTestParams.deviceType);
|
||||
|
||||
mOSWindow = CreateOSWindow();
|
||||
mEGLWindow = new EGLWindow(mTestParams.widowWidth,
|
||||
mTestParams.windowHeight,
|
||||
mTestParams.glesMajorVersion,
|
||||
platformParams);
|
||||
mTestParams.majorVersion,
|
||||
mTestParams.eglParameters);
|
||||
mEGLWindow->setSwapInterval(0);
|
||||
|
||||
if (!mOSWindow->initialize(mName, mEGLWindow->getWidth(), mEGLWindow->getHeight()))
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "Timer.h"
|
||||
#include "common/angleutils.h"
|
||||
#include "common/debug.h"
|
||||
#include "test_utils/angle_test_configs.h"
|
||||
#include "test_utils/angle_test_instantiate.h"
|
||||
|
||||
class Event;
|
||||
|
@ -52,15 +53,10 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable
|
|||
int mNumFrames;
|
||||
};
|
||||
|
||||
struct RenderTestParams
|
||||
struct RenderTestParams : public angle::PlatformParameters
|
||||
{
|
||||
virtual std::string suffix() const;
|
||||
|
||||
EGLint getRenderer() const;
|
||||
|
||||
EGLint requestedRenderer;
|
||||
EGLint deviceType;
|
||||
EGLint glesMajorVersion;
|
||||
EGLint widowWidth;
|
||||
EGLint windowHeight;
|
||||
};
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "ANGLEPerfTest.h"
|
||||
#include "shader_utils.h"
|
||||
|
||||
using namespace angle;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -20,7 +22,8 @@ struct BufferSubDataParams final : public RenderTestParams
|
|||
BufferSubDataParams()
|
||||
{
|
||||
// Common default values
|
||||
glesMajorVersion = 2;
|
||||
majorVersion = 2;
|
||||
minorVersion = 0;
|
||||
widowWidth = 512;
|
||||
windowHeight = 512;
|
||||
updateSize = 3000;
|
||||
|
@ -336,8 +339,7 @@ void BufferSubDataBenchmark::drawBenchmark()
|
|||
BufferSubDataParams BufferUpdateD3D11Params()
|
||||
{
|
||||
BufferSubDataParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
||||
params.eglParameters = egl_platform::D3D11();
|
||||
params.vertexType = GL_FLOAT;
|
||||
params.vertexComponentCount = 4;
|
||||
params.vertexNormalized = GL_FALSE;
|
||||
|
@ -347,8 +349,7 @@ BufferSubDataParams BufferUpdateD3D11Params()
|
|||
BufferSubDataParams BufferUpdateD3D9Params()
|
||||
{
|
||||
BufferSubDataParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
||||
params.eglParameters = egl_platform::D3D9();
|
||||
params.vertexType = GL_FLOAT;
|
||||
params.vertexComponentCount = 4;
|
||||
params.vertexNormalized = GL_FALSE;
|
||||
|
@ -358,8 +359,7 @@ BufferSubDataParams BufferUpdateD3D9Params()
|
|||
BufferSubDataParams BufferUpdateOpenGLParams()
|
||||
{
|
||||
BufferSubDataParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE;
|
||||
params.deviceType = EGL_DONT_CARE;
|
||||
params.eglParameters = egl_platform::OPENGL();
|
||||
params.vertexType = GL_FLOAT;
|
||||
params.vertexComponentCount = 4;
|
||||
params.vertexNormalized = GL_FALSE;
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "ANGLEPerfTest.h"
|
||||
#include "shader_utils.h"
|
||||
|
||||
using namespace angle;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -25,7 +27,8 @@ struct DrawCallPerfParams final : public RenderTestParams
|
|||
// Common default options
|
||||
DrawCallPerfParams()
|
||||
{
|
||||
glesMajorVersion = 2;
|
||||
majorVersion = 2;
|
||||
minorVersion = 0;
|
||||
widowWidth = 256;
|
||||
windowHeight = 256;
|
||||
iterations = 50;
|
||||
|
@ -44,7 +47,7 @@ struct DrawCallPerfParams final : public RenderTestParams
|
|||
strstr << "_validation_only";
|
||||
}
|
||||
|
||||
if (deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE)
|
||||
if (eglParameters.deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE)
|
||||
{
|
||||
strstr << "_null";
|
||||
}
|
||||
|
@ -189,32 +192,28 @@ void DrawCallPerfBenchmark::drawBenchmark()
|
|||
DrawCallPerfParams DrawCallPerfD3D11Params(bool useNullDevice)
|
||||
{
|
||||
DrawCallPerfParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||
params.deviceType = NullDeviceType(useNullDevice);
|
||||
params.eglParameters = egl_platform::D3D11_NULL();
|
||||
return params;
|
||||
}
|
||||
|
||||
DrawCallPerfParams DrawCallPerfD3D9Params(bool useNullDevice)
|
||||
{
|
||||
DrawCallPerfParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
|
||||
params.deviceType = NullDeviceType(useNullDevice);
|
||||
params.eglParameters = egl_platform::DEFAULT_NULL();
|
||||
return params;
|
||||
}
|
||||
|
||||
DrawCallPerfParams DrawCallPerfOpenGLParams(bool useNullDevice)
|
||||
{
|
||||
DrawCallPerfParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE;
|
||||
params.deviceType = NullDeviceType(useNullDevice);
|
||||
params.eglParameters = egl_platform::D3D9_NULL();
|
||||
return params;
|
||||
}
|
||||
|
||||
DrawCallPerfParams DrawCallPerfValidationOnly()
|
||||
{
|
||||
DrawCallPerfParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE;
|
||||
params.eglParameters = egl_platform::OPENGL();
|
||||
params.iterations = 100;
|
||||
params.numTris = 0;
|
||||
params.runTimeSeconds = 5.0;
|
||||
|
|
|
@ -35,7 +35,7 @@ EGLInitializePerfTest::EGLInitializePerfTest()
|
|||
mOSWindow(nullptr),
|
||||
mDisplay(EGL_NO_DISPLAY)
|
||||
{
|
||||
auto platform = GetParam().mEGLPlatformParameters;
|
||||
auto platform = GetParam().eglParameters;
|
||||
|
||||
std::vector<EGLint> displayAttributes;
|
||||
displayAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "ANGLEPerfTest.h"
|
||||
#include "shader_utils.h"
|
||||
|
||||
using namespace angle;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -180,11 +182,11 @@ void IndexConversionPerfTest::drawBenchmark()
|
|||
IndexConversionPerfParams IndexConversionPerfD3D11Params()
|
||||
{
|
||||
IndexConversionPerfParams params;
|
||||
params.glesMajorVersion = 2;
|
||||
params.eglParameters = egl_platform::D3D11_NULL();
|
||||
params.majorVersion = 2;
|
||||
params.minorVersion = 0;
|
||||
params.widowWidth = 256;
|
||||
params.windowHeight = 256;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE;
|
||||
params.iterations = 15;
|
||||
params.numIndexTris = 3000;
|
||||
return params;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "shader_utils.h"
|
||||
#include "random_utils.h"
|
||||
|
||||
using namespace angle;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -22,7 +24,8 @@ struct PointSpritesParams final : public RenderTestParams
|
|||
PointSpritesParams()
|
||||
{
|
||||
// Common default params
|
||||
glesMajorVersion = 2;
|
||||
majorVersion = 2;
|
||||
minorVersion = 0;
|
||||
widowWidth = 1280;
|
||||
windowHeight = 720;
|
||||
iterations = 10;
|
||||
|
@ -202,24 +205,21 @@ void PointSpritesBenchmark::drawBenchmark()
|
|||
PointSpritesParams D3D11Params()
|
||||
{
|
||||
PointSpritesParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
||||
params.eglParameters = egl_platform::D3D11();
|
||||
return params;
|
||||
}
|
||||
|
||||
PointSpritesParams D3D9Params()
|
||||
{
|
||||
PointSpritesParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
||||
params.eglParameters = egl_platform::D3D9();
|
||||
return params;
|
||||
}
|
||||
|
||||
PointSpritesParams OpenGLParams()
|
||||
{
|
||||
PointSpritesParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE;
|
||||
params.deviceType = EGL_DONT_CARE;
|
||||
params.eglParameters = egl_platform::OPENGL();
|
||||
return params;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "ANGLEPerfTest.h"
|
||||
#include "shader_utils.h"
|
||||
|
||||
using namespace angle;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -20,7 +22,8 @@ struct TexSubImageParams final : public RenderTestParams
|
|||
TexSubImageParams()
|
||||
{
|
||||
// Common default parameters
|
||||
glesMajorVersion = 2;
|
||||
majorVersion = 2;
|
||||
minorVersion = 0;
|
||||
widowWidth = 512;
|
||||
windowHeight = 512;
|
||||
|
||||
|
@ -271,24 +274,21 @@ void TexSubImageBenchmark::drawBenchmark()
|
|||
TexSubImageParams D3D11Params()
|
||||
{
|
||||
TexSubImageParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
||||
params.eglParameters = egl_platform::D3D11();
|
||||
return params;
|
||||
}
|
||||
|
||||
TexSubImageParams D3D9Params()
|
||||
{
|
||||
TexSubImageParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
|
||||
params.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
||||
params.eglParameters = egl_platform::D3D9();
|
||||
return params;
|
||||
}
|
||||
|
||||
TexSubImageParams OpenGLParams()
|
||||
{
|
||||
TexSubImageParams params;
|
||||
params.requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE;
|
||||
params.deviceType = EGL_DONT_CARE;
|
||||
params.eglParameters = egl_platform::OPENGL();
|
||||
return params;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
ANGLETest::ANGLETest()
|
||||
: mEGLWindow(nullptr)
|
||||
{
|
||||
mEGLWindow = new EGLWindow(1280, 720, GetParam().mClientVersion, GetParam().mEGLPlatformParameters);
|
||||
mEGLWindow = new EGLWindow(1280, 720, GetParam().majorVersion, GetParam().eglParameters);
|
||||
}
|
||||
|
||||
ANGLETest::~ANGLETest()
|
||||
|
|
|
@ -0,0 +1,494 @@
|
|||
//
|
||||
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
|
||||
#include "test_utils/angle_test_configs.h"
|
||||
|
||||
namespace angle
|
||||
{
|
||||
|
||||
PlatformParameters::PlatformParameters()
|
||||
: PlatformParameters(2, 0, EGLPlatformParameters())
|
||||
{
|
||||
}
|
||||
|
||||
PlatformParameters::PlatformParameters(EGLint majorVersion, EGLint minorVersion,
|
||||
const EGLPlatformParameters &eglPlatformParameters)
|
||||
: majorVersion(majorVersion),
|
||||
minorVersion(minorVersion),
|
||||
eglParameters(eglPlatformParameters)
|
||||
{
|
||||
}
|
||||
|
||||
EGLint PlatformParameters::getRenderer() const
|
||||
{
|
||||
return eglParameters.renderer;
|
||||
}
|
||||
|
||||
bool operator<(const PlatformParameters &a, const PlatformParameters &b)
|
||||
{
|
||||
if (a.majorVersion != b.majorVersion)
|
||||
{
|
||||
return a.majorVersion < b.majorVersion;
|
||||
}
|
||||
|
||||
if (a.minorVersion != b.minorVersion)
|
||||
{
|
||||
return a.minorVersion < b.minorVersion;
|
||||
}
|
||||
|
||||
return a.eglParameters < b.eglParameters;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream& stream, const PlatformParameters &pp)
|
||||
{
|
||||
stream << "ES" << pp.majorVersion << "_" ;
|
||||
if (pp.minorVersion != 0)
|
||||
{
|
||||
stream << pp.minorVersion << "_";
|
||||
}
|
||||
|
||||
switch (pp.eglParameters.renderer)
|
||||
{
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
|
||||
stream << "D3D9";
|
||||
break;
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
|
||||
stream << "D3D11";
|
||||
break;
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
||||
stream << "OPENGL";
|
||||
break;
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
||||
stream << "GLES";
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
||||
if (pp.eglParameters.majorVersion != EGL_DONT_CARE)
|
||||
{
|
||||
stream << "_" << pp.eglParameters.majorVersion;
|
||||
}
|
||||
|
||||
if (pp.eglParameters.minorVersion != EGL_DONT_CARE)
|
||||
{
|
||||
stream << "_" << pp.eglParameters.minorVersion;
|
||||
}
|
||||
|
||||
switch (pp.eglParameters.deviceType)
|
||||
{
|
||||
case EGL_DONT_CARE:
|
||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE:
|
||||
// default
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE:
|
||||
stream << "_REFERENCE";
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE:
|
||||
stream << "_WARP";
|
||||
break;
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
// EGL platforms
|
||||
namespace egl_platform
|
||||
{
|
||||
|
||||
EGLPlatformParameters DEFAULT()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters DEFAULT_NULL()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D9()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D9_NULL()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D9_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL11_1()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL11_0()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL10_1()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL10_0()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL9_3()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
9, 3,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_NULL()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_WARP()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL11_1_WARP()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL11_0_WARP()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL10_1_WARP()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL10_0_WARP()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL9_3_WARP()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
9, 3,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL11_1_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL11_0_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL10_1_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL10_0_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters D3D11_FL9_3_REFERENCE()
|
||||
{
|
||||
return EGLPlatformParameters(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
9, 3,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters OPENGL()
|
||||
{
|
||||
return EGLPlatformParameters(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE);
|
||||
}
|
||||
|
||||
EGLPlatformParameters OPENGLES()
|
||||
{
|
||||
return EGLPlatformParameters(EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE);
|
||||
}
|
||||
|
||||
} // namespace egl_platform
|
||||
|
||||
// ANGLE tests platforms
|
||||
PlatformParameters ES2_D3D9()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D9());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D9_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D9_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL11_0()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL11_0());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL10_1()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL10_1());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL10_0()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL10_0());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL9_3()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL9_3());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_WARP()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL11_0_WARP()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL11_0_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL10_1_WARP()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL10_1_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL10_0_WARP()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL10_0_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL9_3_WARP()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL9_3_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL11_0_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL11_0_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL10_1_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL10_1_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL10_0_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL10_0_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_D3D11_FL9_3_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::D3D11_FL9_3_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL11_1()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL11_1());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL11_0()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL11_0());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL10_1()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL10_1());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL10_0()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL10_0());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_WARP()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL11_1_WARP()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL11_1_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL11_0_WARP()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL11_0_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL10_1_WARP()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL10_1_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL10_0_WARP()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL10_0_WARP());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL11_1_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL11_1_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL11_0_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL11_0_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL10_1_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL10_1_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_D3D11_FL10_0_REFERENCE()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::D3D11_FL10_0_REFERENCE());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_OPENGLES()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::OPENGLES());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_OPENGLES()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::OPENGLES());
|
||||
}
|
||||
|
||||
PlatformParameters ES2_OPENGL()
|
||||
{
|
||||
return PlatformParameters(2, 0, egl_platform::OPENGL());
|
||||
}
|
||||
|
||||
PlatformParameters ES3_OPENGL()
|
||||
{
|
||||
return PlatformParameters(3, 0, egl_platform::OPENGL());
|
||||
}
|
||||
|
||||
} // namespace angle
|
|
@ -18,388 +18,105 @@ namespace angle
|
|||
|
||||
struct PlatformParameters
|
||||
{
|
||||
PlatformParameters(EGLint clientVersion,
|
||||
const EGLPlatformParameters &eglPlatformParameters)
|
||||
: mClientVersion(clientVersion),
|
||||
mEGLPlatformParameters(eglPlatformParameters)
|
||||
{
|
||||
}
|
||||
PlatformParameters();
|
||||
PlatformParameters(EGLint majorVersion, EGLint minorVersion,
|
||||
const EGLPlatformParameters &eglPlatformParameters);
|
||||
|
||||
EGLint getRenderer() const { return mEGLPlatformParameters.renderer; }
|
||||
|
||||
EGLint mClientVersion;
|
||||
EGLPlatformParameters mEGLPlatformParameters;
|
||||
EGLint getRenderer() const;
|
||||
|
||||
EGLint majorVersion;
|
||||
EGLint minorVersion;
|
||||
EGLPlatformParameters eglParameters;
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream& stream,
|
||||
const PlatformParameters &pp)
|
||||
bool operator<(const PlatformParameters &a, const PlatformParameters &b);
|
||||
std::ostream &operator<<(std::ostream& stream, const PlatformParameters &pp);
|
||||
|
||||
// EGL platforms
|
||||
namespace egl_platform
|
||||
{
|
||||
stream << "ES" << pp.mClientVersion << "_";
|
||||
|
||||
switch (pp.mEGLPlatformParameters.renderer)
|
||||
{
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
|
||||
stream << "D3D9";
|
||||
break;
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
|
||||
stream << "D3D11";
|
||||
break;
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
||||
stream << "OPENGL";
|
||||
break;
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
||||
stream << "GLES";
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
EGLPlatformParameters DEFAULT();
|
||||
EGLPlatformParameters DEFAULT_NULL();
|
||||
|
||||
if (pp.mEGLPlatformParameters.majorVersion != EGL_DONT_CARE)
|
||||
{
|
||||
stream << "_" << pp.mEGLPlatformParameters.majorVersion;
|
||||
}
|
||||
EGLPlatformParameters D3D9();
|
||||
EGLPlatformParameters D3D9_NULL();
|
||||
EGLPlatformParameters D3D9_REFERENCE();
|
||||
|
||||
if (pp.mEGLPlatformParameters.minorVersion != EGL_DONT_CARE)
|
||||
{
|
||||
stream << "_" << pp.mEGLPlatformParameters.minorVersion;
|
||||
}
|
||||
EGLPlatformParameters D3D11();
|
||||
EGLPlatformParameters D3D11_FL11_1();
|
||||
EGLPlatformParameters D3D11_FL11_0();
|
||||
EGLPlatformParameters D3D11_FL10_1();
|
||||
EGLPlatformParameters D3D11_FL10_0();
|
||||
EGLPlatformParameters D3D11_FL9_3();
|
||||
|
||||
switch (pp.mEGLPlatformParameters.deviceType)
|
||||
{
|
||||
case EGL_DONT_CARE:
|
||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE:
|
||||
// default
|
||||
break;
|
||||
EGLPlatformParameters D3D11_NULL();
|
||||
|
||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE:
|
||||
stream << "_REFERENCE";
|
||||
break;
|
||||
EGLPlatformParameters D3D11_WARP();
|
||||
EGLPlatformParameters D3D11_FL11_1_WARP();
|
||||
EGLPlatformParameters D3D11_FL11_0_WARP();
|
||||
EGLPlatformParameters D3D11_FL10_1_WARP();
|
||||
EGLPlatformParameters D3D11_FL10_0_WARP();
|
||||
EGLPlatformParameters D3D11_FL9_3_WARP();
|
||||
|
||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE:
|
||||
stream << "_WARP";
|
||||
break;
|
||||
EGLPlatformParameters D3D11_REFERENCE();
|
||||
EGLPlatformParameters D3D11_FL11_1_REFERENCE();
|
||||
EGLPlatformParameters D3D11_FL11_0_REFERENCE();
|
||||
EGLPlatformParameters D3D11_FL10_1_REFERENCE();
|
||||
EGLPlatformParameters D3D11_FL10_0_REFERENCE();
|
||||
EGLPlatformParameters D3D11_FL9_3_REFERENCE();
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
EGLPlatformParameters OPENGL();
|
||||
|
||||
return stream;
|
||||
}
|
||||
EGLPlatformParameters OPENGLES();
|
||||
|
||||
inline PlatformParameters ES2_D3D9()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
} // namespace egl_platform
|
||||
|
||||
inline PlatformParameters ES2_D3D9_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
// ANGLE tests platforms
|
||||
PlatformParameters ES2_D3D9();
|
||||
PlatformParameters ES2_D3D9_REFERENCE();
|
||||
|
||||
inline PlatformParameters ES2_D3D11()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES2_D3D11();
|
||||
PlatformParameters ES2_D3D11_FL11_0();
|
||||
PlatformParameters ES2_D3D11_FL10_1();
|
||||
PlatformParameters ES2_D3D11_FL10_0();
|
||||
PlatformParameters ES2_D3D11_FL9_3();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL11_0()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES2_D3D11_WARP();
|
||||
PlatformParameters ES2_D3D11_FL11_0_WARP();
|
||||
PlatformParameters ES2_D3D11_FL10_1_WARP();
|
||||
PlatformParameters ES2_D3D11_FL10_0_WARP();
|
||||
PlatformParameters ES2_D3D11_FL9_3_WARP();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL10_1()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES2_D3D11_REFERENCE();
|
||||
PlatformParameters ES2_D3D11_FL11_0_REFERENCE();
|
||||
PlatformParameters ES2_D3D11_FL10_1_REFERENCE();
|
||||
PlatformParameters ES2_D3D11_FL10_0_REFERENCE();
|
||||
PlatformParameters ES2_D3D11_FL9_3_REFERENCE();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL10_0()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES3_D3D11();
|
||||
PlatformParameters ES3_D3D11_FL11_1();
|
||||
PlatformParameters ES3_D3D11_FL11_0();
|
||||
PlatformParameters ES3_D3D11_FL10_1();
|
||||
PlatformParameters ES3_D3D11_FL10_0();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL9_3()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
9, 3,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES3_D3D11_WARP();
|
||||
PlatformParameters ES3_D3D11_FL11_1_WARP();
|
||||
PlatformParameters ES3_D3D11_FL11_0_WARP();
|
||||
PlatformParameters ES3_D3D11_FL10_1_WARP();
|
||||
PlatformParameters ES3_D3D11_FL10_0_WARP();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES3_D3D11_REFERENCE();
|
||||
PlatformParameters ES3_D3D11_FL11_1_REFERENCE();
|
||||
PlatformParameters ES3_D3D11_FL11_0_REFERENCE();
|
||||
PlatformParameters ES3_D3D11_FL10_1_REFERENCE();
|
||||
PlatformParameters ES3_D3D11_FL10_0_REFERENCE();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL11_0_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
PlatformParameters ES2_OPENGL();
|
||||
PlatformParameters ES3_OPENGL();
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL10_1_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL10_0_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL9_3_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
9, 3,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL11_0_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL10_1_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL10_0_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_D3D11_FL9_3_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
9, 3,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL11_1()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL11_0()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL10_1()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL10_0()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL11_1_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL11_0_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL10_1_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL10_0_WARP()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
EGL_DONT_CARE, EGL_DONT_CARE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL11_1_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL11_0_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
11, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL10_1_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 1,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_D3D11_FL10_0_REFERENCE()
|
||||
{
|
||||
EGLPlatformParameters eglParams(
|
||||
EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
10, 0,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_OPENGL()
|
||||
{
|
||||
EGLPlatformParameters eglParams(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES2_OPENGLES()
|
||||
{
|
||||
EGLPlatformParameters eglParams(EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE);
|
||||
return PlatformParameters(2, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_OPENGL()
|
||||
{
|
||||
EGLPlatformParameters eglParams(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
|
||||
inline PlatformParameters ES3_OPENGLES()
|
||||
{
|
||||
EGLPlatformParameters eglParams(EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE);
|
||||
return PlatformParameters(3, eglParams);
|
||||
}
|
||||
PlatformParameters ES2_OPENGLES();
|
||||
PlatformParameters ES3_OPENGLES();
|
||||
|
||||
} // namespace angle
|
||||
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
//
|
||||
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
|
||||
// angle_test_instantiate.cpp: Adds support for filtering parameterized
|
||||
// tests by platform, so we skip unsupported configs.
|
||||
|
||||
#include "test_utils/angle_test_instantiate.h"
|
||||
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
|
||||
#include "EGLWindow.h"
|
||||
#include "OSWindow.h"
|
||||
#include "test_utils/angle_test_configs.h"
|
||||
|
||||
namespace angle
|
||||
{
|
||||
|
||||
bool IsPlatformAvailable(const PlatformParameters ¶m)
|
||||
{
|
||||
switch (param.getRenderer())
|
||||
{
|
||||
case EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE:
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
|
||||
#ifndef ANGLE_ENABLE_D3D9
|
||||
return false;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
|
||||
#ifndef ANGLE_ENABLE_D3D11
|
||||
return false;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
||||
#ifndef ANGLE_ENABLE_OPENGL
|
||||
return false;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
||||
static std::map<PlatformParameters, bool> paramAvailabilityCache;
|
||||
auto iter = paramAvailabilityCache.find(param);
|
||||
if (iter != paramAvailabilityCache.end())
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSWindow *osWindow = CreateOSWindow();
|
||||
bool result = osWindow->initialize("CONFIG_TESTER", 1, 1);
|
||||
|
||||
if (result)
|
||||
{
|
||||
EGLWindow *eglWindow = new EGLWindow(1, 1, param.majorVersion, param.eglParameters);
|
||||
result = eglWindow->initializeGL(osWindow);
|
||||
|
||||
eglWindow->destroyGL();
|
||||
SafeDelete(eglWindow);
|
||||
}
|
||||
|
||||
osWindow->destroy();
|
||||
SafeDelete(osWindow);
|
||||
|
||||
paramAvailabilityCache[param] = result;
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::cout << "Skipping tests using configuration " << param << " because it is not available." << std::endl;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -15,9 +15,12 @@
|
|||
namespace angle
|
||||
{
|
||||
|
||||
struct PlatformParameters;
|
||||
|
||||
bool IsPlatformAvailable(const PlatformParameters ¶m);
|
||||
|
||||
// This functions is used to filter which tests should be registered,
|
||||
// internally it T::getRenderer() const that should be implemented for test
|
||||
// parameter types.
|
||||
// T must be or inherit from angle::PlatformParameters.
|
||||
template <typename T>
|
||||
std::vector<T> FilterTestParams(const T *params, size_t numParams)
|
||||
{
|
||||
|
@ -25,34 +28,9 @@ std::vector<T> FilterTestParams(const T *params, size_t numParams)
|
|||
|
||||
for (size_t i = 0; i < numParams; i++)
|
||||
{
|
||||
switch (params[i].getRenderer())
|
||||
if (IsPlatformAvailable(params[i]))
|
||||
{
|
||||
case EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE:
|
||||
filtered.push_back(params[i]);
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
|
||||
#if defined(ANGLE_ENABLE_D3D9)
|
||||
filtered.push_back(params[i]);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
|
||||
#if defined(ANGLE_ENABLE_D3D11)
|
||||
filtered.push_back(params[i]);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
||||
#if defined(ANGLE_ENABLE_OPENGL)
|
||||
filtered.push_back(params[i]);
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,25 @@ EGLPlatformParameters::EGLPlatformParameters(EGLint renderer, EGLint majorVersio
|
|||
{
|
||||
}
|
||||
|
||||
bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
|
||||
{
|
||||
if (a.renderer != b.renderer)
|
||||
{
|
||||
return a.renderer < b.renderer;
|
||||
}
|
||||
|
||||
if (a.majorVersion != b.majorVersion)
|
||||
{
|
||||
return a.majorVersion < b.majorVersion;
|
||||
}
|
||||
|
||||
if (a.minorVersion != b.minorVersion)
|
||||
{
|
||||
return a.minorVersion < b.minorVersion;
|
||||
}
|
||||
|
||||
return a.deviceType < b.deviceType;
|
||||
}
|
||||
|
||||
EGLWindow::EGLWindow(size_t width, size_t height, EGLint glesMajorVersion, const EGLPlatformParameters &platform)
|
||||
: mDisplay(EGL_NO_DISPLAY),
|
||||
|
|
|
@ -43,6 +43,8 @@ struct EGLPlatformParameters
|
|||
EGLPlatformParameters(EGLint renderer, EGLint majorVersion, EGLint minorVersion, EGLint deviceType);
|
||||
};
|
||||
|
||||
bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b);
|
||||
|
||||
class EGLWindow : angle::NonCopyable
|
||||
{
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче