From ade22ae1ace051422b972ef057e57aab6fdfa024 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 26 Oct 2018 08:24:49 -0500 Subject: anv/util: Split a vk_errorv helper out of vk_errorf Reviewed-by: Lionel Landwerlin Reviewed-by: Eric Engestrom --- src/intel/vulkan/anv_util.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/intel/vulkan/anv_util.c') diff --git a/src/intel/vulkan/anv_util.c b/src/intel/vulkan/anv_util.c index 8ccb61b35c1..1159ccecc6a 100644 --- a/src/intel/vulkan/anv_util.c +++ b/src/intel/vulkan/anv_util.c @@ -77,20 +77,17 @@ __anv_perf_warn(struct anv_instance *instance, const void *object, } VkResult -__vk_errorf(struct anv_instance *instance, const void *object, - VkDebugReportObjectTypeEXT type, VkResult error, - const char *file, int line, const char *format, ...) +__vk_errorv(struct anv_instance *instance, const void *object, + VkDebugReportObjectTypeEXT type, VkResult error, + const char *file, int line, const char *format, va_list ap) { - va_list ap; char buffer[256]; char report[512]; const char *error_str = vk_Result_to_str(error); if (format) { - va_start(ap, format); vsnprintf(buffer, sizeof(buffer), format, ap); - va_end(ap); snprintf(report, sizeof(report), "%s:%d: %s (%s)", file, line, buffer, error_str); @@ -113,3 +110,17 @@ __vk_errorf(struct anv_instance *instance, const void *object, return error; } + +VkResult +__vk_errorf(struct anv_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, object, type, error, file, line, format, ap); + va_end(ap); + + return error; +} -- cgit v1.2.3