aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-02-25 16:59:54 -0700
committerBrian Paul <[email protected]>2015-02-26 08:38:38 -0700
commite09fe389359285dc13abec51f1c61e67972f0235 (patch)
tree26fd4a26905df29d2f6806663b08aeb4f487b4bb
parent2069f2c7fa9d3178d59da4f7e407a598f388477b (diff)
util: add debug_print_bind_flags() debug helper
Reviewed-by: José Fonseca <[email protected]>
-rw-r--r--src/gallium/auxiliary/util/u_debug.c33
-rw-r--r--src/gallium/auxiliary/util/u_debug.h3
2 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index 731cdec1334..f54fc3aa58c 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -737,5 +737,38 @@ debug_print_transfer_flags(const char *msg, unsigned usage)
}
+/**
+ * Print PIPE_BIND_x flags with a message.
+ */
+void
+debug_print_bind_flags(const char *msg, unsigned usage)
+{
+ static const struct debug_named_value names[] = {
+ DEBUG_NAMED_VALUE(PIPE_BIND_DEPTH_STENCIL),
+ DEBUG_NAMED_VALUE(PIPE_BIND_RENDER_TARGET),
+ DEBUG_NAMED_VALUE(PIPE_BIND_BLENDABLE),
+ DEBUG_NAMED_VALUE(PIPE_BIND_SAMPLER_VIEW),
+ DEBUG_NAMED_VALUE(PIPE_BIND_VERTEX_BUFFER),
+ DEBUG_NAMED_VALUE(PIPE_BIND_INDEX_BUFFER),
+ DEBUG_NAMED_VALUE(PIPE_BIND_CONSTANT_BUFFER),
+ DEBUG_NAMED_VALUE(PIPE_BIND_DISPLAY_TARGET),
+ DEBUG_NAMED_VALUE(PIPE_BIND_TRANSFER_WRITE),
+ DEBUG_NAMED_VALUE(PIPE_BIND_TRANSFER_READ),
+ DEBUG_NAMED_VALUE(PIPE_BIND_STREAM_OUTPUT),
+ DEBUG_NAMED_VALUE(PIPE_BIND_CURSOR),
+ DEBUG_NAMED_VALUE(PIPE_BIND_CUSTOM),
+ DEBUG_NAMED_VALUE(PIPE_BIND_GLOBAL),
+ DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_RESOURCE),
+ DEBUG_NAMED_VALUE(PIPE_BIND_COMPUTE_RESOURCE),
+ DEBUG_NAMED_VALUE(PIPE_BIND_COMMAND_ARGS_BUFFER),
+ DEBUG_NAMED_VALUE(PIPE_BIND_SCANOUT),
+ DEBUG_NAMED_VALUE(PIPE_BIND_SHARED),
+ DEBUG_NAMED_VALUE(PIPE_BIND_LINEAR),
+ DEBUG_NAMED_VALUE_END
+ };
+
+ debug_printf("%s: %s\n", msg, debug_dump_flags(names, usage));
+}
+
#endif
diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h
index 4c22fdfb6fa..5706eeb8c0c 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -467,6 +467,9 @@ void debug_dump_float_rgba_bmp(const char *filename,
void
debug_print_transfer_flags(const char *msg, unsigned usage);
+void
+debug_print_bind_flags(const char *msg, unsigned usage);
+
#ifdef __cplusplus
}