Hash :
6a03109f
Author :
Date :
2025-07-09T18:24:31
Refine getCompressionRate As Vulkan spec states, vkGetImageSubresourceLayout should not be called for the android swapchainimage when the image is not bound to memory. Refine the path of getCompressionRate to make sure at least swapchainimage[0] has been initialized when it is been called. Bug: angleproject:433057375 Change-Id: I80b68874686940c0ef77df97b928b0e153c5bbf8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6774721 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
//
// Copyright 2023 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// egl_context_lock_autogen.h:
// Context Lock functions for the EGL entry points.
#ifndef LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_
#define LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_
#include "libGLESv2/egl_context_lock_autogen.h"
namespace egl
{
namespace priv
{
ANGLE_INLINE bool ClientWaitSyncHasFlush(EGLint flags)
{
return (flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR) != 0;
}
} // namespace priv
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ChooseConfig(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CopyBuffers(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateContext(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID share_contextPacked)
{
return TryLockContext(dpyPacked, share_contextPacked);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreatePbufferSurface(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreatePixmapSurface(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateWindowSurface(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyContext(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked)
{
// Explicit lock in egl::Display::destroyContext()/makeCurrent()
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySurface(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetConfigAttrib(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetConfigs(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetCurrentDisplay(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetCurrentSurface(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetDisplay(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetError(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetProcAddress(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_Initialize(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_MakeCurrent(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked)
{
// Explicit lock in egl::Display::makeCurrent()
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryContext(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked,
EGLint attribute)
{
return TryLockContext(dpyPacked, ctxPacked);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryString(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurface(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
switch (attribute)
{
// EGL_BUFFER_AGE_EXT and EGL_SURFACE_COMPRESSION_EXT uses current Context
// and therefore requires the lock.
case EGL_BUFFER_AGE_EXT:
case EGL_SURFACE_COMPRESSION_EXT:
return TryLockCurrentContext(thread);
// Other attributes are not using Context, therefore lock is not required.
default:
return {};
}
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapBuffers(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_Terminate(Thread *thread,
egl::Display *dpyPacked)
{
// Accesses only not curent Contexts
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitGL(Thread *thread)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitNative(Thread *thread)
{
return TryLockCurrentContext(thread);
}
// EGL 1.1
ANGLE_INLINE ScopedContextMutexLock GetContextLock_BindTexImage(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseTexImage(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SurfaceAttrib(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapInterval(Thread *thread,
egl::Display *dpyPacked)
{
// Only checked in Validation that we have current Context
return {};
}
// EGL 1.2
ANGLE_INLINE ScopedContextMutexLock GetContextLock_BindAPI(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePbufferFromClientBuffer(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryAPI(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseThread(Thread *thread)
{
// Explicit lock in egl::Display::makeCurrent()
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitClient(Thread *thread)
{
return TryLockCurrentContext(thread);
}
// EGL 1.4
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetCurrentContext(Thread *thread)
{
return {};
}
// EGL 1.5
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ClientWaitSync(Thread *thread,
egl::Display *dpyPacked,
EGLint flags)
{
if (priv::ClientWaitSyncHasFlush(flags))
{
return TryLockCurrentContext(thread);
}
else
{
return {};
}
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateImage(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked)
{
return TryLockContext(dpyPacked, ctxPacked);
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformPixmapSurface(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformWindowSurface(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateSync(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyImage(Thread *thread,
egl::Display *dpyPacked)
{
// Explicit lock in egl::Display::destroyImageImpl()
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySync(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetPlatformDisplay(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncAttrib(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitSync(Thread *thread,
egl::Display *dpyPacked,
EGLint flags)
{
return TryLockCurrentContext(thread);
}
// EGL_ANDROID_blob_cache
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetBlobCacheFuncsANDROID(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANDROID_create_native_client_buffer
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateNativeClientBufferANDROID(Thread *thread)
{
return {};
}
// EGL_ANDROID_get_frame_timestamps
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetCompositorTimingSupportedANDROID(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetCompositorTimingANDROID(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetNextFrameIdANDROID(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetFrameTimestampSupportedANDROID(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_GetFrameTimestampsANDROID(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
// EGL_ANDROID_get_native_client_buffer
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetNativeClientBufferANDROID(Thread *thread)
{
return {};
}
// EGL_ANDROID_native_fence_sync
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DupNativeFenceFDANDROID(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANDROID_presentation_time
ANGLE_INLINE ScopedContextMutexLock GetContextLock_PresentationTimeANDROID(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_device_creation
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateDeviceANGLE(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseDeviceANGLE(Thread *thread)
{
return {};
}
// EGL_ANGLE_device_vulkan
ANGLE_INLINE ScopedContextMutexLock GetContextLock_LockVulkanQueueANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_UnlockVulkanQueueANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_external_context_and_surface
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_AcquireExternalContextANGLE(Thread *thread, egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ReleaseExternalContextANGLE(Thread *thread, egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_ANGLE_feature_control
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStringiANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDisplayAttribANGLE(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
// EGL_ANGLE_metal_shared_event_sync
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CopyMetalSharedEventANGLE(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_power_preference
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ReleaseHighPowerGPUANGLE(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked)
{
return TryLockContext(dpyPacked, ctxPacked);
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ReacquireHighPowerGPUANGLE(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked)
{
return TryLockContext(dpyPacked, ctxPacked);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_HandleGPUSwitchANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ForceGPUSwitchANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_prepare_swap_buffers
ANGLE_INLINE ScopedContextMutexLock GetContextLock_PrepareSwapBuffersANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_ANGLE_program_cache_control
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ProgramCacheGetAttribANGLE(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ProgramCacheQueryANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_ProgramCachePopulateANGLE(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ProgramCacheResizeANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_query_surface_pointer
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurfacePointerANGLE(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
// EGL_ANGLE_stream_producer_d3d_texture
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreateStreamProducerD3DTextureANGLE(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamPostD3DTextureANGLE(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_sync_control_rate
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetMscRateANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_vulkan_image
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ExportVkImageANGLE(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_ANGLE_wait_until_work_scheduled
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_WaitUntilWorkScheduledANGLE(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
// EGL_CHROMIUM_sync_control
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncValuesCHROMIUM(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_EXT_device_query
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDeviceAttribEXT(Thread *thread,
EGLint attribute)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDeviceStringEXT(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDisplayAttribEXT(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
// EGL_EXT_image_dma_buf_import_modifiers
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDmaBufFormatsEXT(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDmaBufModifiersEXT(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_EXT_platform_base
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformPixmapSurfaceEXT(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_CreatePlatformWindowSurfaceEXT(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetPlatformDisplayEXT(Thread *thread)
{
return {};
}
// EGL_EXT_surface_compression
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_QuerySupportedCompressionRatesEXT(Thread *thread, egl::Display *dpyPacked)
{
return {};
}
// EGL_KHR_debug
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DebugMessageControlKHR(Thread *thread)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_LabelObjectKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryDebugKHR(Thread *thread, EGLint attribute)
{
return {};
}
// EGL_KHR_fence_sync
ANGLE_INLINE ScopedContextMutexLock GetContextLock_ClientWaitSyncKHR(Thread *thread,
egl::Display *dpyPacked,
EGLint flags)
{
if (priv::ClientWaitSyncHasFlush(flags))
{
return TryLockCurrentContext(thread);
}
else
{
return {};
}
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateSyncKHR(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroySyncKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_GetSyncAttribKHR(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
return {};
}
// EGL_KHR_image
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateImageKHR(Thread *thread,
egl::Display *dpyPacked,
gl::ContextID ctxPacked)
{
return TryLockContext(dpyPacked, ctxPacked);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyImageKHR(Thread *thread,
egl::Display *dpyPacked)
{
// Explicit lock in egl::Display::destroyImageImpl()
return {};
}
// EGL_KHR_lock_surface3
ANGLE_INLINE ScopedContextMutexLock GetContextLock_LockSurfaceKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QuerySurface64KHR(Thread *thread,
egl::Display *dpyPacked,
EGLint attribute)
{
switch (attribute)
{
// EGL_BUFFER_AGE_EXT and EGL_SURFACE_COMPRESSION_EXT uses current Context
// and therefore requires the lock.
case EGL_BUFFER_AGE_EXT:
case EGL_SURFACE_COMPRESSION_EXT:
return TryLockCurrentContext(thread);
// Other attributes are not using Context, therefore lock is not required.
default:
return {};
}
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_UnlockSurfaceKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_KHR_partial_update
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetDamageRegionKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
// EGL_KHR_reusable_sync
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SignalSyncKHR(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_KHR_stream
ANGLE_INLINE ScopedContextMutexLock GetContextLock_CreateStreamKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_DestroyStreamKHR(Thread *thread,
egl::Display *dpyPacked)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStreamKHR(Thread *thread,
egl::Display *dpyPacked,
EGLenum attribute)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_QueryStreamu64KHR(Thread *thread,
egl::Display *dpyPacked,
EGLenum attribute)
{
return {};
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamAttribKHR(Thread *thread,
egl::Display *dpyPacked,
EGLenum attribute)
{
return {};
}
// EGL_KHR_stream_consumer_gltexture
ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamConsumerAcquireKHR(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamConsumerGLTextureExternalKHR(Thread *thread, egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
ANGLE_INLINE ScopedContextMutexLock GetContextLock_StreamConsumerReleaseKHR(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_KHR_swap_buffers_with_damage
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SwapBuffersWithDamageKHR(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_KHR_wait_sync
ANGLE_INLINE ScopedContextMutexLock GetContextLock_WaitSyncKHR(Thread *thread,
egl::Display *dpyPacked,
EGLint flags)
{
return TryLockCurrentContext(thread);
}
// EGL_NV_post_sub_buffer
ANGLE_INLINE ScopedContextMutexLock GetContextLock_PostSubBufferNV(Thread *thread,
egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_NV_stream_consumer_gltexture_yuv
ANGLE_INLINE ScopedContextMutexLock
GetContextLock_StreamConsumerGLTextureExternalAttribsNV(Thread *thread, egl::Display *dpyPacked)
{
return TryLockCurrentContext(thread);
}
// EGL_ANGLE_no_error
ANGLE_INLINE ScopedContextMutexLock GetContextLock_SetValidationEnabledANGLE(Thread *thread)
{
return {};
}
} // namespace egl
#endif // LIBGLESV2_EGL_CONTEXT_LOCK_IMPL_H_