summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_debug.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-02-27 13:00:50 -0700
committerBrian Paul <brianp@vmware.com>2015-02-27 15:22:04 -0700
commit943784bbcd3e44254fd5e9b27b917b49c37206fb (patch)
tree24e892c70c17d28ae7dd14e4ac9ca60071334356 /src/gallium/auxiliary/util/u_debug.c
parentb14cec0b8e98195679eab5afbdba3bb47badccf2 (diff)
downloadexternal_mesa3d-943784bbcd3e44254fd5e9b27b917b49c37206fb.zip
external_mesa3d-943784bbcd3e44254fd5e9b27b917b49c37206fb.tar.gz
external_mesa3d-943784bbcd3e44254fd5e9b27b917b49c37206fb.tar.bz2
gallium/util: add debug_print_usage_enum() debug helper
Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug.c')
-rw-r--r--src/gallium/auxiliary/util/u_debug.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index f54fc3a..2d2d049 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -771,4 +771,23 @@ debug_print_bind_flags(const char *msg, unsigned usage)
}
+/**
+ * Print PIPE_USAGE_x enum values with a message.
+ */
+void
+debug_print_usage_enum(const char *msg, unsigned usage)
+{
+ static const struct debug_named_value names[] = {
+ DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT),
+ DEBUG_NAMED_VALUE(PIPE_USAGE_IMMUTABLE),
+ DEBUG_NAMED_VALUE(PIPE_USAGE_DYNAMIC),
+ DEBUG_NAMED_VALUE(PIPE_USAGE_STREAM),
+ DEBUG_NAMED_VALUE(PIPE_USAGE_STAGING),
+ DEBUG_NAMED_VALUE_END
+ };
+
+ debug_printf("%s: %s\n", msg, debug_dump_enum(names, usage));
+}
+
+
#endif