• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    ANGLE_device_vulkan
4
5Name Strings
6
7    EGL_ANGLE_device_vulkan
8
9Contributors
10
11    Peng Huang  (penghuang 'at' google.com)
12    Shahbaz Youssefi  (syoussefi 'at' google.com)
13
14Contact
15
16    Peng Huang  (penghuang 'at' google.com)
17
18Status
19
20    Draft
21
22Version
23
24    Version 1, Oct 28, 2021
25
26Number
27
28    EGL Extension #XXX
29
30Extension Type
31
32    EGL device extension
33
34Dependencies
35
36    This extension is written against the language of EGL 1.5 as
37    modified by EGL_EXT_device_query.
38
39    EGL_EXT_device_query is required.
40
41Overview
42
43    ANGLE has the ability to run GPU commands on a native Vulkan device.
44    This extension defines a mapping from an EGL device to a Vulkan
45    device, after it's queried from an EGL display.
46
47IP Status
48
49    No known claims.
50
51New Types
52
53    None.
54
55New Procedures and Functions
56
57    void eglLockVulkanQueueANGLE(EGLDisplay dpy);
58
59    void eglUnlockVulkanQueueANGLE(EGLDisplay dpy);
60
61New Tokens
62
63    Accepted as a queried <attribute> in eglQueryDeviceAttribEXT:
64
65        EGL_VULKAN_VERSION_ANGLE             0x34A8
66        EGL_VULKAN_INSTANCE_ANGLE            0x34A9
67        EGL_VULKAN_INSTANCE_EXTENSIONS_ANGLE 0x34AA
68        EGL_VULKAN_PHYSICAL_DEVICE_ANGLE     0x34AB
69        EGL_VULKAN_DEVICE_ANGLE              0x34AC
70        EGL_VULKAN_DEVICE_EXTENSIONS_ANGLE   0x34AD
71        EGL_VULKAN_FEATURES_ANGLE            0x34AE
72        EGL_VULKAN_QUEUE_ANGLE               0x34AF
73        EGL_VULKAN_QUEUE_FAMILIY_INDEX_ANGLE 0x34D0
74        EGL_VULKAN_GET_INSTANCE_PROC_ADDR    0x34D1
75
76Add a new section 2.1.3 (Vulkan Devices) after 2.1.2 (Devices)
77
78    Somewhat analogous to an EGL device, a Vulkan device establishes a
79    namespace for Vulkan operations. In the Vulkan APIs, such devices are
80    represented by pointers. For more details, see the Vulkan
81    documentation.
82
83Changes to section 3.2 (Devices)
84
85    Replace the paragraph immediately following the prototype for
86    eglQueryDeviceAttribEXT:
87
88    <attribute> may be EGL_VULKAN_VERSION_ANGLE.
89    On success, EGL_TRUE is returned, and the Vulkan versionbcorresponding to
90    the EGL device is returned in <value>. If the EGL device is not currently
91    associated with a Vulkan device and <attribute> is EGL_VULKAN_VERSION_ANGLE,
92    EGL_BAD_ATTRIBUTE is returned, and <value> is left unchanged.
93
94    <attribute> may be EGL_VULKAN_INSTANCE_ANGLE.
95    On success, EGL_TRUE is returned, and a valid Vulkan instance handle
96    VkInstance corresponding to the EGL device is returned in <value>.
97    This handle is compatible with Vulkan API functions. If the EGL device is
98    not currently associated with a Vulkan device and <attribute> is
99    EGL_VULKAN_INSTANCE_ANGLE, EGL_BAD_ATTRIBUTE is returned, and <value> is
100    left unchanged.
101
102    <attribute> may be EGL_VULKAN_INSTANCE_EXTENSIONS_ANGLE.
103    On success, EGL_TRUE is returned, and a pointer to a null terminated static
104    string array is returned in <value>. The array contains enabled Vulkan
105    instance extensions for the Vulkan device used by the display.
106    If the EGL device is not currently associated with a Vulkan device and
107    <attribute> is EGL_VULKAN_INSTANCE_EXTENSIONS_ANGLE, EGL_BAD_ATTRIBUTE is
108    returned, and <value> is left unchanged.
109
110    <attribute> may be EGL_VULKAN_PHYSICAL_DEVICE_ANGLE.
111    On success, EGL_TRUE is returned, and a valid Vulkan physical device handle
112    VkPhysicalDevice corresponding to the EGL device is returned in <value>.
113    This handle is compatible with Vulkan API functions. If the EGL device is
114    not currently associated with a Vulkan device and <attribute> is
115    EGL_VULKAN_PHYSICAL_DEVICE_ANGLE, EGL_BAD_ATTRIBUTE is returned,
116    and <value> is left unchanged.
117
118    <attribute> may be EGL_VULKAN_DEVICE_ANGLE.
119    On success, EGL_TRUE is returned, and a valid Vulkan device handle VkDevice
120    corresponding to the EGL device is returned in <value>. This handle is
121    compatible with Vulkan API functions. If the EGL device is not currently
122    associated with a Vulkan device and <attribute> is EGL_VULKAN_DEVICE_ANGLE,
123    EGL_BAD_ATTRIBUTE is returned, and <value> is left unchanged.
124
125    <attribute> may be EGL_VULKAN_DEVICE_EXTENSIONS_ANGLE.
126    On success, EGL_TRUE is returned, and a pointer to a null terminated static
127    string array is returned in <value>. The array contains enabled Vulkan
128    device extensions for the Vulkan device used by the display. If the EGL
129    device is not currently associated with a Vulkan device and <attribute> is
130    EGL_VULKAN_DEVICE_EXTENSIONS_ANGLE, EGL_BAD_ATTRIBUTE is returned, and
131    <value> is left unchanged.
132
133    <attribute> may be EGL_VULKAN_FEATURES_ANGLE.
134    On success, EGL_TRUE is returned, and a pointer to a static
135    VkPhysicalDeviceFeatures2KHR struct is returned in <value>. The structure
136    contains enabled Vulkan device features for the Vulkan device used by the
137    display. If the EGL device is not currently associated with a Vulkan device
138    and <attribute> is EGL_VULKAN_FEATURES_ANGLE, EGL_BAD_ATTRIBUTE is returned,
139    and <value> is left unchanged.
140
141    <attribute> may be EGL_VULKAN_QUEUE_ANGLE.
142    On success, EGL_TRUE is returned, and a valid Vulkan device queue handle
143    VkQueue corresponding to the EGL device is returned in <value>. This handle
144    is compatible with Vulkan API functions. If the EGL device is not currently
145    associated with a Vulkan device and <attribute> is EGL_VULKAN_QUEUE_ANGLE,
146    EGL_BAD_ATTRIBUTE is returned, and <value> is left unchanged.
147
148    <attribute> may be EGL_VULKAN_QUEUE_FAMILIY_INDEX_ANGLE.
149    On success, EGL_TRUE is returned, and the Vulkan queue familiy index
150    corresponding to the EGL device is returned in <value>. If the EGL device
151    is not currently associated with a Vulkan device and <attribute> is
152    EGL_VULKAN_QUEUE_FAMILIY_INDEX_ANGLE, EGL_BAD_ATTRIBUTE is returned, and
153    <value> is left unchanged.
154
155    <attribute> may be EGL_VULKAN_GET_INSTANCE_PROC_ADDR.
156    On success, EGL_TRUE is returned, and the vkGetInstanceProcAddr function
157    pointer corresponding to the EGL device is returned in <value>. If the EGL
158    device is not currently associated with a Vulkan device and <attribute> is
159    EGL_VULKAN_GET_INSTANCE_PROC_ADDR, EGL_BAD_ATTRIBUTE is returned, and
160    <value> is left unchanged.
161
162    Add the following after the eglQueryDeviceAttribEXT entry point:
163
164    The Vulkan queue queried via EGL_VULKAN_QUEUE_ANGLE can be locked using
165
166        void eglLockVulkanQueueANGLE(EGLDisplay dpy);
167
168    This function provides exclusive access to the Vulkan queue to the caller,
169    as if an internal mutex that is used to protect the queue is locked.
170    If 'dpy' is not a valid display an EGL_BAD_DISPLAY error is generated.
171    No error is generated if the EGL device is not currently associated with a
172    Vulkan device, in which case the function does nothing.
173    Each call to eglLockVulkanQueueANGLE must be paired with a following
174    eglUnlockVulkanQueueANGLE on the same thread, otherwise behavior is
175    undefined.
176
177        void eglUnlockVulkanQueueANGLE(EGLDisplay dpy);
178
179    This function releases exclusive access to the Vulkan queue that was
180    previously acquired via eglLockVulkanQueueANGLE, as if an internal mutex
181    that is used to protect the queue is unlocked.
182    If 'dpy' is not a valid display an EGL_BAD_DISPLAY error is generated.
183    No error is generated if the EGL device is not currently associated with a
184    Vulkan device, in which case the function does nothing.
185    Each call to eglUnlockVulkanQueueANGLE must be preceeded by a call to
186    eglLockVulkanQueueANGLE on the same thread, otherwise behavior is
187    undefined.
188
189Issues
190
191    None
192
193Revision History
194
195    Version 1, Oct 28, 2021 (Peng Huang)
196        - Initial Draft
197    Version 2, Dec 27, 2024 (Shahbaz Youssefi)
198        - Add entry points for Vulkan queue lock/unlock
199