Branch
Hash :
926b43e7
Author :
Date :
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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
Name
ANGLE_prepare_swap_buffers
Name Strings
EGL_ANGLE_prepare_swap_buffers
Contributors
Jamie Madill
Shahbaz Youssefi
Lingfeng Yang
Contacts
Jamie Madill, Google Inc. (jmadill 'at' google.com)
Shahbaz Youssefi, Google Inc. (syoussefi 'at' google.com)
Lingfeng Yang, Google Inc. (lfy 'at' google.com)
Status
Draft
Version
Version 1, January 10, 2022
Number
EGL Extension #??
Dependencies
This extension is written against the wording of the EGL 1.5
Specification.
Overview
The EGL implementation often relies on a swapchain to present backbuffer
rendering results. Images are dequeued from the swapchain, then written in
the course of rendering, and then queued back to the swapchain for
presentation. It can be advantageous to provide a hint API that performs
the dequeue operation and other operations necessary to prepare the
swapchain image for rendering, without also queueing it for present,
especially if there is going to be a long or variable wait associated with
the dequeue. This extension provides that api, eglPrepareSwapBuffers.
New Types
None.
New Procedures and Functions
EGLBoolean eglPrepareSwapBuffersANGLE(
EGLDisplay dpy,
EGLSurface surface);
New Tokens
None
Additions to the EGL 1.5 Specification
Add the following to section 3.10.1 "Posting to a Window":
An application can encourage the EGL implementation to dequeue and
otherwise prepare a swapchain image earlier before presenting via calling
EGLBoolean eglPrepareSwapBuffersANGLE(
EGLDisplay dpy,
EGLSurface surface);
The behaviour of eglPrepareSwapBuffers can be a no-op. It is not necessary
to call eglSwapBuffers after calling. Conversely, it's also not necessary
to call eglPrepareSwapBuffersANGLE for eglSwapBuffers to work.
Issues
None yet.
Revision History
Rev. Date Author Changes
---- ------------- --------- ----------------------------------------
1 Jan 10, 2022 lfy Initial version