util: add helper function util_dump_draw_info
authorMarek Olšák <maraeo@gmail.com>
Tue, 3 Jan 2012 18:18:45 +0000 (19:18 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 5 Jan 2012 17:29:11 +0000 (18:29 +0100)
src/gallium/auxiliary/util/u_dump.h
src/gallium/auxiliary/util/u_dump_state.c

index 3890b3bddcace11b70f36d2f97df6fabb5abc8be..87d84bead97b7fc9bdc0943cc110f39440233924 100644 (file)
@@ -162,6 +162,8 @@ void
 util_dump_vertex_element(FILE *stream,
                          const struct pipe_vertex_element *state);
 
+void
+util_dump_draw_info(FILE *stream, const struct pipe_draw_info *state);
 
 /* FIXME: Move the other debug_dump_xxx functions out of u_debug.h into here. */
 
index 91f4aae69ef43f19397b4cdfd44a1db88642c0b5..e44c6194c77a3bf28b047d15e3fcd67bb0bf14c0 100644 (file)
@@ -725,3 +725,35 @@ util_dump_vertex_element(FILE *stream, const struct pipe_vertex_element *state)
 
    util_dump_struct_end(stream);
 }
+
+
+void
+util_dump_draw_info(FILE *stream, const struct pipe_draw_info *state)
+{
+   if(!state) {
+      util_dump_null(stream);
+      return;
+   }
+
+   util_dump_struct_begin(stream, "pipe_draw_info");
+
+   util_dump_member(stream, bool, state, indexed);
+
+   util_dump_member(stream, uint, state, mode);
+   util_dump_member(stream, uint, state, start);
+   util_dump_member(stream, uint, state, count);
+
+   util_dump_member(stream, uint, state, start_instance);
+   util_dump_member(stream, uint, state, instance_count);
+
+   util_dump_member(stream, int,  state, index_bias);
+   util_dump_member(stream, uint, state, min_index);
+   util_dump_member(stream, uint, state, max_index);
+
+   util_dump_member(stream, bool, state, primitive_restart);
+   util_dump_member(stream, uint, state, restart_index);
+
+   util_dump_member(stream, ptr, state, count_from_stream_output);
+
+   util_dump_struct_end(stream);
+}