From df2b5630d883e58d24f94ea98f7bcef0bd1f08b5 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 20 Feb 2024 10:44:11 +0100 Subject: [PATCH] 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 --- source/blender/gpu/vulkan/vk_device.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/gpu/vulkan/vk_device.cc b/source/blender/gpu/vulkan/vk_device.cc index 6d7e1c200ec..a67212b0944 100644 --- a/source/blender/gpu/vulkan/vk_device.cc +++ b/source/blender/gpu/vulkan/vk_device.cc @@ -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); }