• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA
130     // and GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR blend functions.
131     bool noSimultaneousConstantColorAndAlphaBlendFunc = false;
132 
133     // Renderer always clamps constant blend color.
134     bool noUnclampedBlendColor = false;
135 
136     // D3D9 does not support flexible varying register packing.
137     bool noFlexibleVaryingPacking = false;
138 
139     // D3D does not support having multiple transform feedback outputs go to the same buffer.
140     bool noDoubleBoundTransformFeedbackBuffers = false;
141 
142     // D3D does not support vertex attribute aliasing
143     bool noVertexAttributeAliasing = false;
144 
145     // Renderer doesn't support GL_TEXTURE_COMPARE_MODE=GL_NONE on a shadow sampler.
146     // TODO(http://anglebug.com/5231): add validation code to front-end.
147     bool noShadowSamplerCompareModeNone = false;
148 
149     // PVRTC1 textures must be squares.
150     bool squarePvrtc1 = false;
151 
152     // ETC1 texture support is emulated.
153     bool emulatedEtc1 = false;
154 
155     // ASTC texture support is emulated.
156     bool emulatedAstc = false;
157 
158     // No compressed TEXTURE_3D support.
159     bool noCompressedTexture3D = false;
160 
161     // D3D does not support compressed textures where the base mip level is not a multiple of 4
162     bool compressedBaseMipLevelMultipleOfFour = false;
163 
164     // An extra limit for WebGL texture size. Ignored if 0.
165     GLint webGLTextureSizeLimit = 0;
166 };
167 
168 struct TypePrecision
169 {
170     TypePrecision();
171     TypePrecision(const TypePrecision &other);
172 
173     TypePrecision &operator=(const TypePrecision &other);
174 
175     void setIEEEFloat();
176     void setIEEEHalfFloat();
177     void setTwosComplementInt(unsigned int bits);
178     void setSimulatedFloat(unsigned int range, unsigned int precision);
179     void setSimulatedInt(unsigned int range);
180 
181     void get(GLint *returnRange, GLint *returnPrecision) const;
182 
183     std::array<GLint, 2> range = {0, 0};
184     GLint precision            = 0;
185 };
186 
187 struct Caps
188 {
189     Caps();
190     Caps(const Caps &other);
191     Caps &operator=(const Caps &other);
192 
193     ~Caps();
194 
195     // If the values could be got by using GetIntegeri_v, they should
196     // be GLint instead of GLuint and call LimitToInt() to ensure
197     // they will not overflow.
198 
199     GLfloat minInterpolationOffset        = 0;
200     GLfloat maxInterpolationOffset        = 0;
201     GLint subPixelInterpolationOffsetBits = 0;
202 
203     // ES 3.1 (April 29, 2015) 20.39: implementation dependent values
204     GLint64 maxElementIndex       = 0;
205     GLint max3DTextureSize        = 0;
206     GLint max2DTextureSize        = 0;
207     GLint maxRectangleTextureSize = 0;
208     GLint maxArrayTextureLayers   = 0;
209     GLfloat maxLODBias            = 0.0f;
210     GLint maxCubeMapTextureSize   = 0;
211     GLint maxRenderbufferSize     = 0;
212     GLfloat minAliasedPointSize   = 1.0f;
213     GLfloat maxAliasedPointSize   = 1.0f;
214     GLfloat minAliasedLineWidth   = 0.0f;
215     GLfloat maxAliasedLineWidth   = 0.0f;
216 
217     // ES 3.1 (April 29, 2015) 20.40: implementation dependent values (cont.)
218     GLint maxDrawBuffers         = 0;
219     GLint maxFramebufferWidth    = 0;
220     GLint maxFramebufferHeight   = 0;
221     GLint maxFramebufferSamples  = 0;
222     GLint maxColorAttachments    = 0;
223     GLint maxViewportWidth       = 0;
224     GLint maxViewportHeight      = 0;
225     GLint maxSampleMaskWords     = 0;
226     GLint maxColorTextureSamples = 0;
227     GLint maxDepthTextureSamples = 0;
228     GLint maxIntegerSamples      = 0;
229     GLint64 maxServerWaitTimeout = 0;
230 
231     // ES 3.1 (April 29, 2015) Table 20.41: Implementation dependent values (cont.)
232     GLint maxVertexAttribRelativeOffset = 0;
233     GLint maxVertexAttribBindings       = 0;
234     GLint maxVertexAttribStride         = 0;
235     GLint maxElementsIndices            = 0;
236     GLint maxElementsVertices           = 0;
237     std::vector<GLenum> compressedTextureFormats;
238     std::vector<GLenum> programBinaryFormats;
239     std::vector<GLenum> shaderBinaryFormats;
240     TypePrecision vertexHighpFloat;
241     TypePrecision vertexMediumpFloat;
242     TypePrecision vertexLowpFloat;
243     TypePrecision vertexHighpInt;
244     TypePrecision vertexMediumpInt;
245     TypePrecision vertexLowpInt;
246     TypePrecision fragmentHighpFloat;
247     TypePrecision fragmentMediumpFloat;
248     TypePrecision fragmentLowpFloat;
249     TypePrecision fragmentHighpInt;
250     TypePrecision fragmentMediumpInt;
251     TypePrecision fragmentLowpInt;
252 
253     // Implementation dependent limits required on all shader types.
254     // TODO(jiawei.shao@intel.com): organize all such limits into ShaderMap.
255     // ES 3.1 (April 29, 2015) Table 20.43: Implementation dependent Vertex shader limits
256     // ES 3.1 (April 29, 2015) Table 20.44: Implementation dependent Fragment shader limits
257     // ES 3.1 (April 29, 2015) Table 20.45: implementation dependent compute shader limits
258     // GL_EXT_geometry_shader (May 31, 2016) Table 20.43gs: Implementation dependent geometry shader
259     // limits
260     // GL_EXT_geometry_shader (May 31, 2016) Table 20.46: Implementation dependent aggregate shader
261     // limits
262     ShaderMap<GLint> maxShaderUniformBlocks        = {};
263     ShaderMap<GLint> maxShaderTextureImageUnits    = {};
264     ShaderMap<GLint> maxShaderStorageBlocks        = {};
265     ShaderMap<GLint> maxShaderUniformComponents    = {};
266     ShaderMap<GLint> maxShaderAtomicCounterBuffers = {};
267     ShaderMap<GLint> maxShaderAtomicCounters       = {};
268     ShaderMap<GLint> maxShaderImageUniforms        = {};
269     // Note that we can query MAX_COMPUTE_UNIFORM_COMPONENTS and MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT
270     // by GetIntegerv, but we can only use GetInteger64v on MAX_VERTEX_UNIFORM_COMPONENTS and
271     // MAX_FRAGMENT_UNIFORM_COMPONENTS. Currently we use GLuint64 to store all these values so that
272     // we can put them together into one ShaderMap.
273     ShaderMap<GLint64> maxCombinedShaderUniformComponents = {};
274 
275     // ES 3.1 (April 29, 2015) Table 20.43: Implementation dependent Vertex shader limits
276     GLint maxVertexAttributes       = 0;
277     GLint maxVertexUniformVectors   = 0;
278     GLint maxVertexOutputComponents = 0;
279 
280     // ES 3.1 (April 29, 2015) Table 20.44: Implementation dependent Fragment shader limits
281     GLint maxFragmentUniformVectors     = 0;
282     GLint maxFragmentInputComponents    = 0;
283     GLint minProgramTextureGatherOffset = 0;
284     GLint maxProgramTextureGatherOffset = 0;
285     GLint minProgramTexelOffset         = 0;
286     GLint maxProgramTexelOffset         = 0;
287 
288     // ES 3.1 (April 29, 2015) Table 20.45: implementation dependent compute shader limits
289     std::array<GLint, 3> maxComputeWorkGroupCount = {0, 0, 0};
290     std::array<GLint, 3> maxComputeWorkGroupSize  = {0, 0, 0};
291     GLint maxComputeWorkGroupInvocations          = 0;
292     GLint maxComputeSharedMemorySize              = 0;
293 
294     // ES 3.1 (April 29, 2015) Table 20.46: implementation dependent aggregate shader limits
295     GLint maxUniformBufferBindings         = 0;
296     GLint64 maxUniformBlockSize            = 0;
297     GLint uniformBufferOffsetAlignment     = 0;
298     GLint maxCombinedUniformBlocks         = 0;
299     GLint maxVaryingComponents             = 0;
300     GLint maxVaryingVectors                = 0;
301     GLint maxCombinedTextureImageUnits     = 0;
302     GLint maxCombinedShaderOutputResources = 0;
303 
304     // ES 3.1 (April 29, 2015) Table 20.47: implementation dependent aggregate shader limits (cont.)
305     GLint maxUniformLocations                = 0;
306     GLint maxAtomicCounterBufferBindings     = 0;
307     GLint maxAtomicCounterBufferSize         = 0;
308     GLint maxCombinedAtomicCounterBuffers    = 0;
309     GLint maxCombinedAtomicCounters          = 0;
310     GLint maxImageUnits                      = 0;
311     GLint maxCombinedImageUniforms           = 0;
312     GLint maxShaderStorageBufferBindings     = 0;
313     GLint64 maxShaderStorageBlockSize        = 0;
314     GLint maxCombinedShaderStorageBlocks     = 0;
315     GLint shaderStorageBufferOffsetAlignment = 0;
316 
317     // ES 3.1 (April 29, 2015) Table 20.48: implementation dependent transform feedback limits
318     GLint maxTransformFeedbackInterleavedComponents = 0;
319     GLint maxTransformFeedbackSeparateAttributes    = 0;
320     GLint maxTransformFeedbackSeparateComponents    = 0;
321 
322     // ES 3.1 (April 29, 2015) Table 20.49: Framebuffer Dependent Values
323     GLint maxSamples = 0;
324 
325     // GL_EXT_geometry_shader (May 31, 2016) Table 20.40: Implementation-Dependent Values (cont.)
326     GLint maxFramebufferLayers = 0;
327     GLint layerProvokingVertex = 0;
328 
329     // GL_EXT_geometry_shader (May 31, 2016) Table 20.43gs: Implementation dependent geometry shader
330     // limits
331     GLint maxGeometryInputComponents       = 0;
332     GLint maxGeometryOutputComponents      = 0;
333     GLint maxGeometryOutputVertices        = 0;
334     GLint maxGeometryTotalOutputComponents = 0;
335     GLint maxGeometryShaderInvocations     = 0;
336 
337     // GL_EXT_tessellation_shader
338     GLint maxTessControlInputComponents       = 0;
339     GLint maxTessControlOutputComponents      = 0;
340     GLint maxTessControlTotalOutputComponents = 0;
341 
342     GLint maxTessPatchComponents = 0;
343     GLint maxPatchVertices       = 0;
344     GLint maxTessGenLevel        = 0;
345 
346     GLint maxTessEvaluationInputComponents  = 0;
347     GLint maxTessEvaluationOutputComponents = 0;
348 
349     GLuint subPixelBits = 4;
350 
351     // GL_EXT_blend_func_extended
352     GLuint maxDualSourceDrawBuffers = 0;
353 
354     // GL_EXT_texture_filter_anisotropic
355     GLfloat maxTextureAnisotropy = 0.0f;
356 
357     // GL_EXT_disjoint_timer_query
358     GLuint queryCounterBitsTimeElapsed = 0;
359     GLuint queryCounterBitsTimestamp   = 0;
360 
361     // OVR_multiview
362     GLuint maxViews = 1;
363 
364     // GL_KHR_debug
365     GLuint maxDebugMessageLength   = 0;
366     GLuint maxDebugLoggedMessages  = 0;
367     GLuint maxDebugGroupStackDepth = 0;
368     GLuint maxLabelLength          = 0;
369 
370     // GL_APPLE_clip_distance / GL_EXT_clip_cull_distance / GL_ANGLE_clip_cull_distance
371     GLuint maxClipDistances                = 0;
372     GLuint maxCullDistances                = 0;
373     GLuint maxCombinedClipAndCullDistances = 0;
374 
375     // GL_ANGLE_shader_pixel_local_storage
376     GLuint maxPixelLocalStoragePlanes                       = 0;
377     GLuint maxColorAttachmentsWithActivePixelLocalStorage   = 0;
378     GLuint maxCombinedDrawBuffersAndPixelLocalStoragePlanes = 0;
379 
380     // GL_EXT_shader_pixel_local_storage.
381     GLuint maxShaderPixelLocalStorageFastSizeEXT = 0;
382 
383     // GLES1 emulation: Caps for ES 1.1. Taken from Table 6.20 / 6.22 in the OpenGL ES 1.1 spec.
384     GLuint maxMultitextureUnits                 = 0;
385     GLuint maxClipPlanes                        = 0;
386     GLuint maxLights                            = 0;
387     static constexpr int GlobalMatrixStackDepth = 16;
388     GLuint maxModelviewMatrixStackDepth         = 0;
389     GLuint maxProjectionMatrixStackDepth        = 0;
390     GLuint maxTextureMatrixStackDepth           = 0;
391     GLfloat minSmoothPointSize                  = 0.0f;
392     GLfloat maxSmoothPointSize                  = 0.0f;
393     GLfloat minSmoothLineWidth                  = 0.0f;
394     GLfloat maxSmoothLineWidth                  = 0.0f;
395 
396     // ES 3.2 Table 21.40: Implementation Dependent Values
397     GLfloat lineWidthGranularity    = 0.0f;
398     GLfloat minMultisampleLineWidth = 0.0f;
399     GLfloat maxMultisampleLineWidth = 0.0f;
400 
401     // ES 3.2 Table 21.42: Implementation Dependent Values (cont.)
402     GLint maxTextureBufferSize         = 0;
403     GLint textureBufferOffsetAlignment = 0;
404 
405     // GL_ARM_shader_framebuffer_fetch
406     bool fragmentShaderFramebufferFetchMRT = false;
407 };
408 
409 Caps GenerateMinimumCaps(const Version &clientVersion, const Extensions &extensions);
410 }  // namespace gl
411 
412 namespace egl
413 {
414 
415 struct Caps
416 {
417     Caps();
418 
419     // Support for NPOT surfaces
420     bool textureNPOT = false;
421 
422     // Support for Stencil8 configs
423     bool stencil8 = false;
424 };
425 
426 struct DisplayExtensions
427 {
428     DisplayExtensions();
429 
430     // Generate a vector of supported extension strings
431     std::vector<std::string> getStrings() const;
432 
433     // EGL_EXT_create_context_robustness
434     bool createContextRobustness = false;
435 
436     // EGL_ANGLE_d3d_share_handle_client_buffer
437     bool d3dShareHandleClientBuffer = false;
438 
439     // EGL_ANGLE_d3d_texture_client_buffer
440     bool d3dTextureClientBuffer = false;
441 
442     // EGL_ANGLE_surface_d3d_texture_2d_share_handle
443     bool surfaceD3DTexture2DShareHandle = false;
444 
445     // EGL_ANGLE_query_surface_pointer
446     bool querySurfacePointer = false;
447 
448     // EGL_ANGLE_window_fixed_size
449     bool windowFixedSize = false;
450 
451     // EGL_ANGLE_keyed_mutex
452     bool keyedMutex = false;
453 
454     // EGL_ANGLE_surface_orientation
455     bool surfaceOrientation = false;
456 
457     // EGL_NV_post_sub_buffer
458     bool postSubBuffer = false;
459 
460     // EGL_KHR_create_context
461     bool createContext = false;
462 
463     // EGL_KHR_image
464     bool image = false;
465 
466     // EGL_KHR_image_base
467     bool imageBase = false;
468 
469     // EGL_KHR_image_pixmap
470     bool imagePixmap = false;
471 
472     // EGL_KHR_gl_texture_2D_image
473     bool glTexture2DImage = false;
474 
475     // EGL_KHR_gl_texture_cubemap_image
476     bool glTextureCubemapImage = false;
477 
478     // EGL_KHR_gl_texture_3D_image
479     bool glTexture3DImage = false;
480 
481     // EGL_KHR_gl_renderbuffer_image
482     bool glRenderbufferImage = false;
483 
484     // EGL_KHR_get_all_proc_addresses
485     bool getAllProcAddresses = false;
486 
487     // EGL_ANGLE_direct_composition
488     bool directComposition = false;
489 
490     // EGL_ANGLE_windows_ui_composition
491     bool windowsUIComposition = false;
492 
493     // KHR_create_context_no_error
494     bool createContextNoError = false;
495 
496     // EGL_KHR_stream
497     bool stream = false;
498 
499     // EGL_KHR_stream_consumer_gltexture
500     bool streamConsumerGLTexture = false;
501 
502     // EGL_NV_stream_consumer_gltexture_yuv
503     bool streamConsumerGLTextureYUV = false;
504 
505     // EGL_ANGLE_stream_producer_d3d_texture
506     bool streamProducerD3DTexture = false;
507 
508     // EGL_KHR_fence_sync
509     bool fenceSync = false;
510 
511     // EGL_KHR_wait_sync
512     bool waitSync = false;
513 
514     // EGL_ANGLE_create_context_webgl_compatibility
515     bool createContextWebGLCompatibility = false;
516 
517     // EGL_CHROMIUM_create_context_bind_generates_resource
518     bool createContextBindGeneratesResource = false;
519 
520     // EGL_CHROMIUM_sync_control
521     bool syncControlCHROMIUM = false;
522 
523     // EGL_ANGLE_sync_control_rate
524     bool syncControlRateANGLE = false;
525 
526     // EGL_KHR_swap_buffers_with_damage
527     bool swapBuffersWithDamage = false;
528 
529     // EGL_EXT_pixel_format_float
530     bool pixelFormatFloat = false;
531 
532     // EGL_KHR_surfaceless_context
533     bool surfacelessContext = false;
534 
535     // EGL_ANGLE_display_texture_share_group
536     bool displayTextureShareGroup = false;
537 
538     // EGL_ANGLE_display_semaphore_share_group
539     bool displaySemaphoreShareGroup = false;
540 
541     // EGL_ANGLE_create_context_client_arrays
542     bool createContextClientArrays = false;
543 
544     // EGL_ANGLE_program_cache_control
545     bool programCacheControlANGLE = false;
546 
547     // EGL_ANGLE_robust_resource_initialization
548     bool robustResourceInitializationANGLE = false;
549 
550     // EGL_ANGLE_iosurface_client_buffer
551     bool iosurfaceClientBuffer = false;
552 
553     // EGL_ANGLE_metal_texture_client_buffer
554     bool mtlTextureClientBuffer = false;
555 
556     // EGL_ANGLE_create_context_extensions_enabled
557     bool createContextExtensionsEnabled = false;
558 
559     // EGL_ANDROID_presentation_time
560     bool presentationTime = false;
561 
562     // EGL_ANDROID_blob_cache
563     bool blobCache = false;
564 
565     // EGL_ANDROID_image_native_buffer
566     bool imageNativeBuffer = false;
567 
568     // EGL_ANDROID_get_frame_timestamps
569     bool getFrameTimestamps = false;
570 
571     // EGL_ANGLE_timestamp_surface_attribute
572     bool timestampSurfaceAttributeANGLE = false;
573 
574     // EGL_ANDROID_recordable
575     bool recordable = false;
576 
577     // EGL_ANGLE_power_preference
578     bool powerPreference = false;
579 
580     // EGL_ANGLE_wait_until_work_scheduled
581     bool waitUntilWorkScheduled = false;
582 
583     // EGL_ANGLE_image_d3d11_texture
584     bool imageD3D11Texture = false;
585 
586     // EGL_ANDROID_get_native_client_buffer
587     bool getNativeClientBufferANDROID = false;
588 
589     // EGL_ANDROID_create_native_client_buffer
590     bool createNativeClientBufferANDROID = false;
591 
592     // EGL_ANDROID_native_fence_sync
593     bool nativeFenceSyncANDROID = false;
594 
595     // EGL_ANGLE_create_context_backwards_compatible
596     bool createContextBackwardsCompatible = false;
597 
598     // EGL_KHR_no_config_context
599     bool noConfigContext = false;
600 
601     // EGL_IMG_context_priority
602     bool contextPriority = false;
603 
604     // EGL_ANGLE_ggp_stream_descriptor
605     bool ggpStreamDescriptor = false;
606 
607     // EGL_ANGLE_swap_with_frame_token
608     bool swapWithFrameToken = false;
609 
610     // EGL_KHR_gl_colorspace
611     bool glColorspace = false;
612 
613     // EGL_EXT_gl_colorspace_display_p3_linear
614     bool glColorspaceDisplayP3Linear = false;
615 
616     // EGL_EXT_gl_colorspace_display_p3
617     bool glColorspaceDisplayP3 = false;
618 
619     // EGL_EXT_gl_colorspace_scrgb
620     bool glColorspaceScrgb = false;
621 
622     // EGL_EXT_gl_colorspace_scrgb_linear
623     bool glColorspaceScrgbLinear = false;
624 
625     // EGL_EXT_gl_colorspace_display_p3_passthrough
626     bool glColorspaceDisplayP3Passthrough = false;
627 
628     // EGL_ANGLE_colorspace_attribute_passthrough
629     bool eglColorspaceAttributePassthroughANGLE = false;
630 
631     // EGL_EXT_gl_colorspace_bt2020_linear
632     bool glColorspaceBt2020Linear = false;
633 
634     // EGL_EXT_gl_colorspace_bt2020_pq
635     bool glColorspaceBt2020Pq = false;
636 
637     // EGL_EXT_gl_colorspace_bt2020_hlg
638     bool glColorspaceBt2020Hlg = false;
639 
640     // EGL_ANDROID_framebuffer_target
641     bool framebufferTargetANDROID = false;
642 
643     // EGL_EXT_image_gl_colorspace
644     bool imageGlColorspace = false;
645 
646     // EGL_EXT_image_dma_buf_import
647     bool imageDmaBufImportEXT = false;
648 
649     // EGL_EXT_image_dma_buf_import_modifiers
650     bool imageDmaBufImportModifiersEXT = false;
651 
652     // EGL_NOK_texture_from_pixmap
653     bool textureFromPixmapNOK = false;
654 
655     // EGL_NV_robustness_video_memory_purge
656     bool robustnessVideoMemoryPurgeNV = false;
657 
658     // EGL_KHR_reusable_sync
659     bool reusableSyncKHR = false;
660 
661     // EGL_ANGLE_external_context_and_surface
662     bool externalContextAndSurface = false;
663 
664     // EGL_EXT_buffer_age
665     bool bufferAgeEXT = false;
666 
667     // EGL_KHR_mutable_render_buffer
668     bool mutableRenderBufferKHR = false;
669 
670     // EGL_EXT_protected_content
671     bool protectedContentEXT = false;
672 
673     // EGL_ANGLE_create_surface_swap_interval
674     bool createSurfaceSwapIntervalANGLE = false;
675 
676     // EGL_ANGLE_context_virtualization
677     bool contextVirtualizationANGLE = false;
678 
679     // EGL_KHR_lock_surface3
680     bool lockSurface3KHR = false;
681 
682     // EGL_ANGLE_vulkan_image
683     bool vulkanImageANGLE = false;
684 
685     // EGL_ANGLE_metal_create_context_ownership_identity
686     bool metalCreateContextOwnershipIdentityANGLE = false;
687 
688     // EGL_KHR_partial_update
689     bool partialUpdateKHR = false;
690 
691     // EGL_ANGLE_metal_shared_event_sync
692     bool mtlSyncSharedEventANGLE = false;
693 
694     // EGL_ANGLE_global_fence_sync
695     bool globalFenceSyncANGLE = false;
696 };
697 
698 struct DeviceExtensions
699 {
700     DeviceExtensions();
701 
702     // Generate a vector of supported extension strings
703     std::vector<std::string> getStrings() const;
704 
705     // EGL_ANGLE_device_d3d
706     bool deviceD3D = false;
707 
708     // EGL_ANGLE_device_d3d9
709     bool deviceD3D9 = false;
710 
711     // EGL_ANGLE_device_d3d11
712     bool deviceD3D11 = false;
713 
714     // EGL_ANGLE_device_cgl
715     bool deviceCGL = false;
716 
717     // EGL_ANGLE_device_eagl
718     bool deviceEAGL = false;
719 
720     // EGL_ANGLE_device_metal
721     bool deviceMetal = false;
722 
723     // EGL_ANGLE_device_vulkan
724     bool deviceVulkan = false;
725 
726     // EGL_EXT_device_drm
727     bool deviceDrmEXT = false;
728 
729     // EGL_EXT_device_drm_render_node
730     bool deviceDrmRenderNodeEXT = false;
731 };
732 
733 struct ClientExtensions
734 {
735     ClientExtensions();
736     ClientExtensions(const ClientExtensions &other);
737 
738     // Generate a vector of supported extension strings
739     std::vector<std::string> getStrings() const;
740 
741     // EGL_EXT_client_extensions
742     bool clientExtensions = false;
743 
744     // EGL_EXT_platform_base
745     bool platformBase = false;
746 
747     // EGL_EXT_platform_device
748     bool platformDevice = false;
749 
750     // EGL_KHR_platform_gbm
751     bool platformGbmKHR = false;
752 
753     // EGL_EXT_platform_wayland
754     bool platformWaylandEXT = false;
755 
756     // EGL_MESA_platform_surfaceless
757     bool platformSurfacelessMESA = false;
758 
759     // EGL_ANGLE_platform_angle
760     bool platformANGLE = false;
761 
762     // EGL_ANGLE_platform_angle_d3d
763     bool platformANGLED3D = false;
764 
765     // EGL_ANGLE_platform_angle_d3d11on12
766     bool platformANGLED3D11ON12 = false;
767 
768     // EGL_ANGLE_platform_angle_opengl
769     bool platformANGLEOpenGL = false;
770 
771     // EGL_ANGLE_platform_angle_null
772     bool platformANGLENULL = false;
773 
774     // EGL_ANGLE_platform_angle_webgpu
775     bool platformANGLEWebgpu = false;
776 
777     // EGL_ANGLE_platform_angle_vulkan
778     bool platformANGLEVulkan = false;
779 
780     // EGL_ANGLE_platform_angle_metal
781     bool platformANGLEMetal = false;
782 
783     // EGL_ANGLE_platform_angle_device_context_volatile_eagl
784     bool platformANGLEDeviceContextVolatileEagl = false;
785 
786     // EGL_ANGLE_platform_angle_device_context_volatile_cgl
787     bool platformANGLEDeviceContextVolatileCgl = false;
788 
789     // EGL_ANGLE_platform_angle_device_id
790     bool platformANGLEDeviceId = false;
791 
792     // EGL_ANGLE_device_creation
793     bool deviceCreation = false;
794 
795     // EGL_ANGLE_device_creation_d3d11
796     bool deviceCreationD3D11 = false;
797 
798     // EGL_ANGLE_x11_visual
799     bool x11Visual = false;
800 
801     // EGL_ANGLE_experimental_present_path
802     bool experimentalPresentPath = false;
803 
804     // EGL_KHR_client_get_all_proc_addresses
805     bool clientGetAllProcAddresses = false;
806 
807     // EGL_KHR_debug
808     bool debug = false;
809 
810     // EGL_ANGLE_feature_control
811     bool featureControlANGLE = false;
812 
813     // EGL_ANGLE_platform_angle_device_type_swiftshader
814     bool platformANGLEDeviceTypeSwiftShader = false;
815 
816     // EGL_ANGLE_platform_angle_device_type_egl_angle
817     bool platformANGLEDeviceTypeEGLANGLE = false;
818 
819     // EGL_EXT_device_query
820     bool deviceQueryEXT = false;
821 
822     // EGL_ANGLE_display_power_preference
823     bool displayPowerPreferenceANGLE = false;
824 
825     // EGL_ANGLE_no_error
826     bool noErrorANGLE = false;
827 };
828 
829 }  // namespace egl
830 
831 #endif  // LIBANGLE_CAPS_H_
832