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