vulkan/device: Use vk_error

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>
This commit is contained in:
Jason Ekstrand 2021-09-24 16:04:51 -05:00 committed by Marge Bot
parent 330f4c9bc9
commit 5b42f1a374
3 changed files with 12 additions and 7 deletions

View File

@ -2933,10 +2933,8 @@ VkResult anv_CreateDevice(
result = vk_device_init(&device->vk, &physical_device->vk,
&dispatch_table, pCreateInfo, pAllocator);
if (result != VK_SUCCESS) {
vk_error(physical_device, result);
if (result != VK_SUCCESS)
goto fail_alloc;
}
if (INTEL_DEBUG & DEBUG_BATCH) {
const unsigned decode_flags =

View File

@ -980,7 +980,7 @@ panvk_CreateDevice(VkPhysicalDevice physicalDevice,
pCreateInfo, pAllocator);
if (result != VK_SUCCESS) {
vk_free(&device->vk.alloc, device);
return vk_errorf(physical_device->instance, result, "vk_device_init failed");
return result;
}
device->instance = physical_device->instance;

View File

@ -25,6 +25,7 @@
#include "vk_common_entrypoints.h"
#include "vk_instance.h"
#include "vk_log.h"
#include "vk_physical_device.h"
#include "vk_queue.h"
#include "vk_util.h"
@ -62,14 +63,20 @@ vk_device_init(struct vk_device *device,
}
if (idx >= VK_DEVICE_EXTENSION_COUNT)
return VK_ERROR_EXTENSION_NOT_PRESENT;
return vk_errorf(physical_device, VK_ERROR_EXTENSION_NOT_PRESENT,
"%s not supported",
pCreateInfo->ppEnabledExtensionNames[i]);
if (!physical_device->supported_extensions.extensions[idx])
return VK_ERROR_EXTENSION_NOT_PRESENT;
return vk_errorf(physical_device, VK_ERROR_EXTENSION_NOT_PRESENT,
"%s not supported",
pCreateInfo->ppEnabledExtensionNames[i]);
#ifdef ANDROID
if (!vk_android_allowed_device_extensions.extensions[idx])
return VK_ERROR_EXTENSION_NOT_PRESENT;
return vk_errorf(physical_device, VK_ERROR_EXTENSION_NOT_PRESENT,
"%s not supported",
pCreateInfo->ppEnabledExtensionNames[i]);
#endif
device->enabled_extensions.extensions[idx] = true;