mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-06 07:06:10 +00:00
a/vk: Add vk_print_result helper
This commit is contained in:
parent
9d92720960
commit
6316bf39a9
|
@ -624,6 +624,15 @@ vk_name_object(struct vk_bundle *vk, VkDebugReportObjectTypeEXT object_type, uin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Print the result of a function, info level if ret == `VK_SUCCESS` and error
|
||||||
|
* level otherwise. Also prints file and line.
|
||||||
|
*
|
||||||
|
* @ingroup aux_vk
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
vk_print_result(struct vk_bundle *vk, VkResult ret, const char *fun, const char *file, int line);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Print device information to the logger at the given logging level,
|
* Print device information to the logger at the given logging level,
|
||||||
* if the vk_bundle has that level enabled.
|
* if the vk_bundle has that level enabled.
|
||||||
|
|
|
@ -45,6 +45,16 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
vk_print_result(struct vk_bundle *vk, VkResult ret, const char *fun, const char *file, int line)
|
||||||
|
{
|
||||||
|
if (ret == VK_SUCCESS) {
|
||||||
|
VK_INFO(vk, "%s: %s [%s:%d]", fun, vk_result_string(ret), file, line);
|
||||||
|
} else {
|
||||||
|
VK_ERROR(vk, "%s failed: %s [%s:%d]", fun, vk_result_string(ret), file, line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vk_print_device_info(struct vk_bundle *vk,
|
vk_print_device_info(struct vk_bundle *vk,
|
||||||
enum u_logging_level log_level,
|
enum u_logging_level log_level,
|
||||||
|
|
Loading…
Reference in a new issue