src/libANGLE/EGLSync.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi b380ed1f 2024-02-14T09:31:26 Vulkan: Add EGL_ANGLE_global_fence_sync Chrome has an implicit assumption that due to context virtualization, signaling a fence in one context results in synchronization with _all_ contexts that have previously made submissions. This is not per EGL spec, but the functionality is easily implementable in the Vulkan backend. In the Vulkan backend, each context is given its own "timeline" of submissions (tracked by serials associated with "indices"). The required functionality is implemented through a new EGL fence sync object whose sole difference is that it synchronizes with all the existing timelines rather than the one of the current context. Bug: b/318721705 Change-Id: I6c45d065e592d0d4ed627ce9695196b1086d5021 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5297396 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f035cdb4 2023-12-11T13:45:22 Fix SyncID initializer. Requires brace initialization to work on all compilers. Bug: angleproject:8430 Change-Id: I6e79f2446f057bf9eaaaecfc9f82b26320c5ba56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5111600 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang c27a4a1d 2023-11-27T14:44:07 Re-use EGL sync object allocations. Create a pool of EGL sync objects with their implementations that can be re-used. Update all backend implementations to support multiple calls to initialize/destroy. Pool size of 32 chosen through experimentation using Chrome. Bug: angleproject:8430 Change-Id: I86fea41aed35eddccc953efb3802bf5fdb7f3cb2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5063341 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 1ff6a6f2 2023-11-27T13:08:29 Pass the attribute map to egl::Sync::initialize. The attribute map was typically passed to the impl objects in the constructors. Instead, pass it to the initialize function. This removes the need for many member variables in different backends and opens up the future optimization of re-using sync objects by calling initialize on them with new attributes. Bug: angleproject:8430 Change-Id: If69970462cfed39d9a205034adb5ddd937c5ea31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5063335 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop d8339e78 2023-05-25T08:40:48 FrameCapture: Support EGLSync in MEC This CL starts treating EGLSync as a tracked resource, such that we can detect when they need to be created in Setup, or regenerated in Reset. Test: MEC of infinity_ops trace Test: Replay new kentucky_route_zero trace without error Bug: angleproject:8176 Change-Id: I130212f6edb78d9df29dd6e572843df25493ae09 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4566949 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Dan Glastonbury aa5b97de 2023-03-06T17:59:43 ANGLE_metal_shared_event_sync: Control signaling external events It was assumed that the external MTLSharedEvent passed to eglCreateSync should be signaled by the GL. This change adds EGL_SYNC_METAL_SHARED_EVENT_SIGNALED_ANGLE, which when passed as the value for EGL_SYNC_CONDITION during eglCreateSync, changes the behavior to not insert a fence command into the command stream. Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.AngleMetalSharedEventSync_WaitSync_ExternallySignaled Bug: angleproject:8064 Change-Id: Ia1b8615b976f293d411b7d2be506b0ac87d64dee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4307152 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
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>
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>
Dan Glastonbury a89f678f 2022-06-16T13:59:16 EGL: Implement ANGLE_metal_shared_event_sync on metal Implement creation of fence sync object taking an external MTLSharedEvent and optional value to use when signaling completion of prior commands. Extended end2end test suite with metal shared event test cases. Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.* Bug: angleproject:7561 Change-Id: I0e72b5417275a20a24e535670ceb995ecc87abcb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3865060 Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Jeff Vigil 00a49766 2020-10-14T10:27:56 EGL: Implement EGL_KHR_reusable_sync Add extension string and flags Add EGLReusableSync files to libANGLE and gni Test: angle_deqp_egl_tests --deqp-case=dEQP-EGL.functional.reusable_sync.* --deqp-case=dEQP-EGL.functional.fence_sync.* Bug: angleproject:5168 Change-Id: I967a10cf387047c9ee1963acfc854a8288325a8e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477293 Commit-Queue: Jeff Vigil <j.vigil@samsung.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Vigil e20f36f4 2020-04-21T15:45:44 EGL: Implement EGL_ANDROID_native_fence_sync on vulkan Check the following - 1. Vulkan ICD supports VK_KHR_external_fence_fd 2. ExternalFenceProperties and ExternalSemaphoreProperties support Android FD. eglCreateSync - if FD was provided import to VkFence, else create VkFence with new FD and then flush and submit VkFence on next vkQueueSubmit. eglGetSyncAttrib - for status call vkGetFenceStatus. eglDupNativeFenceFdANDROID - return FD from vkGetFenceFD call. eglClientWaitSync - call vkWaitForFences. eglWaitSync - dup FD, create VkSemaphore and import FD, then flush() and add VkSemaphore to next vkQueueSubmit as a waiting semaphore. Extended end2end test suite with nativefence test cases. Bug: angleproject:2517 Test: angle_end2end_tests --gtest_filter=EGLSyncTest.AndroidNativeFence_* Change-Id: I8f6a6f4c3d71d83007f662b78377aa015a740035 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2026177 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 69e46a18 2019-07-03T14:43:32 GL: Implement EGL_ANDROID_native_fence_sync This extension allows Chrome to use ANGLE on newer Android devices. BUG=angleproject:3643 Change-Id: I5456d61749399ca2bbc11cc5e98b9120f8702406 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1687121 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 62934322 2019-07-03T14:39:14 Make egl::Sync a LabeledObject. This allows us to return the Sync's label when validation fails for a Sync related entry point. BUG=angleproject:3643 Change-Id: I64e8a8855a2e3b51768c2b560fdc4696bb325351 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1687120 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 9049d321 2019-03-27T14:08:44 Vulkan: Pass the current context to egl Sync operations. The EGL_KHR_fence_sync spec says that if a flush is needed before waiting on the sync, it's done on the current context for the current thread. This helps simplify the multithreading design, we don't need to worry about flusing on a context that may no longer exist or is executing on a different thread. It does allow infinite waits because the context with the fence is never flushed but the spec allows this. BUG=angleproject:2464 Change-Id: I8bf2f93c408fee2dae95caa5bb9c76ba67687931 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1542256 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 5313c8a8 2019-01-14T17:02:52 Implement EGL_KHR_fence_sync and EGL_KHR_wait_sync EGL_KHR_fence_sync introduces the EGLSync object and associated create/destroy/clientWait functions. EGL_KHR_wait_sync adds the serverWait function on top of that. Bug: angleproject:2466 Change-Id: Iebb239a85c4471ea18b3c3a8a83b793af555e31d Reviewed-on: https://chromium-review.googlesource.com/c/1412261 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>