mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 12:40:23 +01:00
zink: check for error when calling vkEnumeratePhysicalDevices
It seems it's possible for Lavapipe to fail to enumerate the physical devices, so let's handle that and fail all the way up here. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7881>
This commit is contained in:
parent
cc8613c8d5
commit
6b38b1ccaf
1 changed files with 6 additions and 2 deletions
|
|
@ -710,11 +710,15 @@ choose_pdev(const VkInstance instance)
|
|||
{
|
||||
uint32_t i, pdev_count;
|
||||
VkPhysicalDevice *pdevs, pdev = NULL;
|
||||
vkEnumeratePhysicalDevices(instance, &pdev_count, NULL);
|
||||
VkResult result = vkEnumeratePhysicalDevices(instance, &pdev_count, NULL);
|
||||
if (result != VK_SUCCESS)
|
||||
return VK_NULL_HANDLE;
|
||||
|
||||
assert(pdev_count > 0);
|
||||
|
||||
pdevs = malloc(sizeof(*pdevs) * pdev_count);
|
||||
vkEnumeratePhysicalDevices(instance, &pdev_count, pdevs);
|
||||
result = vkEnumeratePhysicalDevices(instance, &pdev_count, pdevs);
|
||||
assert(result == VK_SUCCESS);
|
||||
assert(pdev_count > 0);
|
||||
|
||||
for (i = 0; i < pdev_count; ++i) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue