Commit 17904b43c75d017ea23d0577d976a431e1ee002d

Igor Nazarov 2024-11-19T16:37:43

Vulkan: Restrict EGL_ANDROID_front_buffer_auto_refresh support Original functionality supported scenario where `VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR` and `VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR` modes may be incompatible, requiring a call to `deferAcquireNextImage()` method in order to cause swapchain recreation without swap. The `eglSurfaceAttrib()` may be called from any thread, this means that `deferAcquireNextImage` may be also called from any thread - which is not thread safe. This CL restricts exposing the extension only when VK_EXT_swapchain_maintenance1 extension is also supported, where present modes expected to be compatible on Android, so no need for swapchain recreation and therefore - `deferAcquireNextImage()` call. Not requiring to call `deferAcquireNextImage()` improves thread safety of `WindowSurfaceVk::setAutoRefreshEnabled()` method. There is still race condition accessing `mDesiredSwapchainPresentMode` but it will be addressed in a separate CL. Bug: angleproject:42265697 Bug: angleproject:379762019 Change-Id: I4631c736188eb52a5476e1a2bed3439d49cf12d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6035187 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>