struct radv_image_view;
struct radv_instance;
-VkResult __vk_errorv(struct radv_instance *instance, VkResult error,
+VkResult __vk_errorv(struct radv_instance *instance, const void *object,
+ VkDebugReportObjectTypeEXT type, VkResult error,
const char *file, int line, const char *format,
va_list args);
-VkResult __vk_errorf(struct radv_instance *instance, VkResult error,
+VkResult __vk_errorf(struct radv_instance *instance, const void *object,
+ VkDebugReportObjectTypeEXT type, VkResult error,
const char *file, int line, const char *format, ...)
- radv_printflike(5, 6);
-
-#define vk_error(instance, error) __vk_errorf(instance, error, __FILE__, __LINE__, NULL);
-#define vk_errorf(instance, error, format, ...) __vk_errorf(instance, error, __FILE__, __LINE__, format, ## __VA_ARGS__);
+ radv_printflike(7, 8);
+
+#define vk_error(instance, error) \
+ __vk_errorf(instance, NULL, \
+ VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, \
+ error, __FILE__, __LINE__, NULL);
+#define vk_errorf(instance, error, format, ...) \
+ __vk_errorf(instance, NULL, \
+ VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, \
+ error, __FILE__, __LINE__, format, ## __VA_ARGS__);
void __radv_finishme(const char *file, int line, const char *format, ...)
radv_printflike(3, 4);
}
VkResult
-__vk_errorv(struct radv_instance *instance, VkResult error, const char *file,
+__vk_errorv(struct radv_instance *instance, const void *object,
+ VkDebugReportObjectTypeEXT type, VkResult error, const char *file,
int line, const char *format, va_list ap)
{
char buffer[256];
error_str);
}
+ if (instance) {
+ vk_debug_report(&instance->debug_report_callbacks,
+ VK_DEBUG_REPORT_ERROR_BIT_EXT, type,
+ (uint64_t)(uintptr_t) object, line, 0, "radv",
+ report);
+ }
+
fprintf(stderr, "%s\n", report);
return error;
}
VkResult
-__vk_errorf(struct radv_instance *instance, VkResult error, const char *file,
+__vk_errorf(struct radv_instance *instance, const void *object,
+ VkDebugReportObjectTypeEXT type, VkResult error, const char *file,
int line, const char *format, ...)
{
va_list ap;
va_start(ap, format);
- __vk_errorv(instance, error, file, line, format, ap);
+ __vk_errorv(instance, object, type, error, file, line, format, ap);
va_end(ap);
return error;