Vulkan: Update PCI ids

This change cleans up the PCI ids in the Vulkan backend.

- reuses already exising constants.
- add PCI-id for Apple devices.

Pull Request: https://projects.blender.org/blender/blender/pulls/118485
This commit is contained in:
Jeroen Bakker
2024-02-20 10:44:11 +01:00
parent 98bc3369f8
commit df2b5630d8

View File

@@ -215,6 +215,7 @@ constexpr int32_t PCI_ID_NVIDIA = 0x10de;
constexpr int32_t PCI_ID_INTEL = 0x8086;
constexpr int32_t PCI_ID_AMD = 0x1002;
constexpr int32_t PCI_ID_ATI = 0x1022;
constexpr int32_t PCI_ID_APPLE = 0x106b;
eGPUDeviceType VKDevice::device_type() const
{
@@ -232,6 +233,8 @@ eGPUDeviceType VKDevice::device_type() const
case PCI_ID_AMD:
case PCI_ID_ATI:
return GPU_DEVICE_ATI;
case PCI_ID_APPLE:
return GPU_DEVICE_APPLE;
default:
break;
}
@@ -251,12 +254,14 @@ std::string VKDevice::vendor_name() const
/* Below 0x10000 are the PCI vendor IDs (https://pcisig.com/membership/member-companies) */
if (vk_physical_device_properties_.vendorID < 0x10000) {
switch (vk_physical_device_properties_.vendorID) {
case 0x1022:
case PCI_ID_AMD:
return "Advanced Micro Devices";
case 0x10DE:
case PCI_ID_NVIDIA:
return "NVIDIA Corporation";
case 0x8086:
case PCI_ID_INTEL:
return "Intel Corporation";
case PCI_ID_APPLE:
return "Apple";
default:
return std::to_string(vk_physical_device_properties_.vendorID);
}