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