Path: blob/main_old/util/EGLPlatformParameters.h
1693 views
//1// Copyright 2018 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// EGLPlatformParameters: Basic description of an EGL device.67#ifndef UTIL_EGLPLATFORMPARAMETERS_H_8#define UTIL_EGLPLATFORMPARAMETERS_H_910#include "util/util_gl.h"1112#include <tuple>1314namespace angle15{16struct PlatformMethods;1718// The GLES driver type determines what shared object we use to load the GLES entry points.19// AngleEGL loads from ANGLE's version of libEGL, libGLESv2, and libGLESv1_CM.20// SystemEGL uses the system copies of libEGL, libGLESv2, and libGLESv1_CM.21// SystemWGL loads Windows GL with the GLES compatibility extensions. See util/WGLWindow.h.22enum class GLESDriverType23{24AngleEGL,25SystemEGL,26SystemWGL,27};28} // namespace angle2930struct EGLPlatformParameters31{32EGLPlatformParameters() = default;3334explicit EGLPlatformParameters(EGLint renderer) : renderer(renderer) {}3536EGLPlatformParameters(EGLint renderer,37EGLint majorVersion,38EGLint minorVersion,39EGLint deviceType)40: renderer(renderer),41majorVersion(majorVersion),42minorVersion(minorVersion),43deviceType(deviceType)44{}4546EGLPlatformParameters(EGLint renderer,47EGLint majorVersion,48EGLint minorVersion,49EGLint deviceType,50EGLint presentPath)51: renderer(renderer),52majorVersion(majorVersion),53minorVersion(minorVersion),54deviceType(deviceType),55presentPath(presentPath)56{}5758auto tie() const59{60return std::tie(renderer, majorVersion, minorVersion, deviceType, presentPath,61debugLayersEnabled, contextVirtualization, transformFeedbackFeature,62allocateNonZeroMemoryFeature, emulateCopyTexImage2DFromRenderbuffers,63shaderStencilOutputFeature, genMultipleMipsPerPassFeature, platformMethods,64robustness, emulatedPrerotation, asyncCommandQueueFeatureVulkan,65hasExplicitMemBarrierFeatureMtl, hasCheapRenderPassFeatureMtl,66forceBufferGPUStorageFeatureMtl, supportsVulkanViewportFlip, emulatedVAOs,67directSPIRVGeneration, captureLimits, forceRobustResourceInit,68directMetalGeneration, forceInitShaderVariables);69}7071EGLint renderer = EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE;72EGLint majorVersion = EGL_DONT_CARE;73EGLint minorVersion = EGL_DONT_CARE;74EGLint deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;75EGLint presentPath = EGL_DONT_CARE;76EGLint debugLayersEnabled = EGL_DONT_CARE;77EGLint contextVirtualization = EGL_DONT_CARE;78EGLint robustness = EGL_DONT_CARE;79EGLint transformFeedbackFeature = EGL_DONT_CARE;80EGLint allocateNonZeroMemoryFeature = EGL_DONT_CARE;81EGLint emulateCopyTexImage2DFromRenderbuffers = EGL_DONT_CARE;82EGLint shaderStencilOutputFeature = EGL_DONT_CARE;83EGLint genMultipleMipsPerPassFeature = EGL_DONT_CARE;84uint32_t emulatedPrerotation = 0; // Can be 0, 90, 180 or 27085EGLint asyncCommandQueueFeatureVulkan = EGL_DONT_CARE;86EGLint hasExplicitMemBarrierFeatureMtl = EGL_DONT_CARE;87EGLint hasCheapRenderPassFeatureMtl = EGL_DONT_CARE;88EGLint forceBufferGPUStorageFeatureMtl = EGL_DONT_CARE;89EGLint supportsVulkanViewportFlip = EGL_DONT_CARE;90EGLint emulatedVAOs = EGL_DONT_CARE;91EGLint directSPIRVGeneration = EGL_DONT_CARE;92EGLint captureLimits = EGL_DONT_CARE;93EGLint forceRobustResourceInit = EGL_DONT_CARE;94EGLint directMetalGeneration = EGL_DONT_CARE;95EGLint forceInitShaderVariables = EGL_DONT_CARE;9697angle::PlatformMethods *platformMethods = nullptr;98};99100inline bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b)101{102return a.tie() < b.tie();103}104105inline bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b)106{107return a.tie() == b.tie();108}109110inline bool operator!=(const EGLPlatformParameters &a, const EGLPlatformParameters &b)111{112return a.tie() != b.tie();113}114115#endif // UTIL_EGLPLATFORMPARAMETERS_H_116117118