trace: Fix dumping of set_constant_buffer method.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Oct 2012 14:30:19 +0000 (15:30 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Oct 2012 14:30:19 +0000 (15:30 +0100)
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_dump_state.c
src/gallium/drivers/trace/tr_dump_state.h

index dd1b5a00de71c1b3126e9fa266a824478188b819..a1333e5a132291fd594f01f609ca94b3beadb650 100644 (file)
@@ -763,15 +763,7 @@ trace_context_set_constant_buffer(struct pipe_context *_pipe,
    trace_dump_arg(ptr, pipe);
    trace_dump_arg(uint, shader);
    trace_dump_arg(uint, index);
-   if (constant_buffer) {
-      trace_dump_struct_begin("pipe_constant_buffer");
-      trace_dump_member(ptr, constant_buffer, buffer);
-      trace_dump_member(uint, constant_buffer, buffer_offset);
-      trace_dump_member(uint, constant_buffer, buffer_size);
-      trace_dump_struct_end();
-   } else {
-      trace_dump_arg(ptr, constant_buffer);
-   }
+   trace_dump_arg(constant_buffer, constant_buffer);
 
    pipe->set_constant_buffer(pipe, shader, index,
                              constant_buffer ? &cb : NULL);
index 3df6f1220d135445b3c278cbd2337b43b8ac892f..c7e1e8fb0dea5086874b82ddda024e61bf2f5c70 100644 (file)
@@ -661,6 +661,24 @@ void trace_dump_vertex_element(const struct pipe_vertex_element *state)
 }
 
 
+void trace_dump_constant_buffer(const struct pipe_constant_buffer *state)
+{
+   if (!trace_dumping_enabled_locked())
+      return;
+
+   if(!state) {
+      trace_dump_null();
+      return;
+   }
+
+   trace_dump_struct_begin("pipe_constant_buffer");
+   trace_dump_member(ptr, state, buffer);
+   trace_dump_member(uint, state, buffer_offset);
+   trace_dump_member(uint, state, buffer_size);
+   trace_dump_struct_end();
+}
+
+
 void trace_dump_draw_info(const struct pipe_draw_info *state)
 {
    if (!trace_dumping_enabled_locked())
index e17246b21b1340013b5fe28403315ada13cbae59..22beffaae67e3e49c4e00cc1d4a469ed03c6ec8c 100644 (file)
@@ -79,6 +79,8 @@ void trace_dump_index_buffer(const struct pipe_index_buffer *state);
 
 void trace_dump_vertex_element(const struct pipe_vertex_element *state);
 
+void trace_dump_constant_buffer(const struct pipe_constant_buffer *state);
+
 void trace_dump_draw_info(const struct pipe_draw_info *state);
 
 void trace_dump_blit_info(const struct pipe_blit_info *);