trace: Don't write state objects to file if dumping is not set
authorJakob Bornecrantz <jakob@vmware.com>
Sun, 14 Jun 2009 04:01:24 +0000 (06:01 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Sun, 14 Jun 2009 04:07:50 +0000 (06:07 +0200)
src/gallium/drivers/trace/tr_dump_state.c

index 23a2473b5744b854ef3f1f92bac6cb29c419bccb..f9a24b611b5a4e07c5e9f3a0b7e4de624af4c865 100644 (file)
 
 void trace_dump_format(enum pipe_format format)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    trace_dump_enum(pf_name(format) );
 }
 
 
 void trace_dump_block(const struct pipe_format_block *block)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    trace_dump_struct_begin("pipe_format_block");
    trace_dump_member(uint, block, size);
    trace_dump_member(uint, block, width);
@@ -52,6 +58,9 @@ void trace_dump_block(const struct pipe_format_block *block)
 
 static void trace_dump_reference(const struct pipe_reference *reference)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    trace_dump_struct_begin("pipe_reference");
    trace_dump_member(int, &reference->count, count);
    trace_dump_struct_end();
@@ -60,6 +69,9 @@ static void trace_dump_reference(const struct pipe_reference *reference)
 
 void trace_dump_template(const struct pipe_texture *templat)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!templat) {
       trace_dump_null();
       return;
@@ -95,6 +107,9 @@ void trace_dump_template(const struct pipe_texture *templat)
 
 void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -141,6 +156,9 @@ void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
 
 void trace_dump_poly_stipple(const struct pipe_poly_stipple *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -160,6 +178,9 @@ void trace_dump_poly_stipple(const struct pipe_poly_stipple *state)
 
 void trace_dump_viewport_state(const struct pipe_viewport_state *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -176,6 +197,9 @@ void trace_dump_viewport_state(const struct pipe_viewport_state *state)
 
 void trace_dump_scissor_state(const struct pipe_scissor_state *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -196,6 +220,9 @@ void trace_dump_clip_state(const struct pipe_clip_state *state)
 {
    unsigned i;
 
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -221,6 +248,9 @@ void trace_dump_clip_state(const struct pipe_clip_state *state)
 
 void trace_dump_constant_buffer(const struct pipe_constant_buffer *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -238,6 +268,9 @@ void trace_dump_shader_state(const struct pipe_shader_state *state)
 {
    static char str[8192];
 
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -259,6 +292,9 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_
 {
    unsigned i;
 
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -307,6 +343,9 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_
 
 void trace_dump_blend_state(const struct pipe_blend_state *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -336,6 +375,9 @@ void trace_dump_blend_state(const struct pipe_blend_state *state)
 
 void trace_dump_blend_color(const struct pipe_blend_color *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -351,6 +393,9 @@ void trace_dump_blend_color(const struct pipe_blend_color *state)
 
 void trace_dump_framebuffer_state(const struct pipe_framebuffer_state *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    trace_dump_struct_begin("pipe_framebuffer_state");
 
    trace_dump_member(uint, state, width);
@@ -365,6 +410,9 @@ void trace_dump_framebuffer_state(const struct pipe_framebuffer_state *state)
 
 void trace_dump_sampler_state(const struct pipe_sampler_state *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -395,6 +443,9 @@ void trace_dump_sampler_state(const struct pipe_sampler_state *state)
 
 void trace_dump_surface(const struct pipe_surface *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -423,6 +474,9 @@ void trace_dump_surface(const struct pipe_surface *state)
 
 void trace_dump_transfer(const struct pipe_transfer *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -454,6 +508,9 @@ void trace_dump_transfer(const struct pipe_transfer *state)
 
 void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;
@@ -472,6 +529,9 @@ void trace_dump_vertex_buffer(const struct pipe_vertex_buffer *state)
 
 void trace_dump_vertex_element(const struct pipe_vertex_element *state)
 {
+   if (!trace_dumping_enabled_locked())
+      return;
+
    if(!state) {
       trace_dump_null();
       return;