vulkan/log: Tweak our handling of a couple error enums
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 13 Oct 2021 16:05:48 +0000 (11:05 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 14 Oct 2021 14:23:45 +0000 (14:23 +0000)
VK_ERROR_INITIALIZATION_FAILED can happen as part of device creation and
isn't really an instance error in that case.
VK_ERROR_EXTENSION_NOT_PRESENT, on the other hand, is always an instance
thing and we should handle it as such.

Fixes: 0cad3beb2a0d ("vulkan/log: Add common vk_error and vk_errorf helpers")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13341>

src/vulkan/util/vk_log.c

index abea4f4..95962d0 100644 (file)
@@ -257,8 +257,8 @@ vk_object_for_error(struct vk_object_base *obj, VkResult error)
 
    switch (error) {
    case VK_ERROR_OUT_OF_HOST_MEMORY:
-   case VK_ERROR_INITIALIZATION_FAILED:
    case VK_ERROR_LAYER_NOT_PRESENT:
+   case VK_ERROR_EXTENSION_NOT_PRESENT:
    case VK_ERROR_UNKNOWN:
       return &vk_object_to_instance(obj)->base;
    case VK_ERROR_FEATURE_NOT_PRESENT: