aux/cso: stop tracing during cso_unbind()
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 1 Feb 2022 19:38:19 +0000 (14:38 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 9 Mar 2022 03:54:37 +0000 (03:54 +0000)
this unnecessarily bloats lavapipe traces

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>

src/gallium/auxiliary/cso_cache/cso_context.c

index 1f36851..111de3f 100644 (file)
@@ -49,7 +49,7 @@
 #include "cso_cache/cso_cache.h"
 #include "cso_cache/cso_hash.h"
 #include "cso_context.h"
-
+#include "driver_trace/tr_dump.h"
 
 /**
  * Per-shader sampler information.
@@ -296,6 +296,9 @@ void cso_unbind_context(struct cso_context *ctx)
 {
    unsigned i;
 
+   bool dumping = trace_dumping_enabled_locked();
+   if (dumping)
+      trace_dumping_stop_locked();
    if (ctx->pipe) {
       ctx->pipe->bind_blend_state( ctx->pipe, NULL );
       ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
@@ -399,6 +402,8 @@ void cso_unbind_context(struct cso_context *ctx)
    ctx->pipe->set_sample_mask(ctx->pipe, ctx->sample_mask);
    if (ctx->pipe->set_min_samples)
       ctx->pipe->set_min_samples(ctx->pipe, ctx->min_samples);
+   if (dumping)
+      trace_dumping_start_locked();
 }
 
 /**