Skip to content

Commit 3226a3d

Browse files
tychoAngle LUCI CQ
authored andcommitted
Reland: vulkan: add EGL_ANGLE_platform_angle_vulkan_device_uuid
Implement the ability to select a specific device and driver combination through a few new selection criteria: VkPhysicalDeviceIDProperties::deviceUUID VkPhysicalDeviceIDProperties::driverUUID VkPhysicalDeviceDriverProperties::driverID Earlier version had problems due to a test build issue. Per syoussefi@, going to rework the test into a separate CL so that we get the core change merged. Bug: angleproject:351866412 Change-Id: I0a3f4f1a2154a06bf6286a037c9ad4834ef4dda2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6165286 Reviewed-by: Yuly Novikov <[email protected]> Commit-Queue: Yuly Novikov <[email protected]> Reviewed-by: Shahbaz Youssefi <[email protected]> Auto-Submit: Steven Noonan <[email protected]>
1 parent 7f46db8 commit 3226a3d

21 files changed

+334
-65
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
Name
2+
3+
ANGLE_platform_angle_vulkan_device_uuid
4+
5+
Name Strings
6+
7+
EGL_ANGLE_platform_angle_vulkan_device_uuid
8+
9+
Contributors
10+
11+
Steven Noonan
12+
13+
Contacts
14+
15+
Steven Noonan <[email protected]>
16+
17+
Status
18+
19+
Draft
20+
21+
Version
22+
23+
Version 1, 2024-12-13
24+
25+
Number
26+
27+
EGL Extension XXX
28+
29+
Extension Type
30+
31+
EGL client extension
32+
33+
Dependencies
34+
35+
This extension requires EGL 1.5 and the ANGLE_platform_angle_vulkan
36+
extension.
37+
38+
Overview
39+
40+
This extension enables developers to specify additional selection criteria
41+
when creating an ANGLE Vulkan context, ensuring that the context is
42+
associated with a particular physical device and driver combination,
43+
providing more precise control over device selection.
44+
45+
New Types
46+
47+
None
48+
49+
New Procedures and Functions
50+
51+
None
52+
53+
New Tokens
54+
55+
Accepted as an attribute name in the <attrib_list> argument of
56+
eglGetPlatformDisplay:
57+
58+
EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE 0x34F0
59+
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE 0x34F1
60+
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE 0x34F2
61+
62+
Additions to the EGL Specification
63+
64+
None
65+
66+
New Behavior
67+
68+
The EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID attribute may be passed to
69+
eglGetPlatformDisplay to specify the device UUID of the desired Vulkan
70+
device for the ANGLE context. The EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID
71+
attribute may be passed to select a device by its driver's VkDriverId
72+
value.
73+
74+
Attributes introduced by this extension must be used in conjunction with
75+
the EGL_PLATFORM_ANGLE_TYPE_ANGLE attribute set to
76+
EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE. If it is not, eglGetPlatformDisplay
77+
will generate an EGL_BAD_ATTRIBUTE error and return EGL_NO_DISPLAY.
78+
79+
The value provided for EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID must be
80+
a valid pointer to a 16-byte Vulkan device UUID, or a NULL pointer
81+
indicating that any device is acceptable. The UUID value should match the
82+
deviceUUID field of VkPhysicalDeviceIDProperties for a VkPhysicalDevice in
83+
the system.
84+
85+
The value provided for EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID must be
86+
a valid pointer to a 16-byte Vulkan driver UUID, or a NULL pointer
87+
indicating that any driver is acceptable. The UUID value should match the
88+
driverUUID field of VkPhysicalDeviceIDProperties for a VkPhysicalDevice in
89+
the system.
90+
91+
The value provided for EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID must be
92+
a VkDriverId value corresponding to the driverID field of the
93+
VkPhysicalDeviceDriverProperties structure for a device in the system.
94+
95+
If no VkPhysicalDevice is found matching all of the provided search
96+
criteria, the implementation may fall back to any other available
97+
VkPhysicalDevice.
98+
99+
Usage Example
100+
101+
// Illustrates using all of the attributes at once
102+
uint8_t deviceUUID[16] = { /* UUID value */ };
103+
uint8_t driverUUID[16] = { /* UUID value */ };
104+
VkDriverId driverId = VK_DRIVER_ID_MESA_HONEYKRISP;
105+
106+
EGLAttrib attribs[] = {
107+
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE,
108+
EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE, (EGLAttrib)deviceUUID,
109+
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE, (EGLAttrib)driverUUID,
110+
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE, (EGLAttrib)driverId,
111+
EGL_NONE
112+
};
113+
114+
EGLDisplay display =
115+
eglGetPlatformDisplay(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attribs);
116+
117+
if (display == EGL_NO_DISPLAY) {
118+
// Handle display creation failure
119+
}
120+
121+
Issues
122+
123+
1) Why provide support for specifying all three of device UUID, driver
124+
UUID, and driver ID?
125+
126+
RESOLVED: The goal is to uniquely identify a specific VkPhysicalDevice
127+
within the system, and systems may have multiple graphics drivers (or
128+
even driver versions) which all support using the same underlying
129+
physical device. The combination of device UUID, driver UUID, and driver
130+
ID is currently found to be sufficient to uniquely identify any
131+
particular driver/device combination found in real-world scenarios.
132+
133+
Revision History
134+
135+
Version 1, 2024-07-09 (Steven Noonan)
136+
- Initial draft

