From: José Fonseca Date: Wed, 27 Nov 2013 11:43:54 +0000 (+0000) Subject: trace: Dump PIPE_QUERY_* enums. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb5f5b81883f360dcbbf407a0f6f5606bc0c0495;p=mesa.git trace: Dump PIPE_QUERY_* enums. Reviewed-by: Roland Scheidegger --- diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h index 71750a635d3..58e7dfd8244 100644 --- a/src/gallium/auxiliary/util/u_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -85,6 +85,9 @@ util_dump_tex_mipfilter(unsigned value, boolean shortened); const char * util_dump_tex_filter(unsigned value, boolean shortened); +const char * +util_dump_query_type(unsigned value, boolean shortened); + /* * p_state.h, through a FILE diff --git a/src/gallium/auxiliary/util/u_dump_defines.c b/src/gallium/auxiliary/util/u_dump_defines.c index cc626877382..03fd15d0c44 100644 --- a/src/gallium/auxiliary/util/u_dump_defines.c +++ b/src/gallium/auxiliary/util/u_dump_defines.c @@ -359,3 +359,36 @@ util_dump_tex_filter_short_names[] = { }; DEFINE_UTIL_DUMP_CONTINUOUS(tex_filter) + + +static const char * +util_dump_query_type_names[] = { + "PIPE_QUERY_OCCLUSION_COUNTER", + "PIPE_QUERY_OCCLUSION_PREDICATE", + "PIPE_QUERY_TIMESTAMP", + "PIPE_QUERY_TIMESTAMP_DISJOINT", + "PIPE_QUERY_TIME_ELAPSED", + "PIPE_QUERY_PRIMITIVES_GENERATED", + "PIPE_QUERY_PRIMITIVES_EMITTED", + "PIPE_QUERY_SO_STATISTICS", + "PIPE_QUERY_SO_OVERFLOW_PREDICATE", + "PIPE_QUERY_GPU_FINISHED", + "PIPE_QUERY_PIPELINE_STATISTICS", +}; + +static const char * +util_dump_query_type_short_names[] = { + "occlusion_counter", + "occlusion_predicate", + "timestamp", + "timestamp_disjoint", + "time_elapsed", + "primitives_generated", + "primitives_emitted", + "so_statistics", + "so_overflow_predicate", + "gpu_finished", + "pipeline_statistics", +}; + +DEFINE_UTIL_DUMP_CONTINUOUS(query_type) diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index d9afb0aba7c..4ac7d9b50b2 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -33,6 +33,7 @@ #include "pipe/p_screen.h" #include "tr_dump.h" +#include "tr_dump_defines.h" #include "tr_dump_state.h" #include "tr_public.h" #include "tr_screen.h" @@ -135,7 +136,7 @@ trace_context_create_query(struct pipe_context *_pipe, trace_dump_call_begin("pipe_context", "create_query"); trace_dump_arg(ptr, pipe); - trace_dump_arg(uint, query_type); + trace_dump_arg(query_type, query_type); query = pipe->create_query(pipe, query_type); diff --git a/src/gallium/drivers/trace/tr_dump_defines.h b/src/gallium/drivers/trace/tr_dump_defines.h new file mode 100644 index 00000000000..0c83c2b68f1 --- /dev/null +++ b/src/gallium/drivers/trace/tr_dump_defines.h @@ -0,0 +1,58 @@ +/************************************************************************** + * + * Copyright 2013 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef TR_DUMP_DEFINES_H_ +#define TR_DUMP_DEFINES_H_ + +#include "pipe/p_compiler.h" +#include "util/u_format.h" +#include "util/u_dump.h" +#include "tr_dump.h" + + +static INLINE void +trace_dump_format(enum pipe_format format) +{ + if (!trace_dumping_enabled_locked()) + return; + + trace_dump_enum(util_format_name(format)); +} + + +static INLINE void +trace_dump_query_type(unsigned value) +{ + if (!trace_dumping_enabled_locked()) + return; + + trace_dump_enum(util_dump_query_type(value, FALSE)); +} + + + +#endif /* TR_DUMP_DEFINES_H_ */ diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index c1e5361254d..8f32e9e2779 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -32,18 +32,10 @@ #include "tgsi/tgsi_dump.h" #include "tr_dump.h" +#include "tr_dump_defines.h" #include "tr_dump_state.h" -void trace_dump_format(enum pipe_format format) -{ - if (!trace_dumping_enabled_locked()) - return; - - trace_dump_enum(util_format_name(format) ); -} - - void trace_dump_resource_template(const struct pipe_resource *templat) { if (!trace_dumping_enabled_locked()) diff --git a/src/gallium/drivers/trace/tr_dump_state.h b/src/gallium/drivers/trace/tr_dump_state.h index 6151a0a0214..be87f480fe2 100644 --- a/src/gallium/drivers/trace/tr_dump_state.h +++ b/src/gallium/drivers/trace/tr_dump_state.h @@ -28,13 +28,10 @@ #ifndef TR_DUMP_STATE_H_ #define TR_DUMP_STATE_H_ -#include "pipe/p_format.h" #include "pipe/p_state.h" #include "pipe/p_shader_tokens.h" -void trace_dump_format(enum pipe_format format); - void trace_dump_resource_template(const struct pipe_resource *templat); void trace_dump_box(const struct pipe_box *box); diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 5281ba8b47b..c6745af09f2 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -30,14 +30,13 @@ #include "util/u_simple_list.h" #include "tr_dump.h" +#include "tr_dump_defines.h" #include "tr_dump_state.h" #include "tr_texture.h" #include "tr_context.h" #include "tr_screen.h" #include "tr_public.h" -#include "pipe/p_format.h" - static boolean trace = FALSE;