Skip to content

Commit 468e2a8

Browse files
m154k1kasper93
authored andcommitted
vulkan/context: add driver name to --vulkan-device=help
Some platforms (like macOS) may have multiple Vulkan drivers installed, so the device list can contain devices with the same name. Adding driver name to the list of devices can help with identification.
1 parent 4ecf729 commit 468e2a8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

video/out/vulkan/context.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ static inline OPT_STRING_VALIDATE_FUNC(vk_validate_dev)
6969
bool is_uuid = av_uuid_parse(*value, param_uuid) == 0;
7070

7171
for (int i = 0; i < num; i++) {
72+
VkPhysicalDeviceDriverProperties driver_prop = { 0 };
73+
driver_prop.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
74+
7275
VkPhysicalDeviceIDPropertiesKHR id_prop = { 0 };
7376
id_prop.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR;
77+
id_prop.pNext = &driver_prop;
7478

7579
VkPhysicalDeviceProperties2KHR prop2 = { 0 };
7680
prop2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
@@ -83,9 +87,10 @@ static inline OPT_STRING_VALIDATE_FUNC(vk_validate_dev)
8387
if (help) {
8488
char device_uuid[37];
8589
av_uuid_unparse(id_prop.deviceUUID, device_uuid);
86-
mp_info(log, " '%s' (GPU %d, PCI ID %x:%x, UUID %s)\n",
90+
mp_info(log, " '%s' (GPU %d, PCI ID %x:%x, UUID %s, Driver %s)\n",
8791
prop->deviceName, i, (unsigned)prop->vendorID,
88-
(unsigned)prop->deviceID, device_uuid);
92+
(unsigned)prop->deviceID, device_uuid,
93+
driver_prop.driverName);
8994
} else if (bstr_equals0(param, prop->deviceName)) {
9095
ret = 0;
9196
goto done;

0 commit comments

Comments
 (0)