From 41515b7047434fcec345a2b8ddae316459fca3ba Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 3 Oct 2025 15:14:08 +0200 Subject: [PATCH] tests: Introduce get_llvm_driver_version(). --- tests/d3d12_crosstest.h | 7 ++++++- tests/vulkan_utils.h | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 9a15176f7..e111a214b 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -904,10 +904,15 @@ static inline bool is_mesa_device_with_llvm_ge(ID3D12Device *device, uint32_t ma { VkPhysicalDeviceDriverPropertiesKHR driver_properties; VkPhysicalDeviceProperties device_properties; + uint32_t llvm_major, llvm_minor, llvm_patch; get_driver_properties(device, &device_properties, &driver_properties); + + if (!get_llvm_driver_version(&device_properties, &llvm_major, &llvm_minor, &llvm_patch)) + return false; + return is_mesa_vulkan_driver(&driver_properties) - && compare_version_string_ge(device_properties.deviceName, "LLVM ", 16, 0 ,0); + && compare_versions(llvm_major, llvm_minor, llvm_patch, major, minor, patch) >= 0; } #ifdef __APPLE__ diff --git a/tests/vulkan_utils.h b/tests/vulkan_utils.h index a75742e62..ee832ce93 100644 --- a/tests/vulkan_utils.h +++ b/tests/vulkan_utils.h @@ -523,4 +523,10 @@ static inline bool get_nvidia_driver_version(const VkPhysicalDeviceProperties *d return true; } +static inline bool get_llvm_driver_version(const VkPhysicalDeviceProperties *device_properties, + uint32_t *major, uint32_t *minor, uint32_t *patch) +{ + return find_version_string(device_properties->deviceName, "LLVM ", major, minor, patch); +} + #endif /* __VKD3D_VULKAN_UTILS_H */