Vulkan: Make eglPrepareSwapBuffersANGLE thread-safe This function now only calls vkAcquireNextImageKHR without any further processing of its results. That is deferred to the following eglSwapBuffers call which does that under the share group lock. The vkAcquireNextImageKHR call, together with the allocation of its related semaphore and fence are protected by a fine-grained lock. mNeedToAcquireNextSwapchainImage is turned atomic to guard against races to call vkAcquireNextImageKHR from multiple contexts. Note that the latter is not currently possible, but will be once calling vkAcquireNextImageKHR is moved to the end of the render pass. Bug: angleproject:6851 Bug: angleproject:8133 Change-Id: If2eeab475b4acf0621fd930c43d9d86a78a9197b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4445495 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>