trace: Dump PIPE_QUERY_* enums.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
José Fonseca 2013-11-27 11:43:54 +00:00
parent eb040bd54a
commit fb5f5b8188
7 changed files with 98 additions and 15 deletions

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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_ */

View File

@ -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())

View File

@ -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);

View File

@ -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;