diff options
author | Thierry Reding <treding@nvidia.com> | 2017-10-11 15:24:08 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2019-08-23 18:07:23 +0200 |
commit | efa99c063203585974cd4b3582884b4c80ab5d20 (patch) | |
tree | 5ee07c2f7b076c011556a9ae60a7d08312514777 | |
parent | 574f91b08e576e8eca6879ca58ddd9242de362a0 (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 9dad0c27c554..6ac84b556a0f 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 0710ce2b7034..8edc75017fe1 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 |