include/EGL/eglext_angle.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@
105105
#define EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE 0x34A5
106106
#endif /* EGL_ANGLE_platform_angle_vulkan */
107107

108+
#ifndef EGL_ANGLE_platform_angle_vulkan_device_uuid
109+
#define EGL_ANGLE_platform_angle_vulkan_device_uuid 1
110+
#define EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE 0x34F0
111+
#define EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE 0x34F1
112+
#define EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE 0x34F2
113+
#endif /* EGL_ANGLE_platform_angle_vulkan_device_uuid */
114+
108115
#ifndef EGL_ANGLE_platform_angle_metal
109116
#define EGL_ANGLE_platform_angle_metal 1
110117
#define EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE 0x3489

scripts/code_generation_hashes/Extension_files.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"doc/ExtensionSupport.md":
33
"9fedcc1a67af79d93c2da1105c9bada6",
44
"scripts/egl_angle_ext.xml":
5-
"0a03416ded6719c24d8198f58f8ad0c6",
5+
"63ccd7de2f7fde008f209087eba07a57",
66
"scripts/extension_data/intel_630_linux.json":
77
"3b86832de6a7095f4617e273cba6d45e",
88
"scripts/extension_data/intel_630_win10.json":

scripts/code_generation_hashes/GL_EGL_WGL_loader.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"0a03416ded6719c24d8198f58f8ad0c6",
3+
"63ccd7de2f7fde008f209087eba07a57",
44
"scripts/generate_loader.py":
55
"93c78a8d11323fa311fed5118fbcf083",
66
"scripts/gl_angle_ext.xml":

scripts/code_generation_hashes/GL_EGL_entry_points.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"0a03416ded6719c24d8198f58f8ad0c6",
3+
"63ccd7de2f7fde008f209087eba07a57",
44
"scripts/entry_point_packed_egl_enums.json":
55
"a72ae855c6b403912103b519139951a1",
66
"scripts/entry_point_packed_gl_enums.json":

scripts/code_generation_hashes/interpreter_utils.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"0a03416ded6719c24d8198f58f8ad0c6",
3+
"63ccd7de2f7fde008f209087eba07a57",
44
"scripts/gen_interpreter_utils.py":
55
"10ba16ee78604763fc883525dd275de8",
66
"scripts/gl_angle_ext.xml":

scripts/code_generation_hashes/proc_table.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"0a03416ded6719c24d8198f58f8ad0c6",
3+
"63ccd7de2f7fde008f209087eba07a57",
44
"scripts/gen_proc_table.py":
55
"240b4a4f4c9e9592c712cfbbdc6d4d35",
66
"scripts/gl_angle_ext.xml":

scripts/egl_angle_ext.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,13 @@
472472
<enum name="EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE"/>
473473
</require>
474474
</extension>
475+
<extension name="EGL_ANGLE_platform_angle_vulkan_device_uuid" supported="egl">
476+
<require>
477+
<enum name="EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE"/>
478+
<enum name="EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE"/>
479+
<enum name="EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE"/>
480+
</require>
481+
</extension>
475482
<extension name="EGL_ANGLE_robust_resource_initialization" supported="egl">
476483
<require>
477484
<enum name="EGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE"/>
@@ -662,6 +669,11 @@
662669
<enum value="0x34DE" name="EGL_SYNC_GLOBAL_FENCE_ANGLE"/>
663670
<enum value="0x34DF" name="EGL_PLATFORM_ANGLE_TYPE_WEBGPU_ANGLE"/>
664671
</enums>
672+
<enums namespace="EGL" start="0x34F0" end="0x34FF" vendor="ANGLE">
673+
<enum value="0x34F0" name="EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE"/>
674+
<enum value="0x34F1" name="EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE"/>
675+
<enum value="0x34F2" name="EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE"/>
676+
</enums>
665677
<enums namespace="EGL" vendor="ANGLE">
666678
<enum value="0x0001" name="EGL_LOW_POWER_ANGLE"/>
667679
<enum value="0x0002" name="EGL_HIGH_POWER_ANGLE"/>

0 commit comments

Comments
 (0)