From 384873a960c67a28e27f49495bd124dd550688e9 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 11 Oct 2017 15:24:08 +0200 Subject: gallium: Add helper to print flush flags This can be useful for debugging purposes because the flush flag names are easier to read for humans than the numerical values. Signed-off-by: Thierry Reding --- src/gallium/auxiliary/util/u_debug.c | 12 ++++++++++++ src/gallium/auxiliary/util/u_debug.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index edfb27fc6f6..b8e6f7eda16 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -545,5 +545,17 @@ debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage) debug_printf("%s: %s\n", msg, debug_dump_enum(names, usage)); } +void +debug_print_flush_flags(const char *msg, enum pipe_flush_flags flags) +{ + static const struct debug_named_value names[] = { + DEBUG_NAMED_VALUE(PIPE_FLUSH_END_OF_FRAME), + DEBUG_NAMED_VALUE(PIPE_FLUSH_DEFERRED), + DEBUG_NAMED_VALUE(PIPE_FLUSH_FENCE_FD), + DEBUG_NAMED_VALUE_END + }; + + debug_printf("%s: %s\n", msg, debug_dump_flags(names, flags)); +} #endif diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index d2ea89f59c1..605999520a1 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -475,6 +475,8 @@ debug_print_bind_flags(const char *msg, unsigned usage); void debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage); +void +debug_print_flush_flags(const char *msg, enum pipe_flush_flags flags); #ifdef __cplusplus } -- cgit v1.2.3