mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
vkEnumeratePhysicalDevices: Handle count being too small
Per the Vulkan Spec: "If pPhysicalDeviceCount is less than the number of physical devices available, at most pPhysicalDeviceCount structures will be written, and VK_INCOMPLETE will be returned instead of VK_SUCCESS, to indicate that not all the available physical devices were returned."
This commit is contained in:
committed by
Baldur Karlsson
parent
95ade35dab
commit
7a3ea53b3d
@@ -1502,14 +1502,22 @@ VkResult WrappedVulkan::vkEnumeratePhysicalDevices(VkInstance instance,
|
||||
}
|
||||
}
|
||||
|
||||
if(pPhysicalDeviceCount)
|
||||
*pPhysicalDeviceCount = count;
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
if(pPhysicalDevices)
|
||||
{
|
||||
if(count > *pPhysicalDeviceCount)
|
||||
{
|
||||
count = *pPhysicalDeviceCount;
|
||||
result = VK_INCOMPLETE;
|
||||
}
|
||||
memcpy(pPhysicalDevices, devices, count * sizeof(VkPhysicalDevice));
|
||||
}
|
||||
*pPhysicalDeviceCount = count;
|
||||
|
||||
SAFE_DELETE_ARRAY(devices);
|
||||
|
||||
return VK_SUCCESS;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool WrappedVulkan::SelectGraphicsComputeQueue(const rdcarray<VkQueueFamilyProperties> &queueProps,
|
||||
|
||||
Reference in New Issue
Block a user