Hash :
3b7528e1
Author :
Date :
2025-05-20T12:31:28
Support running the full end2end suite against the System EGL Update the end2end test instantiation to either fully target the packaged ANGLE libraries or the system EGL, but not a combination of both simultaneously. The GN argument |angle_test_enable_system_egl| controls which driver is being tested by all the instantiated tests. It's default value is "false", which means the tests target the ANGLE libraries by default: kDefaultGLESDriver = GLESDriverType::AngleEGL When |angle_test_enable_system_egl = true|: kDefaultGLESDriver = GLESDriverType::SystemEGL This allows for testing the system EGL with the full end2end test suite, which is useful on devices where ANGLE is the system EGL (e.g., Android). It also allows for specifying which backend to use (or all) during system EGL testing, when ANGLE is the EGL driver. This also includes removing the various ESx_EGL() functions, because the end2end tests must now fully commit to testing either the ANGLE driver or system driver, rather than a combination of both. This is similar to many other test suites, such as the Khronos CTS (dEQP), which only test validate a single driver per invocation. Bug: b/279980674 Test: angle_end2end_tests Change-Id: I4f7dc2ccb4f26b3bd02767d0a0d2876f8612f2ae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6580876 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
//
// 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_
#include "util/util_gl.h"
#include "autogen/angle_features_autogen.h"
#include <string>
#include <tuple>
#include <vector>
namespace angle
{
struct PlatformMethods;
// 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 compatibility extensions. See util/WGLWindow.h.
enum class GLESDriverType
{
AngleEGL,
AngleVulkanSecondariesEGL,
SystemEGL,
SystemWGL,
ZinkEGL,
};
// The ANGLE test suite with all the various front/backend combinations can be instantiated for
// only either the packaged ANGLE libraries (AngleEGL) or the system libraries (SystemEGL), but not
// both at the same time.
#if !defined(ANGLE_TEST_ENABLE_SYSTEM_EGL)
constexpr GLESDriverType kDefaultGLESDriver = GLESDriverType::AngleEGL;
#else
constexpr GLESDriverType kDefaultGLESDriver = GLESDriverType::SystemEGL;
#endif
inline bool IsANGLE(angle::GLESDriverType driverType)
{
return driverType == angle::GLESDriverType::AngleEGL ||
driverType == angle::GLESDriverType::AngleVulkanSecondariesEGL;
}
GLESDriverType GetDriverTypeFromString(const char *driverName, GLESDriverType defaultDriverType);
} // namespace angle
struct EGLPlatformParameters
{
EGLPlatformParameters() = default;
explicit EGLPlatformParameters(EGLint renderer) : renderer(renderer) {}
EGLPlatformParameters(EGLint renderer,
EGLint majorVersion,
EGLint minorVersion,
EGLint deviceType)
: renderer(renderer),
majorVersion(majorVersion),
minorVersion(minorVersion),
deviceType(deviceType)
{}
EGLPlatformParameters(EGLint renderer,
EGLint majorVersion,
EGLint minorVersion,
EGLint deviceType,
EGLint presentPath)
: renderer(renderer),
majorVersion(majorVersion),
minorVersion(minorVersion),
deviceType(deviceType),
presentPath(presentPath)
{}
auto tie() const
{
return std::tie(renderer, majorVersion, minorVersion, deviceType, presentPath,
debugLayersEnabled, robustness, displayPowerPreference,
disabledFeatureOverrides, enabledFeatureOverrides, platformMethods);
}
// Helpers to enable and disable ANGLE features. Expects a kFeature* value from
// angle_features_autogen.h.
EGLPlatformParameters &enable(angle::Feature feature)
{
enabledFeatureOverrides.push_back(feature);
return *this;
}
EGLPlatformParameters &disable(angle::Feature feature)
{
disabledFeatureOverrides.push_back(feature);
return *this;
}
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 robustness = EGL_DONT_CARE;
EGLint displayPowerPreference = EGL_DONT_CARE;
std::vector<angle::Feature> enabledFeatureOverrides;
std::vector<angle::Feature> disabledFeatureOverrides;
angle::PlatformMethods *platformMethods = nullptr;
};
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();
}
#endif // UTIL_EGLPLATFORMPARAMETERS_H_