From e4f1fea82118a5e9586fedf88f69d4456f72d2ad Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 21 Sep 2018 10:37:35 -0700 Subject: [PATCH] gallium/util: move debug_print_usage_enum to the u_debug_gallium MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This isn't used in mesa, maybe vmware uses this in a closed source state tracker? Tested-by: Brian Paul Reviewed-by: Marek Olšák --- src/gallium/auxiliary/util/u_debug.c | 19 ------------------- src/gallium/auxiliary/util/u_debug.h | 3 --- src/gallium/auxiliary/util/u_debug_gallium.c | 19 +++++++++++++++++++ src/gallium/auxiliary/util/u_debug_gallium.h | 9 +++++++++ 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index f17cb1b58f5..ece3cf74c18 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -491,23 +491,4 @@ debug_print_bind_flags(const char *msg, unsigned usage) } -/** - * Print PIPE_USAGE_x enum values with a message. - */ -void -debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage) -{ - static const struct debug_named_value names[] = { - DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT), - DEBUG_NAMED_VALUE(PIPE_USAGE_IMMUTABLE), - DEBUG_NAMED_VALUE(PIPE_USAGE_DYNAMIC), - DEBUG_NAMED_VALUE(PIPE_USAGE_STREAM), - DEBUG_NAMED_VALUE(PIPE_USAGE_STAGING), - DEBUG_NAMED_VALUE_END - }; - - debug_printf("%s: %s\n", msg, debug_dump_enum(names, usage)); -} - - #endif diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index 6d1e92b7b97..6cacec6740d 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -467,9 +467,6 @@ debug_print_transfer_flags(const char *msg, unsigned usage); void debug_print_bind_flags(const char *msg, unsigned usage); -void -debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage); - #ifdef __cplusplus } diff --git a/src/gallium/auxiliary/util/u_debug_gallium.c b/src/gallium/auxiliary/util/u_debug_gallium.c index 977e19375ba..389c8f848a5 100644 --- a/src/gallium/auxiliary/util/u_debug_gallium.c +++ b/src/gallium/auxiliary/util/u_debug_gallium.c @@ -39,4 +39,23 @@ debug_print_format(const char *msg, unsigned fmt) debug_printf("%s: %s\n", msg, util_format_name(fmt)); } + +/** + * Print PIPE_USAGE_x enum values with a message. + */ +void +debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage) +{ + static const struct debug_named_value names[] = { + DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT), + DEBUG_NAMED_VALUE(PIPE_USAGE_IMMUTABLE), + DEBUG_NAMED_VALUE(PIPE_USAGE_DYNAMIC), + DEBUG_NAMED_VALUE(PIPE_USAGE_STREAM), + DEBUG_NAMED_VALUE(PIPE_USAGE_STAGING), + DEBUG_NAMED_VALUE_END + }; + + debug_printf("%s: %s\n", msg, debug_dump_enum(names, usage)); +} + #endif diff --git a/src/gallium/auxiliary/util/u_debug_gallium.h b/src/gallium/auxiliary/util/u_debug_gallium.h index 2e05e53c29d..1e725275834 100644 --- a/src/gallium/auxiliary/util/u_debug_gallium.h +++ b/src/gallium/auxiliary/util/u_debug_gallium.h @@ -29,6 +29,8 @@ #ifndef _U_DEBUG_GALLIUM_H_ #define _U_DEBUG_GALLIUM_H_ +#include "pipe/p_defines.h" + #ifdef __cplusplus extern "C" { #endif @@ -39,6 +41,13 @@ void debug_print_format(const char *msg, unsigned fmt); #define debug_print_format(_msg, _fmt) ((void)0) #endif +#ifdef DEBUG + +void +debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage); + +#endif + #ifdef __cplusplus } #endif -- 2.30.2