vulkan/log: Log to instance messages during instance construction

If the instance isn't client-visible yet (i.e. foo_instance_to_handle
hasn't been called), then the instance is still under construction and
we should log using vk_debug_message_instance.  This makes the vk_log*
macros work regardless of whether the instance is fully constructed or
not.

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 14:26:35 -05:00 committed by Marge Bot
parent e884e35077
commit 9067c12d2a

View file

@ -51,6 +51,7 @@ __vk_log_impl(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
} else {
objects = (struct vk_object_base **) objects_or_instance;
instance = objects[0]->device->physical->instance;
assert(instance->base.client_visible);
}
#ifndef DEBUG
@ -98,6 +99,14 @@ __vk_log_impl(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
}
#endif
if (!instance->base.client_visible) {
vk_debug_message_instance(instance, severity, types,
message_idname, 0, message);
ralloc_free(message);
ralloc_free(message_idname);
return;
}
/* If VK_EXT_debug_utils messengers have been set up, form the
* message */
if (!list_is_empty(&instance->debug_utils.callbacks)) {