Branch
Hash :
3226a3df
Author :
Date :
2024-12-13T14:06:55
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 <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Steven Noonan <steven@uplinklabs.net>
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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
Name
ANGLE_platform_angle_vulkan_device_uuid
Name Strings
EGL_ANGLE_platform_angle_vulkan_device_uuid
Contributors
Steven Noonan
Contacts
Steven Noonan <steven@uplinklabs.net>
Status
Draft
Version
Version 1, 2024-12-13
Number
EGL Extension XXX
Extension Type
EGL client extension
Dependencies
This extension requires EGL 1.5 and the ANGLE_platform_angle_vulkan
extension.
Overview
This extension enables developers to specify additional selection criteria
when creating an ANGLE Vulkan context, ensuring that the context is
associated with a particular physical device and driver combination,
providing more precise control over device selection.
New Types
None
New Procedures and Functions
None
New Tokens
Accepted as an attribute name in the <attrib_list> argument of
eglGetPlatformDisplay:
EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE 0x34F0
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE 0x34F1
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE 0x34F2
Additions to the EGL Specification
None
New Behavior
The EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID attribute may be passed to
eglGetPlatformDisplay to specify the device UUID of the desired Vulkan
device for the ANGLE context. The EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID
attribute may be passed to select a device by its driver's VkDriverId
value.
Attributes introduced by this extension must be used in conjunction with
the EGL_PLATFORM_ANGLE_TYPE_ANGLE attribute set to
EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE. If it is not, eglGetPlatformDisplay
will generate an EGL_BAD_ATTRIBUTE error and return EGL_NO_DISPLAY.
The value provided for EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID must be
a valid pointer to a 16-byte Vulkan device UUID, or a NULL pointer
indicating that any device is acceptable. The UUID value should match the
deviceUUID field of VkPhysicalDeviceIDProperties for a VkPhysicalDevice in
the system.
The value provided for EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID must be
a valid pointer to a 16-byte Vulkan driver UUID, or a NULL pointer
indicating that any driver is acceptable. The UUID value should match the
driverUUID field of VkPhysicalDeviceIDProperties for a VkPhysicalDevice in
the system.
The value provided for EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID must be
a VkDriverId value corresponding to the driverID field of the
VkPhysicalDeviceDriverProperties structure for a device in the system.
If no VkPhysicalDevice is found matching all of the provided search
criteria, the implementation may fall back to any other available
VkPhysicalDevice.
Usage Example
// Illustrates using all of the attributes at once
uint8_t deviceUUID[16] = { /* UUID value */ };
uint8_t driverUUID[16] = { /* UUID value */ };
VkDriverId driverId = VK_DRIVER_ID_MESA_HONEYKRISP;
EGLAttrib attribs[] = {
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE,
EGL_PLATFORM_ANGLE_VULKAN_DEVICE_UUID_ANGLE, (EGLAttrib)deviceUUID,
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_UUID_ANGLE, (EGLAttrib)driverUUID,
EGL_PLATFORM_ANGLE_VULKAN_DRIVER_ID_ANGLE, (EGLAttrib)driverId,
EGL_NONE
};
EGLDisplay display =
eglGetPlatformDisplay(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, attribs);
if (display == EGL_NO_DISPLAY) {
// Handle display creation failure
}
Issues
1) Why provide support for specifying all three of device UUID, driver
UUID, and driver ID?
RESOLVED: The goal is to uniquely identify a specific VkPhysicalDevice
within the system, and systems may have multiple graphics drivers (or
even driver versions) which all support using the same underlying
physical device. The combination of device UUID, driver UUID, and driver
ID is currently found to be sufficient to uniquely identify any
particular driver/device combination found in real-world scenarios.
Revision History
Version 1, 2024-07-09 (Steven Noonan)
- Initial draft