2 * Copyright © 2019 Raspberry Pi
4 * based in part on anv driver which is:
5 * Copyright © 2015 Intel Corporation
7 * based in part on radv driver which is:
8 * Copyright © 2016 Red Hat.
9 * Copyright © 2016 Bas Nieuwenhuizen
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice (including the next
19 * paragraph) shall be included in all copies or substantial portions of the
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
38 #include "vk_enum_to_str.h"
39 #include "libresoc_private.h"
41 /** Log an error message. */
42 void libresoc_printflike(1, 2)
43 libresoc_loge(const char *format
, ...)
48 libresoc_loge_v(format
, va
);
52 /** \see libresoc_loge() */
54 libresoc_loge_v(const char *format
, va_list va
)
56 fprintf(stderr
, "vk: error: ");
57 vfprintf(stderr
, format
, va
);
58 fprintf(stderr
, "\n");
62 __vk_errorf(struct libresoc_instance
*instance
, VkResult error
, const char *file
,
63 int line
, const char *format
, ...)
68 const char *error_str
= vk_Result_to_str(error
);
76 vsnprintf(buffer
, sizeof(buffer
), format
, ap
);
79 fprintf(stderr
, "%s:%d: %s (%s)\n", file
, line
, buffer
, error_str
);
81 fprintf(stderr
, "%s:%d: %s\n", file
, line
, error_str
);