|
| 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 | + |
| 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 |
0 commit comments