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