src/tests/egl_tests/EGLSyncTestMetalCommandsScheduled.mm

Branch


Log

Author Commit Date CI Message
Sunny Sachanandani 99c47333 2025-10-15T13:21:19 [metal] Fix data race in commands scheduled sync The recently added commands scheduled sync object adds a callback to the command queue to be invoked when the scheduled handler for the committed command buffer runs. This callback could be called after the sync object is destoyed, so make sure it doesn't reference the original sync object, but only a thread-safe ref-counted state object. Bug: chromium:444702048 Change-Id: Ifaef54eae5dfdb0b6eb6b767120947e66a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7046662 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Sunny Sachanandani 774bca93 2025-10-08T18:41:13 [metal] Add commands scheduled sync object We need a thread-safe way to wait for ANGLE Metal command buffers to be scheduled for IOSurface synchronization with DrDC + Graphite on Mac. The existing eglWaitUntilWorkScheduledANGLE API isn't thread-safe as it reaches into ContextMtl innards to flush the command buffer. This CL adds the EGL_ANGLE_metal_commands_scheduled_sync extension which introduces a EGL_SYNC_METAL_COMMANDS_SCHEDULED_ANGLE sync object type. This sync object is signaled when pending Metal commands are scheduled to run on the GPU (MTLCommandBufferStatusScheduled). These sync objects are thread-safe - eglClientWaitSync() can be called on any thread even without a current context which is needed for DrDC + Graphite on Mac. Bug: chromium:444702048 Change-Id: Ia13b352385a6fefaa026526ef74f6e596a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7027996 Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>