tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Caps.h (24829B)


      1 //
      2 // Copyright 2014 The ANGLE Project Authors. All rights reserved.
      3 // Use of this source code is governed by a BSD-style license that can be
      4 // found in the LICENSE file.
      5 //
      6 
      7 #ifndef LIBANGLE_CAPS_H_
      8 #define LIBANGLE_CAPS_H_
      9 
     10 #include "angle_gl.h"
     11 #include "libANGLE/Version.h"
     12 #include "libANGLE/angletypes.h"
     13 #include "libANGLE/gles_extensions_autogen.h"
     14 #include "libANGLE/renderer/Format.h"
     15 
     16 #include <array>
     17 #include <map>
     18 #include <set>
     19 #include <string>
     20 #include <vector>
     21 
     22 namespace gl
     23 {
     24 struct TextureCaps
     25 {
     26    TextureCaps();
     27    TextureCaps(const TextureCaps &other);
     28    TextureCaps &operator=(const TextureCaps &other);
     29 
     30    ~TextureCaps();
     31 
     32    // Supports for basic texturing: glTexImage, glTexSubImage, etc
     33    bool texturable = false;
     34 
     35    // Support for linear or anisotropic filtering
     36    bool filterable = false;
     37 
     38    // Support for being used as a framebuffer attachment, i.e. glFramebufferTexture2D
     39    bool textureAttachment = false;
     40 
     41    // Support for being used as a renderbuffer format, i.e. glFramebufferRenderbuffer
     42    bool renderbuffer = false;
     43 
     44    // Support for blend modes while being used as a framebuffer attachment
     45    bool blendable = false;
     46 
     47    // Set of supported sample counts, only guaranteed to be valid in ES3.
     48    SupportedSampleSet sampleCounts;
     49 
     50    // Get the maximum number of samples supported
     51    GLuint getMaxSamples() const;
     52 
     53    // Get the number of supported samples that is at least as many as requested.  Returns 0 if
     54    // there are no sample counts available
     55    GLuint getNearestSamples(GLuint requestedSamples) const;
     56 };
     57 
     58 TextureCaps GenerateMinimumTextureCaps(GLenum internalFormat,
     59                                       const Version &clientVersion,
     60                                       const Extensions &extensions);
     61 
     62 class TextureCapsMap final : angle::NonCopyable
     63 {
     64  public:
     65    TextureCapsMap();
     66    ~TextureCapsMap();
     67 
     68    // These methods are deprecated. Please use angle::Format for new features.
     69    void insert(GLenum internalFormat, const TextureCaps &caps);
     70    const TextureCaps &get(GLenum internalFormat) const;
     71 
     72    void clear();
     73 
     74    // Prefer using angle::Format methods.
     75    const TextureCaps &get(angle::FormatID formatID) const;
     76    void set(angle::FormatID formatID, const TextureCaps &caps);
     77 
     78  private:
     79    TextureCaps &get(angle::FormatID formatID);
     80 
     81    // Indexed by angle::FormatID
     82    angle::FormatMap<TextureCaps> mFormatData;
     83 };
     84 
     85 void InitMinimumTextureCapsMap(const Version &clientVersion,
     86                               const Extensions &extensions,
     87                               TextureCapsMap *capsMap);
     88 
     89 // Returns true if all the formats required to support GL_ANGLE_compressed_texture_etc are
     90 // present. Does not determine if they are natively supported without decompression.
     91 bool DetermineCompressedTextureETCSupport(const TextureCapsMap &textureCaps);
     92 
     93 // Pointer to a boolean member of the Extensions struct
     94 using ExtensionBool = bool Extensions::*;
     95 
     96 struct ExtensionInfo
     97 {
     98    // If this extension can be enabled or disabled  with glRequestExtension
     99    // (GL_ANGLE_request_extension)
    100    bool Requestable = false;
    101    bool Disablable  = false;
    102 
    103    // Pointer to a boolean member of the Extensions struct
    104    ExtensionBool ExtensionsMember = nullptr;
    105 };
    106 
    107 using ExtensionInfoMap = std::map<std::string, ExtensionInfo>;
    108 const ExtensionInfoMap &GetExtensionInfoMap();
    109 
    110 struct Limitations
    111 {
    112    Limitations();
    113    Limitations(const Limitations &other);
    114 
    115    Limitations &operator=(const Limitations &other);
    116 
    117    // Renderer doesn't support gl_FrontFacing in fragment shaders
    118    bool noFrontFacingSupport = false;
    119 
    120    // Renderer doesn't support GL_SAMPLE_ALPHA_TO_COVERAGE
    121    bool noSampleAlphaToCoverageSupport = false;
    122 
    123    // In glVertexAttribDivisorANGLE, attribute zero must have a zero divisor
    124    bool attributeZeroRequiresZeroDivisorInEXT = false;
    125 
    126    // Unable to support different values for front and back faces for stencil refs and masks
    127    bool noSeparateStencilRefsAndMasks = false;
    128 
    129    // Renderer doesn't support non-constant indexing loops in fragment shader
    130    bool shadersRequireIndexedLoopValidation = false;
    131 
    132    // Renderer doesn't support Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA
    133    // and GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR blend functions.
    134    bool noSimultaneousConstantColorAndAlphaBlendFunc = false;
    135 
    136    // Renderer always clamps constant blend color.
    137    bool noUnclampedBlendColor = false;
    138 
    139    // D3D9 does not support flexible varying register packing.
    140    bool noFlexibleVaryingPacking = false;
    141 
    142    // D3D does not support having multiple transform feedback outputs go to the same buffer.
    143    bool noDoubleBoundTransformFeedbackBuffers = false;
    144 
    145    // D3D does not support vertex attribute aliasing
    146    bool noVertexAttributeAliasing = false;
    147 
    148    // Renderer doesn't support GL_TEXTURE_COMPARE_MODE=GL_NONE on a shadow sampler.
    149    // TODO(http://anglebug.com/5231): add validation code to front-end.
    150    bool noShadowSamplerCompareModeNone = false;
    151 
    152    // PVRTC1 textures must be squares.
    153    bool squarePvrtc1 = false;
    154 
    155    // ETC1 texture support is emulated.
    156    bool emulatedEtc1 = false;
    157 
    158    // ASTC texture support is emulated.
    159    bool emulatedAstc = false;
    160 
    161    // No compressed TEXTURE_3D support.
    162    bool noCompressedTexture3D = false;
    163 
    164    // D3D does not support compressed textures where the base mip level is not a multiple of 4
    165    bool compressedBaseMipLevelMultipleOfFour = false;
    166 
    167    bool limitWebglMaxTextureSizeTo4096 = false;
    168 };
    169 
    170 struct TypePrecision
    171 {
    172    TypePrecision();
    173    TypePrecision(const TypePrecision &other);
    174 
    175    TypePrecision &operator=(const TypePrecision &other);
    176 
    177    void setIEEEFloat();
    178    void setIEEEHalfFloat();
    179    void setTwosComplementInt(unsigned int bits);
    180    void setSimulatedFloat(unsigned int range, unsigned int precision);
    181    void setSimulatedInt(unsigned int range);
    182 
    183    void get(GLint *returnRange, GLint *returnPrecision) const;
    184 
    185    std::array<GLint, 2> range = {0, 0};
    186    GLint precision            = 0;
    187 };
    188 
    189 struct Caps
    190 {
    191    Caps();
    192    Caps(const Caps &other);
    193    Caps &operator=(const Caps &other);
    194 
    195    ~Caps();
    196 
    197    // If the values could be got by using GetIntegeri_v, they should
    198    // be GLint instead of GLuint and call LimitToInt() to ensure
    199    // they will not overflow.
    200 
    201    GLfloat minInterpolationOffset        = 0;
    202    GLfloat maxInterpolationOffset        = 0;
    203    GLint subPixelInterpolationOffsetBits = 0;
    204 
    205    // ES 3.1 (April 29, 2015) 20.39: implementation dependent values
    206    GLint64 maxElementIndex       = 0;
    207    GLint max3DTextureSize        = 0;
    208    GLint max2DTextureSize        = 0;
    209    GLint maxRectangleTextureSize = 0;
    210    GLint maxArrayTextureLayers   = 0;
    211    GLfloat maxLODBias            = 0.0f;
    212    GLint maxCubeMapTextureSize   = 0;
    213    GLint maxRenderbufferSize     = 0;
    214    GLfloat minAliasedPointSize   = 1.0f;
    215    GLfloat maxAliasedPointSize   = 1.0f;
    216    GLfloat minAliasedLineWidth   = 0.0f;
    217    GLfloat maxAliasedLineWidth   = 0.0f;
    218 
    219    // ES 3.1 (April 29, 2015) 20.40: implementation dependent values (cont.)
    220    GLint maxDrawBuffers         = 0;
    221    GLint maxFramebufferWidth    = 0;
    222    GLint maxFramebufferHeight   = 0;
    223    GLint maxFramebufferSamples  = 0;
    224    GLint maxColorAttachments    = 0;
    225    GLint maxViewportWidth       = 0;
    226    GLint maxViewportHeight      = 0;
    227    GLint maxSampleMaskWords     = 0;
    228    GLint maxColorTextureSamples = 0;
    229    GLint maxDepthTextureSamples = 0;
    230    GLint maxIntegerSamples      = 0;
    231    GLint64 maxServerWaitTimeout = 0;
    232 
    233    // ES 3.1 (April 29, 2015) Table 20.41: Implementation dependent values (cont.)
    234    GLint maxVertexAttribRelativeOffset = 0;
    235    GLint maxVertexAttribBindings       = 0;
    236    GLint maxVertexAttribStride         = 0;
    237    GLint maxElementsIndices            = 0;
    238    GLint maxElementsVertices           = 0;
    239    std::vector<GLenum> compressedTextureFormats;
    240    std::vector<GLenum> programBinaryFormats;
    241    std::vector<GLenum> shaderBinaryFormats;
    242    TypePrecision vertexHighpFloat;
    243    TypePrecision vertexMediumpFloat;
    244    TypePrecision vertexLowpFloat;
    245    TypePrecision vertexHighpInt;
    246    TypePrecision vertexMediumpInt;
    247    TypePrecision vertexLowpInt;
    248    TypePrecision fragmentHighpFloat;
    249    TypePrecision fragmentMediumpFloat;
    250    TypePrecision fragmentLowpFloat;
    251    TypePrecision fragmentHighpInt;
    252    TypePrecision fragmentMediumpInt;
    253    TypePrecision fragmentLowpInt;
    254 
    255    // Implementation dependent limits required on all shader types.
    256    // TODO(jiawei.shao@intel.com): organize all such limits into ShaderMap.
    257    // ES 3.1 (April 29, 2015) Table 20.43: Implementation dependent Vertex shader limits
    258    // ES 3.1 (April 29, 2015) Table 20.44: Implementation dependent Fragment shader limits
    259    // ES 3.1 (April 29, 2015) Table 20.45: implementation dependent compute shader limits
    260    // GL_EXT_geometry_shader (May 31, 2016) Table 20.43gs: Implementation dependent geometry shader
    261    // limits
    262    // GL_EXT_geometry_shader (May 31, 2016) Table 20.46: Implementation dependent aggregate shader
    263    // limits
    264    ShaderMap<GLint> maxShaderUniformBlocks        = {};
    265    ShaderMap<GLint> maxShaderTextureImageUnits    = {};
    266    ShaderMap<GLint> maxShaderStorageBlocks        = {};
    267    ShaderMap<GLint> maxShaderUniformComponents    = {};
    268    ShaderMap<GLint> maxShaderAtomicCounterBuffers = {};
    269    ShaderMap<GLint> maxShaderAtomicCounters       = {};
    270    ShaderMap<GLint> maxShaderImageUniforms        = {};
    271    // Note that we can query MAX_COMPUTE_UNIFORM_COMPONENTS and MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT
    272    // by GetIntegerv, but we can only use GetInteger64v on MAX_VERTEX_UNIFORM_COMPONENTS and
    273    // MAX_FRAGMENT_UNIFORM_COMPONENTS. Currently we use GLuint64 to store all these values so that
    274    // we can put them together into one ShaderMap.
    275    ShaderMap<GLint64> maxCombinedShaderUniformComponents = {};
    276 
    277    // ES 3.1 (April 29, 2015) Table 20.43: Implementation dependent Vertex shader limits
    278    GLint maxVertexAttributes       = 0;
    279    GLint maxVertexUniformVectors   = 0;
    280    GLint maxVertexOutputComponents = 0;
    281 
    282    // ES 3.1 (April 29, 2015) Table 20.44: Implementation dependent Fragment shader limits
    283    GLint maxFragmentUniformVectors     = 0;
    284    GLint maxFragmentInputComponents    = 0;
    285    GLint minProgramTextureGatherOffset = 0;
    286    GLint maxProgramTextureGatherOffset = 0;
    287    GLint minProgramTexelOffset         = 0;
    288    GLint maxProgramTexelOffset         = 0;
    289 
    290    // ES 3.1 (April 29, 2015) Table 20.45: implementation dependent compute shader limits
    291    std::array<GLint, 3> maxComputeWorkGroupCount = {0, 0, 0};
    292    std::array<GLint, 3> maxComputeWorkGroupSize  = {0, 0, 0};
    293    GLint maxComputeWorkGroupInvocations          = 0;
    294    GLint maxComputeSharedMemorySize              = 0;
    295 
    296    // ES 3.1 (April 29, 2015) Table 20.46: implementation dependent aggregate shader limits
    297    GLint maxUniformBufferBindings         = 0;
    298    GLint64 maxUniformBlockSize            = 0;
    299    GLint uniformBufferOffsetAlignment     = 0;
    300    GLint maxCombinedUniformBlocks         = 0;
    301    GLint maxVaryingComponents             = 0;
    302    GLint maxVaryingVectors                = 0;
    303    GLint maxCombinedTextureImageUnits     = 0;
    304    GLint maxCombinedShaderOutputResources = 0;
    305 
    306    // ES 3.1 (April 29, 2015) Table 20.47: implementation dependent aggregate shader limits (cont.)
    307    GLint maxUniformLocations                = 0;
    308    GLint maxAtomicCounterBufferBindings     = 0;
    309    GLint maxAtomicCounterBufferSize         = 0;
    310    GLint maxCombinedAtomicCounterBuffers    = 0;
    311    GLint maxCombinedAtomicCounters          = 0;
    312    GLint maxImageUnits                      = 0;
    313    GLint maxCombinedImageUniforms           = 0;
    314    GLint maxShaderStorageBufferBindings     = 0;
    315    GLint64 maxShaderStorageBlockSize        = 0;
    316    GLint maxCombinedShaderStorageBlocks     = 0;
    317    GLint shaderStorageBufferOffsetAlignment = 0;
    318 
    319    // ES 3.1 (April 29, 2015) Table 20.48: implementation dependent transform feedback limits
    320    GLint maxTransformFeedbackInterleavedComponents = 0;
    321    GLint maxTransformFeedbackSeparateAttributes    = 0;
    322    GLint maxTransformFeedbackSeparateComponents    = 0;
    323 
    324    // ES 3.1 (April 29, 2015) Table 20.49: Framebuffer Dependent Values
    325    GLint maxSamples = 0;
    326 
    327    // GL_EXT_geometry_shader (May 31, 2016) Table 20.40: Implementation-Dependent Values (cont.)
    328    GLint maxFramebufferLayers = 0;
    329    GLint layerProvokingVertex = 0;
    330 
    331    // GL_EXT_geometry_shader (May 31, 2016) Table 20.43gs: Implementation dependent geometry shader
    332    // limits
    333    GLint maxGeometryInputComponents       = 0;
    334    GLint maxGeometryOutputComponents      = 0;
    335    GLint maxGeometryOutputVertices        = 0;
    336    GLint maxGeometryTotalOutputComponents = 0;
    337    GLint maxGeometryShaderInvocations     = 0;
    338 
    339    // GL_EXT_tessellation_shader
    340    GLint maxTessControlInputComponents       = 0;
    341    GLint maxTessControlOutputComponents      = 0;
    342    GLint maxTessControlTotalOutputComponents = 0;
    343 
    344    GLint maxTessPatchComponents = 0;
    345    GLint maxPatchVertices       = 0;
    346    GLint maxTessGenLevel        = 0;
    347 
    348    GLint maxTessEvaluationInputComponents  = 0;
    349    GLint maxTessEvaluationOutputComponents = 0;
    350 
    351    GLuint subPixelBits = 4;
    352 
    353    // GL_EXT_blend_func_extended
    354    GLuint maxDualSourceDrawBuffers = 0;
    355 
    356    // GL_EXT_texture_filter_anisotropic
    357    GLfloat maxTextureAnisotropy = 0.0f;
    358 
    359    // GL_EXT_disjoint_timer_query
    360    GLuint queryCounterBitsTimeElapsed = 0;
    361    GLuint queryCounterBitsTimestamp   = 0;
    362 
    363    // OVR_multiview
    364    GLuint maxViews = 1;
    365 
    366    // GL_KHR_debug
    367    GLuint maxDebugMessageLength   = 0;
    368    GLuint maxDebugLoggedMessages  = 0;
    369    GLuint maxDebugGroupStackDepth = 0;
    370    GLuint maxLabelLength          = 0;
    371 
    372    // GL_APPLE_clip_distance/GL_EXT_clip_cull_distance
    373    GLuint maxClipDistances                = 0;
    374    GLuint maxCullDistances                = 0;
    375    GLuint maxCombinedClipAndCullDistances = 0;
    376 
    377    // GL_ANGLE_shader_pixel_local_storage
    378    GLuint maxPixelLocalStoragePlanes                       = 0;
    379    GLuint maxColorAttachmentsWithActivePixelLocalStorage   = 0;
    380    GLuint maxCombinedDrawBuffersAndPixelLocalStoragePlanes = 0;
    381 
    382    // GLES1 emulation: Caps for ES 1.1. Taken from Table 6.20 / 6.22 in the OpenGL ES 1.1 spec.
    383    GLuint maxMultitextureUnits                 = 0;
    384    GLuint maxClipPlanes                        = 0;
    385    GLuint maxLights                            = 0;
    386    static constexpr int GlobalMatrixStackDepth = 16;
    387    GLuint maxModelviewMatrixStackDepth         = 0;
    388    GLuint maxProjectionMatrixStackDepth        = 0;
    389    GLuint maxTextureMatrixStackDepth           = 0;
    390    GLfloat minSmoothPointSize                  = 0.0f;
    391    GLfloat maxSmoothPointSize                  = 0.0f;
    392    GLfloat minSmoothLineWidth                  = 0.0f;
    393    GLfloat maxSmoothLineWidth                  = 0.0f;
    394 
    395    // ES 3.2 Table 20.41: Implementation Dependent Values (cont.)
    396    GLint maxTextureBufferSize         = 0;
    397    GLint textureBufferOffsetAlignment = 0;
    398 };
    399 
    400 Caps GenerateMinimumCaps(const Version &clientVersion, const Extensions &extensions);
    401 }  // namespace gl
    402 
    403 namespace egl
    404 {
    405 
    406 struct Caps
    407 {
    408    Caps();
    409 
    410    // Support for NPOT surfaces
    411    bool textureNPOT;
    412 
    413    // Support for Stencil8 configs
    414    bool stencil8;
    415 };
    416 
    417 struct DisplayExtensions
    418 {
    419    DisplayExtensions();
    420 
    421    // Generate a vector of supported extension strings
    422    std::vector<std::string> getStrings() const;
    423 
    424    // EGL_EXT_create_context_robustness
    425    bool createContextRobustness = false;
    426 
    427    // EGL_ANGLE_d3d_share_handle_client_buffer
    428    bool d3dShareHandleClientBuffer = false;
    429 
    430    // EGL_ANGLE_d3d_texture_client_buffer
    431    bool d3dTextureClientBuffer = false;
    432 
    433    // EGL_ANGLE_surface_d3d_texture_2d_share_handle
    434    bool surfaceD3DTexture2DShareHandle = false;
    435 
    436    // EGL_ANGLE_query_surface_pointer
    437    bool querySurfacePointer = false;
    438 
    439    // EGL_ANGLE_window_fixed_size
    440    bool windowFixedSize = false;
    441 
    442    // EGL_ANGLE_keyed_mutex
    443    bool keyedMutex = false;
    444 
    445    // EGL_ANGLE_surface_orientation
    446    bool surfaceOrientation = false;
    447 
    448    // EGL_NV_post_sub_buffer
    449    bool postSubBuffer = false;
    450 
    451    // EGL_KHR_create_context
    452    bool createContext = false;
    453 
    454    // EGL_KHR_image
    455    bool image = false;
    456 
    457    // EGL_KHR_image_base
    458    bool imageBase = false;
    459 
    460    // EGL_KHR_image_pixmap
    461    bool imagePixmap = false;
    462 
    463    // EGL_KHR_gl_texture_2D_image
    464    bool glTexture2DImage = false;
    465 
    466    // EGL_KHR_gl_texture_cubemap_image
    467    bool glTextureCubemapImage = false;
    468 
    469    // EGL_KHR_gl_texture_3D_image
    470    bool glTexture3DImage = false;
    471 
    472    // EGL_KHR_gl_renderbuffer_image
    473    bool glRenderbufferImage = false;
    474 
    475    // EGL_KHR_get_all_proc_addresses
    476    bool getAllProcAddresses = false;
    477 
    478    // EGL_ANGLE_direct_composition
    479    bool directComposition = false;
    480 
    481    // EGL_ANGLE_windows_ui_composition
    482    bool windowsUIComposition = false;
    483 
    484    // KHR_create_context_no_error
    485    bool createContextNoError = false;
    486 
    487    // EGL_KHR_stream
    488    bool stream = false;
    489 
    490    // EGL_KHR_stream_consumer_gltexture
    491    bool streamConsumerGLTexture = false;
    492 
    493    // EGL_NV_stream_consumer_gltexture_yuv
    494    bool streamConsumerGLTextureYUV = false;
    495 
    496    // EGL_ANGLE_stream_producer_d3d_texture
    497    bool streamProducerD3DTexture = false;
    498 
    499    // EGL_KHR_fence_sync
    500    bool fenceSync = false;
    501 
    502    // EGL_KHR_wait_sync
    503    bool waitSync = false;
    504 
    505    // EGL_ANGLE_create_context_webgl_compatibility
    506    bool createContextWebGLCompatibility = false;
    507 
    508    // EGL_CHROMIUM_create_context_bind_generates_resource
    509    bool createContextBindGeneratesResource = false;
    510 
    511    // EGL_CHROMIUM_sync_control
    512    bool syncControlCHROMIUM = false;
    513 
    514    // EGL_ANGLE_sync_control_rate
    515    bool syncControlRateANGLE = false;
    516 
    517    // EGL_KHR_swap_buffers_with_damage
    518    bool swapBuffersWithDamage = false;
    519 
    520    // EGL_EXT_pixel_format_float
    521    bool pixelFormatFloat = false;
    522 
    523    // EGL_KHR_surfaceless_context
    524    bool surfacelessContext = false;
    525 
    526    // EGL_ANGLE_display_texture_share_group
    527    bool displayTextureShareGroup = false;
    528 
    529    // EGL_ANGLE_display_semaphore_share_group
    530    bool displaySemaphoreShareGroup = false;
    531 
    532    // EGL_ANGLE_create_context_client_arrays
    533    bool createContextClientArrays = false;
    534 
    535    // EGL_ANGLE_program_cache_control
    536    bool programCacheControlANGLE = false;
    537 
    538    // EGL_ANGLE_robust_resource_initialization
    539    bool robustResourceInitializationANGLE = false;
    540 
    541    // EGL_ANGLE_iosurface_client_buffer
    542    bool iosurfaceClientBuffer = false;
    543 
    544    // EGL_ANGLE_metal_texture_client_buffer
    545    bool mtlTextureClientBuffer = false;
    546 
    547    // EGL_ANGLE_create_context_extensions_enabled
    548    bool createContextExtensionsEnabled = false;
    549 
    550    // EGL_ANDROID_presentation_time
    551    bool presentationTime = false;
    552 
    553    // EGL_ANDROID_blob_cache
    554    bool blobCache = false;
    555 
    556    // EGL_ANDROID_image_native_buffer
    557    bool imageNativeBuffer = false;
    558 
    559    // EGL_ANDROID_get_frame_timestamps
    560    bool getFrameTimestamps = false;
    561 
    562    // EGL_ANGLE_timestamp_surface_attribute
    563    bool timestampSurfaceAttributeANGLE = false;
    564 
    565    // EGL_ANDROID_recordable
    566    bool recordable = false;
    567 
    568    // EGL_ANGLE_power_preference
    569    bool powerPreference = false;
    570 
    571    // EGL_ANGLE_image_d3d11_texture
    572    bool imageD3D11Texture = false;
    573 
    574    // EGL_ANDROID_get_native_client_buffer
    575    bool getNativeClientBufferANDROID = false;
    576 
    577    // EGL_ANDROID_create_native_client_buffer
    578    bool createNativeClientBufferANDROID = false;
    579 
    580    // EGL_ANDROID_native_fence_sync
    581    bool nativeFenceSyncANDROID = false;
    582 
    583    // EGL_ANGLE_create_context_backwards_compatible
    584    bool createContextBackwardsCompatible = false;
    585 
    586    // EGL_KHR_no_config_context
    587    bool noConfigContext = false;
    588 
    589    // EGL_IMG_context_priority
    590    bool contextPriority = false;
    591 
    592    // EGL_ANGLE_ggp_stream_descriptor
    593    bool ggpStreamDescriptor = false;
    594 
    595    // EGL_ANGLE_swap_with_frame_token
    596    bool swapWithFrameToken = false;
    597 
    598    // EGL_KHR_gl_colorspace
    599    bool glColorspace = false;
    600 
    601    // EGL_EXT_gl_colorspace_display_p3_linear
    602    bool glColorspaceDisplayP3Linear = false;
    603 
    604    // EGL_EXT_gl_colorspace_display_p3
    605    bool glColorspaceDisplayP3 = false;
    606 
    607    // EGL_EXT_gl_colorspace_scrgb
    608    bool glColorspaceScrgb = false;
    609 
    610    // EGL_EXT_gl_colorspace_scrgb_linear
    611    bool glColorspaceScrgbLinear = false;
    612 
    613    // EGL_EXT_gl_colorspace_display_p3_passthrough
    614    bool glColorspaceDisplayP3Passthrough = false;
    615 
    616    // EGL_ANGLE_colorspace_attribute_passthrough
    617    bool eglColorspaceAttributePassthroughANGLE = false;
    618 
    619    // EGL_ANDROID_framebuffer_target
    620    bool framebufferTargetANDROID = false;
    621 
    622    // EGL_EXT_image_gl_colorspace
    623    bool imageGlColorspace = false;
    624 
    625    // EGL_EXT_image_dma_buf_import
    626    bool imageDmaBufImportEXT = false;
    627 
    628    // EGL_EXT_image_dma_buf_import_modifiers
    629    bool imageDmaBufImportModifiersEXT = false;
    630 
    631    // EGL_NOK_texture_from_pixmap
    632    bool textureFromPixmapNOK = false;
    633 
    634    // EGL_NV_robustness_video_memory_purge
    635    bool robustnessVideoMemoryPurgeNV = false;
    636 
    637    // EGL_KHR_reusable_sync
    638    bool reusableSyncKHR = false;
    639 
    640    // EGL_ANGLE_external_context_and_surface
    641    bool externalContextAndSurface = false;
    642 
    643    // EGL_EXT_buffer_age
    644    bool bufferAgeEXT = false;
    645 
    646    // EGL_KHR_mutable_render_buffer
    647    bool mutableRenderBufferKHR = false;
    648 
    649    // EGL_EXT_protected_content
    650    bool protectedContentEXT = false;
    651 
    652    // EGL_ANGLE_create_surface_swap_interval
    653    bool createSurfaceSwapIntervalANGLE = false;
    654 
    655    // EGL_ANGLE_context_virtualization
    656    bool contextVirtualizationANGLE = false;
    657 
    658    // EGL_KHR_lock_surface3
    659    bool lockSurface3KHR = false;
    660 
    661    // EGL_ANGLE_vulkan_image
    662    bool vulkanImageANGLE = false;
    663 
    664    // EGL_ANGLE_metal_create_context_ownership_identity
    665    bool metalCreateContextOwnershipIdentityANGLE = false;
    666 
    667    // EGL_KHR_partial_update
    668    bool partialUpdateKHR = false;
    669 
    670    // EGL_ANGLE_sync_mtl_shared_event
    671    bool mtlSyncSharedEventANGLE = false;
    672 };
    673 
    674 struct DeviceExtensions
    675 {
    676    DeviceExtensions();
    677 
    678    // Generate a vector of supported extension strings
    679    std::vector<std::string> getStrings() const;
    680 
    681    // EGL_ANGLE_device_d3d
    682    bool deviceD3D = false;
    683 
    684    // EGL_ANGLE_device_cgl
    685    bool deviceCGL = false;
    686 
    687    // EGL_ANGLE_device_eagl
    688    bool deviceEAGL = false;
    689 
    690    // EGL_ANGLE_device_metal
    691    bool deviceMetal = false;
    692 
    693    // EGL_ANGLE_device_vulkan
    694    bool deviceVulkan = false;
    695 };
    696 
    697 struct ClientExtensions
    698 {
    699    ClientExtensions();
    700    ClientExtensions(const ClientExtensions &other);
    701 
    702    // Generate a vector of supported extension strings
    703    std::vector<std::string> getStrings() const;
    704 
    705    // EGL_EXT_client_extensions
    706    bool clientExtensions = false;
    707 
    708    // EGL_EXT_platform_base
    709    bool platformBase = false;
    710 
    711    // EGL_EXT_platform_device
    712    bool platformDevice = false;
    713 
    714    // EGL_KHR_platform_gbm
    715    bool platformGbmKHR = false;
    716 
    717    // EGL_EXT_platform_wayland
    718    bool platformWaylandEXT = false;
    719 
    720    // EGL_ANGLE_platform_angle
    721    bool platformANGLE = false;
    722 
    723    // EGL_ANGLE_platform_angle_d3d
    724    bool platformANGLED3D = false;
    725 
    726    // EGL_ANGLE_platform_angle_d3d11on12
    727    bool platformANGLED3D11ON12 = false;
    728 
    729    // EGL_ANGLE_platform_angle_opengl
    730    bool platformANGLEOpenGL = false;
    731 
    732    // EGL_ANGLE_platform_angle_null
    733    bool platformANGLENULL = false;
    734 
    735    // EGL_ANGLE_platform_angle_vulkan
    736    bool platformANGLEVulkan = false;
    737 
    738    // EGL_ANGLE_platform_angle_metal
    739    bool platformANGLEMetal = false;
    740 
    741    // EGL_ANGLE_platform_angle_device_context_volatile_eagl
    742    bool platformANGLEDeviceContextVolatileEagl = false;
    743 
    744    // EGL_ANGLE_platform_angle_device_context_volatile_cgl
    745    bool platformANGLEDeviceContextVolatileCgl = false;
    746 
    747    // EGL_ANGLE_platform_angle_device_id
    748    bool platformANGLEDeviceId = false;
    749 
    750    // EGL_ANGLE_device_creation
    751    bool deviceCreation = false;
    752 
    753    // EGL_ANGLE_device_creation_d3d11
    754    bool deviceCreationD3D11 = false;
    755 
    756    // EGL_ANGLE_x11_visual
    757    bool x11Visual = false;
    758 
    759    // EGL_ANGLE_experimental_present_path
    760    bool experimentalPresentPath = false;
    761 
    762    // EGL_KHR_client_get_all_proc_addresses
    763    bool clientGetAllProcAddresses = false;
    764 
    765    // EGL_KHR_debug
    766    bool debug = false;
    767 
    768    // EGL_ANGLE_feature_control
    769    bool featureControlANGLE = false;
    770 
    771    // EGL_ANGLE_platform_angle_device_type_swiftshader
    772    bool platformANGLEDeviceTypeSwiftShader = false;
    773 
    774    // EGL_ANGLE_platform_angle_device_type_egl_angle
    775    bool platformANGLEDeviceTypeEGLANGLE = false;
    776 
    777    // EGL_EXT_device_query
    778    bool deviceQueryEXT = false;
    779 
    780    // EGL_ANGLE_display_power_preference
    781    bool displayPowerPreferenceANGLE = false;
    782 };
    783 
    784 }  // namespace egl
    785 
    786 #endif  // LIBANGLE_CAPS_H_