diff options
author | Thierry Reding <treding@nvidia.com> | 2017-10-11 15:24:08 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2019-12-04 12:00:10 +0100 |
commit | 391f14fdd2878f2a4d253f4713b91138e74f7314 (patch) | |
tree | e3b78c72b21c4cb0a0f59bb8cc095a0b3ecb67c0 | |
parent | d7291ac5047591b42b59de56aa22405087a2cc68 (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_gallium.c | 13 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_gallium.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.c b/src/gallium/auxiliary/util/u_debug_gallium.c index 63a1e69c0d4..48021e33f83 100644 --- a/src/gallium/auxiliary/util/u_debug_gallium.c +++ b/src/gallium/auxiliary/util/u_debug_gallium.c @@ -104,4 +104,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_gallium.h b/src/gallium/auxiliary/util/u_debug_gallium.h index 0710ce2b703..8edc75017fe 100644 --- a/src/gallium/auxiliary/util/u_debug_gallium.h +++ b/src/gallium/auxiliary/util/u_debug_gallium.h @@ -58,6 +58,9 @@ 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); + #endif #ifdef __cplusplus |