Skip to content

Commit

Permalink
Merge pull request #2994 from GeniusVentures/fix-vulkan-devices
Browse files Browse the repository at this point in the history
Fixed Vulkan devices detection
  • Loading branch information
jxt1234 authored Aug 20, 2024
2 parents d88c469 + 5ec87b6 commit e6753f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/backend/vulkan/component/VulkanDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ VulkanDevice::VulkanDevice(std::shared_ptr<VulkanInstance> instance, const std::
uint32_t gpuCount = 0;
CALL_VK(mInstance->enumeratePhysicalDevices(gpuCount, nullptr));
MNN_ASSERT(0 != gpuCount);
VkPhysicalDevice tmpGpus[1] = {nullptr};
gpuCount = 1;
CALL_VK(mInstance->enumeratePhysicalDevices(gpuCount, tmpGpus));
std::vector<VkPhysicalDevice> tmpGpus(gpuCount);
CALL_VK(mInstance->enumeratePhysicalDevices(gpuCount, tmpGpus.data()));
MNN_ASSERT(nullptr != tmpGpus[0]);
mPhysicalDevice = tmpGpus[0];

Expand Down

0 comments on commit e6753f5

Please sign in to comment.