2018-12-29 18:29:33 +03:00
|
|
|
//
|
|
|
|
// Copyright 2018 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.
|
|
|
|
//
|
|
|
|
// EGLPlatformParameters: Basic description of an EGL device.
|
|
|
|
|
|
|
|
#ifndef UTIL_EGLPLATFORMPARAMETERS_H_
|
|
|
|
#define UTIL_EGLPLATFORMPARAMETERS_H_
|
|
|
|
|
2019-05-01 22:11:46 +03:00
|
|
|
#include "util/util_gl.h"
|
2018-12-29 18:29:33 +03:00
|
|
|
|
2019-05-01 22:11:46 +03:00
|
|
|
#include <tuple>
|
2018-12-29 18:29:33 +03:00
|
|
|
|
2019-05-01 22:11:46 +03:00
|
|
|
namespace angle
|
2018-12-29 18:29:33 +03:00
|
|
|
{
|
2019-05-01 22:11:46 +03:00
|
|
|
struct PlatformMethods;
|
2020-03-23 21:47:03 +03:00
|
|
|
|
|
|
|
// The GLES driver type determines what shared object we use to load the GLES entry points.
|
|
|
|
// AngleEGL loads from ANGLE's version of libEGL, libGLESv2, and libGLESv1_CM.
|
|
|
|
// SystemEGL uses the system copies of libEGL, libGLESv2, and libGLESv1_CM.
|
|
|
|
// SystemWGL loads Windows GL with the GLES compatiblity extensions. See util/WGLWindow.h.
|
|
|
|
enum class GLESDriverType
|
|
|
|
{
|
|
|
|
AngleEGL,
|
|
|
|
SystemEGL,
|
|
|
|
SystemWGL,
|
|
|
|
};
|
2019-05-01 22:11:46 +03:00
|
|
|
} // namespace angle
|
|
|
|
|
|
|
|
struct EGLPlatformParameters
|
|
|
|
{
|
|
|
|
EGLPlatformParameters() = default;
|
|
|
|
|
|
|
|
explicit EGLPlatformParameters(EGLint renderer) : renderer(renderer) {}
|
|
|
|
|
2018-12-29 18:29:33 +03:00
|
|
|
EGLPlatformParameters(EGLint renderer,
|
|
|
|
EGLint majorVersion,
|
|
|
|
EGLint minorVersion,
|
2019-05-01 22:11:46 +03:00
|
|
|
EGLint deviceType)
|
|
|
|
: renderer(renderer),
|
|
|
|
majorVersion(majorVersion),
|
|
|
|
minorVersion(minorVersion),
|
|
|
|
deviceType(deviceType)
|
|
|
|
{}
|
|
|
|
|
2018-12-29 18:29:33 +03:00
|
|
|
EGLPlatformParameters(EGLint renderer,
|
|
|
|
EGLint majorVersion,
|
|
|
|
EGLint minorVersion,
|
|
|
|
EGLint deviceType,
|
2019-05-01 22:11:46 +03:00
|
|
|
EGLint presentPath)
|
|
|
|
: renderer(renderer),
|
|
|
|
majorVersion(majorVersion),
|
|
|
|
minorVersion(minorVersion),
|
|
|
|
deviceType(deviceType),
|
|
|
|
presentPath(presentPath)
|
|
|
|
{}
|
|
|
|
|
|
|
|
auto tie() const
|
|
|
|
{
|
|
|
|
return std::tie(renderer, majorVersion, minorVersion, deviceType, presentPath,
|
2020-02-13 01:29:27 +03:00
|
|
|
debugLayersEnabled, contextVirtualization, transformFeedbackFeature,
|
2020-05-30 02:09:47 +03:00
|
|
|
allocateNonZeroMemoryFeature, emulateCopyTexImage2DFromRenderbuffers,
|
2020-08-04 07:08:00 +03:00
|
|
|
shaderStencilOutputFeature, genMultipleMipsPerPassFeature, platformMethods,
|
|
|
|
robustness);
|
2019-05-01 22:11:46 +03:00
|
|
|
}
|
|
|
|
|
2020-05-30 02:09:47 +03:00
|
|
|
EGLint renderer = EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE;
|
|
|
|
EGLint majorVersion = EGL_DONT_CARE;
|
|
|
|
EGLint minorVersion = EGL_DONT_CARE;
|
|
|
|
EGLint deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
|
|
|
|
EGLint presentPath = EGL_DONT_CARE;
|
|
|
|
EGLint debugLayersEnabled = EGL_DONT_CARE;
|
|
|
|
EGLint contextVirtualization = EGL_DONT_CARE;
|
|
|
|
EGLint robustness = EGL_DONT_CARE;
|
|
|
|
EGLint transformFeedbackFeature = EGL_DONT_CARE;
|
|
|
|
EGLint allocateNonZeroMemoryFeature = EGL_DONT_CARE;
|
|
|
|
EGLint emulateCopyTexImage2DFromRenderbuffers = EGL_DONT_CARE;
|
2020-08-23 17:58:56 +03:00
|
|
|
EGLint shaderStencilOutputFeature = EGL_DONT_CARE;
|
2020-08-04 07:08:00 +03:00
|
|
|
EGLint genMultipleMipsPerPassFeature = EGL_DONT_CARE;
|
2020-05-30 02:09:47 +03:00
|
|
|
angle::PlatformMethods *platformMethods = nullptr;
|
2018-12-29 18:29:33 +03:00
|
|
|
};
|
|
|
|
|
2019-05-01 22:11:46 +03:00
|
|
|
inline bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
|
|
|
|
{
|
|
|
|
return a.tie() < b.tie();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
|
|
|
|
{
|
|
|
|
return a.tie() == b.tie();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool operator!=(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
|
|
|
|
{
|
|
|
|
return a.tie() != b.tie();
|
|
|
|
}
|
2018-12-29 18:29:33 +03:00
|
|
|
|
|
|
|
#endif // UTIL_EGLPLATFORMPARAMETERS_H_
|