Skip to content

Commit 1c83476

Browse files
committed
fix: bug
1 parent 26fcb2a commit 1c83476

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

llama/gpuInfo/vulkan-gpu-info.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,17 @@ static bool enumerateVulkanDevices(size_t* total, size_t* used, size_t* unifiedM
5858
}
5959

6060
if (checkSupported != nullptr && checkSupported) {
61-
VkPhysicalDeviceFeatures2 device_features2;
62-
device_features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
63-
device_features2.pNext = nullptr;
64-
device_features2.features = (VkPhysicalDeviceFeatures)physicalDevice.getFeatures();
61+
VkPhysicalDeviceFeatures2 features2 = {};
62+
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
6563

66-
VkPhysicalDeviceVulkan11Features vk11_features;
67-
vk11_features.pNext = nullptr;
68-
vk11_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
69-
device_features2.pNext = &vk11_features;
64+
VkPhysicalDeviceVulkan11Features vk11Features = {};
65+
vk11Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
66+
features2.pNext = &vk11Features;
7067

71-
vkGetPhysicalDeviceFeatures2(physicalDevice, &device_features2);
68+
vkGetPhysicalDeviceFeatures2(physicalDevice, &features2);
69+
VkPhysicalDeviceFeatures2 device_features2;
7270

73-
if (!vk11_features.storageBuffer16BitAccess) {
71+
if (!vk11Features.storageBuffer16BitAccess) {
7472
*checkSupported = false;
7573
}
7674
}

0 commit comments

Comments
 (0)