summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-02-23 08:57:32 -0700
committerBrian Paul <[email protected]>2015-02-23 10:02:39 -0700
commitf1c67e37e66adfedb0ff944868d62918979349da (patch)
tree420a93f50b5556482c8ab1b7d6fc65dd74e34ae6 /src/gallium
parent0bfe21e8e0bf6c80d46e82b7b8382e75881f2d64 (diff)
util: rewrite debug_print_transfer_flags() using debug_dump_flags()
Add add missing PIPE_TRANSFER_PERSISTENT, PIPE_TRANSFER_COHERENT flags. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_debug.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index d79f31ea947..169295fe16f 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -722,36 +722,21 @@ error1:
void
debug_print_transfer_flags(const char *msg, unsigned usage)
{
-#define FLAG(x) { x, #x }
- static const struct {
- unsigned bit;
- const char *name;
- } flags[] = {
- FLAG(PIPE_TRANSFER_READ),
- FLAG(PIPE_TRANSFER_WRITE),
- FLAG(PIPE_TRANSFER_MAP_DIRECTLY),
- FLAG(PIPE_TRANSFER_DISCARD_RANGE),
- FLAG(PIPE_TRANSFER_DONTBLOCK),
- FLAG(PIPE_TRANSFER_UNSYNCHRONIZED),
- FLAG(PIPE_TRANSFER_FLUSH_EXPLICIT),
- FLAG(PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE)
+ static const struct debug_named_value names[] = {
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_READ),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_WRITE),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_MAP_DIRECTLY),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_DISCARD_RANGE),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_DONTBLOCK),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_UNSYNCHRONIZED),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_FLUSH_EXPLICIT),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_PERSISTENT),
+ DEBUG_NAMED_VALUE(PIPE_TRANSFER_COHERENT),
+ DEBUG_NAMED_VALUE_END
};
- unsigned i;
-
- debug_printf("%s ", msg);
-
- for (i = 0; i < Elements(flags); i++) {
- if (usage & flags[i].bit) {
- debug_printf("%s", flags[i].name);
- usage &= ~flags[i].bit;
- if (usage) {
- debug_printf(" | ");
- }
- }
- }
- debug_printf("\n");
-#undef FLAG
+ debug_printf("%s: %s\n", msg, debug_dump_flags(names, usage));
}