From 5b4b41bbd4553947cf9d4ac53885323936be0740 Mon Sep 17 00:00:00 2001 From: Bob Cao Date: Sun, 27 Mar 2022 22:00:23 -0700 Subject: [PATCH] [vulkan] Fixes the string comparison when querying extensions (#4638) * Update vulkan_device_creator.cpp * Update vulkan_device_creator.cpp --- taichi/backends/vulkan/vulkan_device_creator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/taichi/backends/vulkan/vulkan_device_creator.cpp b/taichi/backends/vulkan/vulkan_device_creator.cpp index 899338465163c..c4285a5cc71e2 100644 --- a/taichi/backends/vulkan/vulkan_device_creator.cpp +++ b/taichi/backends/vulkan/vulkan_device_creator.cpp @@ -590,8 +590,9 @@ void VulkanDeviceCreator::create_logical_device() { VkPhysicalDeviceFeatures2KHR features2{}; features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; -#define CHECK_EXTENSION(ext) \ - std::find(enabled_extensions.begin(), enabled_extensions.end(), ext) != \ +#define CHECK_EXTENSION(ext) \ + std::find_if(enabled_extensions.begin(), enabled_extensions.end(), \ + [=](const char *o) { return strcmp(ext, o) == 0; }) != \ enabled_extensions.end() #define CHECK_VERSION(major, minor) \