From d3b374ce59c9366ef6fdf4b1e581a1a795bc3401 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 12 May 2015 13:43:36 -0700 Subject: [PATCH] vk/util: Add a anv_finishme function/macro --- src/vulkan/private.h | 8 ++++++++ src/vulkan/util.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 778e2b0704c..0ee0dabc256 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -85,6 +85,14 @@ vk_error(VkResult error) return error; } +void __anv_finishme(const char *file, int line, const char *format, ...); + +/** + * Print a FINISHME message, including its source location. + */ +#define anv_finishme(format, ...) \ + __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); + /** * A dynamically growable, circular buffer. Elements are added at head and * removed from tail. head and tail are free-running uint32_t indices and we diff --git a/src/vulkan/util.c b/src/vulkan/util.c index 847d13b2f55..92f9e407684 100644 --- a/src/vulkan/util.c +++ b/src/vulkan/util.c @@ -30,6 +30,18 @@ #include "private.h" +void +__anv_finishme(const char *file, int line, const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + fprintf(stderr, "%s:%d: FINISHME: ", file, line); + vfprintf(stderr, format, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + int anv_vector_init(struct anv_vector *vector, uint32_t element_size, uint32_t size) { -- 2.30.2