gallium: add util_dump_query_type and use it in ddebug
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 27 Jul 2017 09:50:41 +0000 (11:50 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 2 Aug 2017 07:46:32 +0000 (09:46 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_dump.h
src/gallium/auxiliary/util/u_dump_defines.c
src/gallium/drivers/ddebug/dd_draw.c

index de7a451f77d75e91933fca0a3214126f46e3d725..8ebdafacdcfd6de3b7fea6e852559843965778b4 100644 (file)
@@ -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
index 098458afb903e0b19f74c425690a11a0823f430a..c6db2de70b6531e45f59417c9a5cccc1db6f610b 100644 (file)
@@ -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));
+}
index 3e34f63034e467a6893964c81f9010ee5f80f233..81a796873f1f4a7ebcaa8c49e7de9d869533cced 100644 (file)
@@ -179,22 +179,12 @@ util_dump_color_union(FILE *f, const union pipe_color_union *color)
            color->ui[0], color->ui[1], color->ui[2], color->ui[3]);
 }
 
-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");