src/libGLESv2/entry_points_egl_ext_autogen.cpp


Log

Author Commit Date CI Message
Yuxiang Qian 6a03109f 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>
Shahbaz Youssefi 5b343e8f 2025-03-11T11:35:08 Vulkan: Remove support for Stadia Bug: angleproject:42262714 Change-Id: Icae5fe828fe4e0bcd287d297df1bc586708ef86e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6344390 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi bbc0d702 2024-12-27T07:44:01 Vulkan: Add entry points to lock the Vulkan queue ... which can be retrieved via EGL_ANGLE_device_vulkan. Otherwise the application is unable to use the VkQueue that is retrieved out of ANGLE from other threads (such as Chromium's DrDC feature). Bug: chromium:380295059 Change-Id: Ife80f54440777486f72fc61697a68fb0c2b2d0f7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6116046 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuxiang Qian fb743105 2024-11-26T14:37:39 Add stubs for EGL_EXT_surface_compression This patch adds stubs for EGL_EXT_surface_compression to ANGLE, including new API eglQuerySupportedCompressionRatesEXT and adding EGL_SURFACE_COMPRESSION_EXT in EGLQuerySurface and EGLCreateWindowSurface/EGLCreatePlatformWindowSurface. Bug: angleproject:375496226 Change-Id: I1962a11e8e3e5eb2cd5b13c5ba0f685781dfd015 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6073354 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 65d674b0 2024-12-02T18:36:11 Vulkan: Must run UnlockedTailCall from flush and finish `glFlush` and `glFinish` may call `WindowSurfaceVk::swapImpl()` implicitly when the current Window Surface is in the single buffer mode. The `WindowSurfaceVk::swapImpl()` in turn may add unlocked tail call in order to perform CPU throttling. It seems, that CPU throttling is only possible if also enable the `EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID` attribute (using `VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR`). Without this attribute (`VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR`) `vkQueuePresentKHR()` performs implicit waiting for GPU, making ANGLE's throttling uncessary (the serial is already finished). This fix allows running the tail call from `glFlush` and `glFinish` (because these APIs are not performance critical). Alternative solution may instead perform the CPU throttling immediately if the `WindowSurfaceVk::swapImpl()` is called from the `WindowSurfaceVk::onSharedPresentContextFlush()`. Additionally, added "ASSERT(!any())" at the beginning of each entry point. This is to catch scenarios, if some API adds the unlocked tail call and for some reason exit without checking the assert of running the call. Test: angle_end2end_tests --gtest_filter=EGLAndroidAutoRefreshTest.SwapCPUThrottling/ES3_Vulkan_NoFixture Bug: angleproject:42266581 Change-Id: I418c552f6e95b4cfc01db738c9989533377f1050 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6063719 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Yuxin Hu e5619a5c 2024-10-15T18:27:00 Use EGL sync global lock for all EGL*sync entrypoint calls To free EGL sync operations from waiting for other EGL calls to finish, we use a separate global lock for EGL*sync entrypoints. Below angle::SimpleMutex are added to protect resources that may have race condition due to being accessed by EGL*sync calls and non EGL*sync calls at the same time: 1. Display::mContextMapMutex that protects Display::mState.contextMap 2. static angle::base::NoDestructor<angle::SimpleMutex> anglePlatformDisplayMapMutex that protects static angle::base::NoDestructor<ANGLEPlatformDisplayMap> displays 3. static angle::base::NoDestructor<angle::SimpleMutex> devicePlatformDisplayMapMutex that protects static angle::base::NoDestructor<DevicePlatformDisplayMap> displays EGL_Terminate() entry point takes both global lock and global egl sync lock. This is to protect Display::mSyncMap, Display::mSyncPools, and Display::mSyncHandleAllocator being get cleared by thread 1 calling eglTerminate, while they are still accessed by thread 2 through a call such as eglCreateSync. So that we won't have thread 2 finish validating the sync object with syncID exists in Display::mSyncMap, but then find the mSyncMap.find(syncID) returns a nullptr due to the mSyncMap is cleared by thread 1. Same applies to EGL_LabelObjectKHR(), EGL_ReleaseThread(), ThreadCleanupCallback(). EGL_Initialize() writes to Display::mInitialized. This is read by EGL Sync API validation functions. EGL_Initialize() also takes both global lock and global sync lock to prevent race conditions between EGL_Initialize() and EGL Sync APIs. When ANGLE_CAPTURE_ENABLED is enabled, fall back to global lock, as the CaptureEGLCallToFrameCapture() touches many resources (e.g. mMaxAccessedResourceIDs, mFrameCalls) that could lead to race conditions without a global lock. Bug: b/362604439 Change-Id: Ic0d54a4cd66743bcd0f48f41f247dd223cff2f5e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5933570 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 4167a9a0 2024-08-29T23:38:05 Don't lock the context mutex if no flush in eglClientWaitSync Bug: b/362604439 Change-Id: Ic514bcb3824514b5fd82ebb14ab97286aeb6557c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5828262 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 0e892a02 2024-05-30T14:07:47 EGL: Move egl surface timing calls into tail calls. eglGetCompositorTimingANDROID and eglGetFrameTimestampsANDROID can both take a lot of driver time to execute proportional to ANGLE's overhead. Bug: angleproject:42266858 Change-Id: I9b991f74a261b45aeb2aaf133fca7d22cabc41f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5580877 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang a70ef7fc 2024-04-25T14:19:50 Add EGL_ANGLE_no_error for disabling EGL validation. Chrome makes many small EGL calls that can have proportionally expensive validation. Bug: angleproject:8434 Change-Id: I4f4d0e6eff64839f76a0f7bf48e5c94b8df9d809 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5491459 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 071e1e83 2024-05-08T10:33:49 EGL: eglCreateSyncKHR uses a return value for the tail call eglCreateSyncKHR was duplicated in two lists for using a tail call and needing a return value tail call. Bug: angleproject:8434, chromium:338902974 Change-Id: I9dffeaec3468e4ea3f5ed7d885e9ef418e8d8da5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5525854 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 038ad6c7 2024-04-23T13:23:04 EGL: Use unlocked tail calls for surface, sync and img calls EGL surface and sync calls can be expensive to do while holding the global lock on EGL. They are safe because the parameters are captured by value and the underlying EGL driver is also thread safe. EGL image creation also tends to be expensive and is called freqently by Chrome. Bug: angleproject:8434 Change-Id: I7e554fe2e3700d98469de267f7bbff1e96358c78 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5478229 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 318e5e02 2024-03-24T08:17:56 Vulkan: Update EGL_EXT_buffer_age implementation 1. Buffer age is always 1 when swap behavior is EGL_BUFFER_PRESERVED. 2. WindowSurfaceVk::getBufferAge no longer acquires a swapchain image. See commit: b46cf6989f6fe8db5f0759001f633681a96fadde 3. It is valid to pass attributes of eglQuerySurface API to eglQuerySurface64KHR API 4. Add deadlock fix to eglQuerySurface64KHR Bug: angleproject:3529 Bug: angleproject:6851 Tests: EGLLockSurface3Test.QuerySurfaceAndQuerySurface64Parity* Tests: EGLBufferAgeTest.QueryBufferAge* Change-Id: Idf3c4fc08364f671fb02e99111be2beb7a1d9f3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5389461 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya ce263437 2023-09-11T12:25:28 Vulkan: Perform CPU wait in clientWait outside the global lock Leverage UnlockedTailCall and move the CPU side wait during a clientWait outside of the global mutex lock. Bug: angleproject:8340 Tests: FenceSyncTest.BasicOperations* Tests: EGLSyncTest.EglClientWaitSync* Change-Id: I8c05e62e74cc64d38bf8797d28faaf49135e71fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851649 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Mohan Maiya 9740b01b 2023-09-08T16:30:08 Enhance UnlockedTailCall run method UnlockedTailCall::CallType is now std::function<void(void *)> This is in preparation for upcoming changes where unlocked tail calls need access to objects outside block and namespace scope. Bug: angleproject:8340 Tests: UnlockedTailCall* Change-Id: Ida6822b701c5c11ce4b8f6e3aae53108755e2cad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4852021 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi 6c1bab07 2023-08-02T12:25:51 Add surface to eglAcquireExternalContextANGLE Bug: angleproject:5509 Change-Id: I51284ae4dc865dc31d1c5540c24e1e0abb95fe0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4743719 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2d5fb09d 2023-07-22T22:34:20 Stubs for EGL_ANGLE_external_context_and_surface Bug: angleproject:5509 Change-Id: I8e2395784abcd2b4e3e1f888e70a879ef49287bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706026 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Igor Nazarov 36c3e0f5 2023-01-17T17:42:59 Implement "Shared Context Mutex" functionality. Existing implementation uses single `GlobalMutex` for - EGL calls - GL calls for Contexts with concurrent access. This CL introduces abstract `egl::ContextMutex` with two implementations: - SingleContextMutex; - SharedContextMutex<Mutex>; Note: `std::mutex` is used in this commit. It is very easy to change mutex type either at compile-time or at run-time (single type per Display). When Context: - is not Shared; - does not use `EGLImage`s; - does not use EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE - does not use EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE then it will be using `SingleContextMutex` with minimal overhead. Before such Context is used as `shareContext` or uses `EGLImage` its mutex replaced by `SharedContextMutex<Mutex>`. The `GlobalMutex` is only used for EGL calls, while `egl::ContextMutex` implementations for GL calls. Because some EGL calls use Context, explicit `egl::ContextMutex` lock is required. This is implemented by generating "egl_context_mutex_autogen.h" header, and insertion of `ANGLE_EGL_SCOPED_CONTEXT_LOCK()` macro before `ANGLE_EGL_VALIDATE()` in each EGL entry point. Implementation in "egl_context_lock_impl.h" returns lock for required APIs. Special cases of `egl::ContextMutex` lock handled separately. `std::unique_lock<>` is not used for performance reasons. `egl::ContextMutex` explicitly locked when capturing EGL calls. Fixes EGLImage problem: https://chromium.googlesource.com/angle/angle/+/e18240d136d15e5cdfa4fa4a6355ca21c8d807b6 Mark contexts as shared when importing EGL images. Details: - EGLImage inherits Context's mutex when created. Mutex is used when the EGLImage accessed or destroyed. - When EGLImage is used in Context with other `egl::ContextMutex`, two mutexes are merged into one. - After the mutex merge, Context Groups will remain separate, but will not be able to run in parallel. Fixes race when checking `context->isShared()` in the `SCOPED_SHARE_CONTEXT_LOCK()` macro. One Context may start executing GL call while not "Shared", but become "Shared" inside the call. New (second) "Shared" Context may immediately start using GL and potentially corrupt some "Shared" state. Possible performance benefit: allows parallel execution in some cases, when single `GlobalMutex` would block. Important note: Process of replacing the `SingleContextMutex` by `SharedContextMutex<Mutex>` is not 100% safe. This mean that original Context may still be using `SingleContextMutex` after activating `SharedContextMutex<Mutex>`. However, this was always the case before introduction of this CL. Old `Context::mShared` member update was not synchronized in any way at all. In other words, this solution does not 100% fix the original problem. For 100% safe solution `SingleContextMutex` should not be used (always pass `SharedContextMutex<Mutex>` to the `gl::Context` constructor). See `lockAndActivateSharedContextMutex()` for more details. CL adds new build option: angle_enable_shared_context_mutex = true Behavior with other build options: - When: `angle_enable_shared_context_mutex` is disabled or `angle_enable_share_context_lock` is disabled or `angle_force_context_check_every_call` is enabled, Contexts will always have `SingleContextMutex`, however it will be only used in special cases. `SCOPED_SHARE_CONTEXT_LOCK()` will use `GlobalMutex` when applicable. - Otherwise, `SCOPED_SHARE_CONTEXT_LOCK()` will use `egl::ContextMutex`. Some GFXBench "1080p Driver Overhead 2 Offscreen" performance numbers. Tested on S906B (Samsung Galaxy S22+) on old ANGLE base: https://chromium.googlesource.com/angle/angle/+/807c94ea85e046c6f279d081d99f0fb1bcf1191a Capture/Replay: Adjust tests do adhere to capture limits Each test result is an average frame number from 6 runs. SingleContextMutex 6579 ( +0.13%) (old) GetContextLock() (mShared is false) 6570 Forced `mShared = true` or NOT using `SingleContextMutex`. SharedContextMutex<std::mutex> FORCE 5061 (-22.97%) (old) GetContextLock() FORCE 4766 (-27.46%) Bug: angleproject:6957 Bug: chromium:1336126 Change-Id: Idcd919f9d4bf482b9ae489bd8b4415ec96048e32 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7fd01d03 2023-04-19T00:54:24 Vulkan: Throttle the CPU without holding the global lock CPU throttling goes through CommandQueue and is thread-safe. Performing it in an unlocked tail call allows other unrelated EGL calls to go through. Bug: angleproject:8135 Change-Id: Idb3841be5d8ea8c4b76217f6707be26b28ea39c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4444027 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi cd6a58f2 2023-04-18T12:45:10 Vulkan: Make eglPrepareSwapBuffersANGLE less special This function now uses the UnlockedTailCall mechanism so it doesn't require as much special-case code generation. This change does not fix the bug that this function is doing too much work without holding any locks. That will be done in a follow up. Bug: angleproject:6851 Bug: angleproject:8133 Change-Id: I77f4d514ff4aeef85bc1cc59214f7caa23aca7df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4443186 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1328f2f3 2023-04-17T16:43:12 Vulkan: Destroy the surface without holding the EGL lock This change defers surface destruction to the end of the entry point that causes it so that it is done without holding the EGL lock. This works around a specific deadlock in Android. On this platform: - For EGL applications, parts of surface creation and destruction are handled by the platform, and parts of it are done by the native EGL driver. Namely, on surface destruction, native_window_api_disconnect is called outside the EGL driver. - For Vulkan applications, vkDestroySurfaceKHR takes full responsibility for destroying the surface, including calling native_window_api_disconnect. Unfortunately, native_window_api_disconnect may use EGL sync objects and can lead to calling into the EGL driver. For ANGLE, this is particularly problematic because it is simultaneously a Vulkan application and the EGL driver, causing `vkDestroySurfaceKHR` to call back into ANGLE and attempt to reacquire the EGL lock. Since there are no users of the surface when calling vkDestroySurfaceKHR, it is safe for ANGLE to destroy it without holding the EGL lock. Note that only eglDestroySurface and eglMakeCurrent may lead to the destruction of a window surface. Bug: b/275176234 Bug: angleproject:8127 Change-Id: I02dc52e53e150943457e3f503e7ef30469f96b05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428754 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3b57e999 2023-04-17T15:38:47 Scope global lock in entry points This change is a no-op. It's in preparation for adding calls at the end of the entry point after the lock is unlocked. Bug: angleproject:8127 Change-Id: I4cd79ff8e5f20f87f36040afbd1ed9f16406d519 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4436589 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Igor Nazarov be3d7e6b 2023-03-30T14:35:18 Remove redundant g_SurfaceMutex. This mutex become redundant after recent CL: https://chromium.googlesource.com/angle/angle/+/23ad4fa2be35aed303cbb8c2d632a04714354ef0 Don't hold global surface lock during AcquireNextImage Every place in the code where `ANGLE_SCOPED_GLOBAL_SURFACE_LOCK()` is used also uses `ANGLE_SCOPED_GLOBAL_LOCK()`. Bug: angleproject:6851 Change-Id: I464b6ca74743c9ee9fa23caad216f0e26c480655 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4385293 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Gert Wollny a52c0a6c 2023-02-06T16:01:27 Capture/Replay: Add and handle new resource type for EGLSync So far calls involving EGLSync were not tracking the actual sync objects, and this may lead to race conditions in multi-threaded and multi-context scenarios. This CL adds the type EGLSyncID and some specialized code handling of egl::Sync to distinguish EGLSync from the already existing GLSync objects in order to track them separately. Bug: angleproject:7911 Change-Id: I91b188a41069bc0620f51c55ee516d23b55bdd38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4200095 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gregg Tavares be9e8e7b 2022-12-14T14:13:39 Add EGL_ANGLE_wait_until_work_scheduled extension We're changing eglReleaseTexImage so it calls flushCommandBuffer(mtl::NoWait) instead of flushCommandBuffer(mtl::WaitUntilScheduled) and then adding an extension to allow us to WaitUntilScheduled. This is because Chrome calls eglReleaseTexImage for every canvas and having it WaitUntilScheduled per call is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE once which will effectively wait just once. Bug: angleproject:7890 Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Jamie Madill 8403e4c5 2022-10-10T20:59:29 EGL: Resource IDs for Surface, Context and EGL Image. This will make these classes play nicely with resource maps. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. This indirection will also have increased safety as we validate EGL resource ID handle values before accessing the memory directly. Also hides some of the other EGL capture methods behind helper methods to simplify the C code and hide assignments and other complex maps. Bug: angleproject:7758 Change-Id: Ibc7bb56430d3068bd38877c9dfb011979d4ea234 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957164 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 2265e37b 2022-10-12T09:27:16 Capture/Replay: Auto-generate EGL capture code. Replaces the custom code in the EGL stubs. Skips a few "Get" entry points because this CL doesn't implement pointer capture like we do for all the GL entry points. Includes a new state in the AttributeMap that indicates which type of attribute values we used when initializing the map. Bug: angleproject:4035 Change-Id: I272eac5e4068602ce710ef66c9a1dce5387943a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949911 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 7c4dc253 2022-10-12T08:38:46 Capture/Replay: Clean up EGL capture. This switches the EGL capture types to ANGLE-casted pointers since that's what we receive in the capture layer. Note that even if the capture layer were used as a pure layer, not an EGL implementation, we'd still have these types for state tracking. This also prefixes each EGL class in the entry points with the egl namespace for consistency and for simplifying the ParamType code. Required changing to non-const gl::Context * in a few places. Also changes the gSurfaceMap to be indexed by the raw pointer value, which cleans up the code somewhat. Bug: angleproject:4035 Change-Id: Id800c1ba25e5819ac7ea1df8aab806bc393fe192 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949910 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Dan Glastonbury d2a58f00 2022-09-08T14:19:21 EGL: Implement eglCopyMetalSharedEventANGLE Add eglCopyMetalSharedEventANGLE function to the ANGLE_metal_shared_event_sync extension. This brings the extension on par with the EGL_ANDROID_native_fence_sync extension. eglCopyMetalSharedEventANGLE allows for copying the Metal event object from EGLSync objects implemented by the ANGLE Metal renderer. This function follows Objective-C convention for "copy" methods and increases the retain count of the Metal event object. The EGL API user is thus responsible for ensuring to release the returned object to avoid memory leaks. Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.* Bug: angleproject:7561 Change-Id: I8c35b559014b85cb8c6a0e76ac2ab7891eed5da0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3881423 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Kimmo Kinnunen 9637185c 2022-03-10T15:38:13 Add ForceGPUSwitch to EGL_ANGLE_power_preference eglHandleGPUSwitch() does not work with WebKit sandbox profile. The root cause is that we do not know the primary display, and as such we do not know which GPU drives this. Add eglForceGPUSwitchANGLE(display, gpuIDHigh, gpuIDLow). This lets the caller figure out the GPU in another process. Then the caller can just set the GPU in the sandboxed process. Add tests that are disabled by default until the runner and the infrastructure supports running the tests with automatic switching enabled. Bug: angleproject:7092 Change-Id: I316ee431156596effbdb89659a5e24291719a204 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516274 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Antonio Caggiano b92ebdb7 2022-02-24T12:23:09 EGL: Add code-gen for dmabuf extensions Add code-gen for EGL_EXT_image_dma_buf_import and EGL_EXT_image_dma_buf_import_modifiers. Bug: angleproject:7065 Change-Id: Ib1bd2a881f11e96b1e7e5128975bdba3bdc41e0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3495122 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Constantine Shablya 3f0a28ba 2022-02-11T16:18:37 Add entry points for EGL_KHR_partial_update Bug: angleproject:6960 Change-Id: If248b7ef5ebacd7dfb8c612e5a9106ba0060282e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3455787 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Lingfeng Yang 926b43e7 2022-01-06T13:31:54 Reland: Frontend: separate lock in swap prep Swapchain-based backends like Vulkan might block a lot in vkAcquireNextImageKHR, which is bad for overall fast progress if we also hold the global EGL lock there. This CL starts to split the global EGL lock. We release the EGL lock when performing vkAcquireNextImageKHR, and only maintain a lock for surfaces. This is done via a new custom entry point, EGL_PrepareSwapBuffers, so that we can control how the global lock is used throughout the entire call. Bug: angleproject:6851 Change-Id: I095cd8b3bdbb13c842cab0a46148e2122582cdfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373426 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Jamie Madill 9d668d6c 2022-01-07T18:18:23 Revert "Frontend: separate lock in swap prep" This reverts commit 40c5cb255c0a07bdab574aa076ee603e7d791ab3. Reason for revert: Regression in TSAN caused by this CL: https://ci.chromium.org/ui/p/angle/builders/ci/linux-tsan-test/352/overview Original change's description: > Frontend: separate lock in swap prep > > Swapchain-based backends like Vulkan might block a lot in > vkAcquireNextImageKHR, which is bad for overall fast progress if we also > hold the global EGL lock there. > > This CL starts to split the global EGL lock. We release the EGL lock > when performing vkAcquireNextImageKHR, and only maintain a lock for > surfaces. > > Bug: angleproject:6851 > Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Lingfeng Yang <lfy@google.com> Bug: angleproject:6851 Change-Id: Ie03b784021f7b8b5c1ef95a911ef7da4029abd46 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373165 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Lingfeng Yang 40c5cb25 2022-01-06T13:31:54 Frontend: separate lock in swap prep Swapchain-based backends like Vulkan might block a lot in vkAcquireNextImageKHR, which is bad for overall fast progress if we also hold the global EGL lock there. This CL starts to split the global EGL lock. We release the EGL lock when performing vkAcquireNextImageKHR, and only maintain a lock for surfaces. Bug: angleproject:6851 Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Peng Huang e00ad443 2021-11-15T20:16:16 Add EGL_ANGLE_vulkan_image extension This extension is for exporting VkImage from EGLImage. The VkImage must be used with the same VkDevice used by ANGLE Vulkan backend. Bug: chromium:1264439 Change-Id: I222d900465cf2716d94fc64f06e240390ec518ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3285025 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Shahbaz Youssefi 41a8981e 2021-11-21T21:52:37 Use AttributeMap in eglLockSurfaceKHR's validation Bug: angleproject:6062 Change-Id: I0eea431313700b11184265a9ff895417ce4b1d4d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3295164 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: (use @chromium please) Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil d3e67716 2021-09-21T15:03:15 EGL: EGL_KHR_lock_surface3 Add new extension KHR__lock_surface3 Add new interfaces for locking and unlocking a surface. Test: angle_end2end_test --gtest_filter=EGLLockSurface3Test Bug: angleproject:6062 Change-Id: Ic40708db4db552107025635540a0c62f956d741e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3161447 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang b5424bb4 2021-01-14T15:09:41 Generate internal gl entry point functions as C functions. Some internal GL functions are exported to our libGLESv1_CM library and to properly export them, they must be C functions. Bug: angleproject:5534 Change-Id: I37280312f73fd5e55166e4fa36659267d657a50b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628139 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Xiaoxuan Liu 108b759e 2020-12-04T15:15:49 EGL: Update EGL headers/xml The new EGL headers introduced 'EGL_NO_X11' which we could use for ANGLE vulkan display/headless backend. Changes in CL: 1. Updated include/EGL/egl*.h and scripts/egl.xml based on latest EGL repo: https://github.com/KhronosGroup/EGL-Registry Note: local modifications to the file were preserved in eglext.h, search keyword 'eglext_angle.h' for detail 2. run scripts to update entry_points/loader scripts/generate_entry_points.py scripts/generate_loader.py scripts/run_code_generation.py 3. Update ANGLE code on API 'eglSwapBuffersWithDamage' 4. Format with 'git cl format' Bug: angleproject:5260 Change-Id: I70ed0dccecf0426929ef8b4775605554d66c5724 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2576314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 234fccfb 2020-12-01T10:59:16 Entry Points: Add egl:: namespace to Display. This will prevent symbol collision with X11. This fixes the build integration with Skia. Bug: angleproject:2621 Bug: angleproject:5416 Change-Id: I6949a375cf9fcdd790b4c40ffb82c7c25bc15315 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2567644 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 3f564fc7 2020-11-23T13:59:17 EGL: Generate entry points. This adds two final auto-generated files for the EGL and EXT extension entry points. It adds a new data file that stores a mapping between object types and entry points for associating labeled objects with certain methods. When we generate errors we record the associated object in the debug message output. This places the remainder of the hand-written code in "stub" files. Going forward the work for implementing new extension entry points for EGL will be to update the registry XML files and then implement the corresponding stub methods. Event logging, parameter packing, and validation are all handled by the auto-generated code. Bug: angleproject:2621 Change-Id: I28153432802c37b929ff2ea1e1a3e3ce9de91605 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562680 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>