summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-27 11:50:41 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-31 18:28:35 +0200
commit57309c52dbd60829c4388dbb88941baedac89ab0 (patch)
tree017caf77d7c1ee523ad26a049a22bd6d5a253494
parent4ab2092fb87d1be6c64cd98ff26e9aa0bfb66a31 (diff)
gallium: add util_dump_query_type and use it in ddebug
-rw-r--r--src/gallium/auxiliary/util/u_dump.h2
-rw-r--r--src/gallium/auxiliary/util/u_dump_defines.c10
-rw-r--r--src/gallium/drivers/ddebug/dd_draw.c12
3 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h
index de7a451f77..8ebdafacdc 100644
--- a/src/gallium/auxiliary/util/u_dump.h
+++ b/src/gallium/auxiliary/util/u_dump.h
@@ -87,6 +87,8 @@ util_str_query_type(unsigned value, boolean shortened);
const char *
util_str_prim_mode(unsigned value, boolean shortened);
+void
+util_dump_query_type(FILE *stream, unsigned value);
/*
* 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 098458afb9..c6db2de70b 100644
--- a/src/gallium/auxiliary/util/u_dump_defines.c
+++ b/src/gallium/auxiliary/util/u_dump_defines.c
@@ -434,3 +434,13 @@ util_prim_mode_short_names[] = {
};
DEFINE_UTIL_STR_CONTINUOUS(prim_mode)
+
+void
+util_dump_query_type(FILE *stream, unsigned value)
+{
+ if (value >= PIPE_QUERY_DRIVER_SPECIFIC)
+ fprintf(stream, "PIPE_QUERY_DRIVER_SPECIFIC + %i",
+ value - PIPE_QUERY_DRIVER_SPECIFIC);
+ else
+ fprintf(stream, "%s", util_str_query_type(value, false));
+}
diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c
index 3e34f63034..81a796873f 100644
--- a/src/gallium/drivers/ddebug/dd_draw.c
+++ b/src/gallium/drivers/ddebug/dd_draw.c
@@ -180,21 +180,11 @@ util_dump_color_union(FILE *f, const union pipe_color_union *color)
}
static void
-util_dump_query(FILE *f, struct dd_query *query)
-{
- if (query->type >= PIPE_QUERY_DRIVER_SPECIFIC)
- fprintf(f, "PIPE_QUERY_DRIVER_SPECIFIC + %i",
- query->type - PIPE_QUERY_DRIVER_SPECIFIC);
- else
- fprintf(f, "%s", util_str_query_type(query->type, false));
-}
-
-static void
dd_dump_render_condition(struct dd_draw_state *dstate, FILE *f)
{
if (dstate->render_cond.query) {
fprintf(f, "render condition:\n");
- DUMP_M(query, &dstate->render_cond, query);
+ DUMP_M(query_type, &dstate->render_cond, query->type);
DUMP_M(uint, &dstate->render_cond, condition);
DUMP_M(uint, &dstate->render_cond, mode);
fprintf(f, "\n");