summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-10-11 15:24:08 +0200
committerThierry Reding <treding@nvidia.com>2018-04-04 16:23:13 +0200
commit384873a960c67a28e27f49495bd124dd550688e9 (patch)
tree978d728f3eea87d6981fce819a036f2ad74c5231
parent89c476bb67cbe9f6ebea9e7969ab0f3be6b06c79 (diff)
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 <treding@nvidia.com>
-rw-r--r--src/gallium/auxiliary/util/u_debug.c12
-rw-r--r--src/gallium/auxiliary/util/u_debug.h2
2 files changed, 14 insertions, 0 deletions
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
}