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