Module: Mesa
Branch: main
Commit: 7107ed55c01840c7bea21c01f8d3e3c9b10fe9c2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7107ed55c01840c7bea21c01f8d3e3c9b10fe9c2

Author: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Date:   Sun Jan 14 11:00:44 2024 +0200

intel/decoder: make vertex data decoding optional

When capturing INTEL_DEBUG=capture-all and the application has like
1Gb of vertex data, you might not want to actually decode it when
looking at the error state.

Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27058>

---

 src/intel/common/intel_batch_decoder.c | 4 +++-
 src/intel/common/intel_decoder.h       | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/intel/common/intel_batch_decoder.c 
b/src/intel/common/intel_batch_decoder.c
index ba37f938030..987e9d0b514 100644
--- a/src/intel/common/intel_batch_decoder.c
+++ b/src/intel/common/intel_batch_decoder.c
@@ -37,6 +37,7 @@ static const struct debug_control debug_control[] = {
    { "floats",     INTEL_BATCH_DECODE_FLOATS },
    { "surfaces",   INTEL_BATCH_DECODE_SURFACES },
    { "accumulate", INTEL_BATCH_DECODE_ACCUMULATE },
+   { "vb-data",    INTEL_BATCH_DECODE_VB_DATA },
    { NULL,    0 }
 };
 
@@ -580,7 +581,8 @@ handle_3dstate_vertex_buffers(struct intel_batch_decode_ctx 
*ctx,
          if (vb.map == 0 || vb_size == 0)
             continue;
 
-         ctx_print_buffer(ctx, vb, vb_size, pitch, ctx->max_vbo_decoded_lines);
+         if (ctx->flags & INTEL_BATCH_DECODE_VB_DATA)
+            ctx_print_buffer(ctx, vb, vb_size, pitch, 
ctx->max_vbo_decoded_lines);
 
          vb.map = NULL;
          vb_size = 0;
diff --git a/src/intel/common/intel_decoder.h b/src/intel/common/intel_decoder.h
index eb821a61091..4210438eb5f 100644
--- a/src/intel/common/intel_decoder.h
+++ b/src/intel/common/intel_decoder.h
@@ -231,6 +231,8 @@ enum intel_batch_decode_flags {
     *     - COMPUTE_WALKER
     */
    INTEL_BATCH_DECODE_ACCUMULATE  = (1 << 6),
+   /** Print vertex buffer data */
+   INTEL_BATCH_DECODE_VB_DATA     = (1 << 7),
 };
 
 #define INTEL_BATCH_DECODE_DEFAULT_FLAGS \
@@ -238,7 +240,8 @@ enum intel_batch_decode_flags {
     INTEL_BATCH_DECODE_OFFSETS |         \
     INTEL_BATCH_DECODE_FLOATS |          \
     INTEL_BATCH_DECODE_SURFACES |        \
-    INTEL_BATCH_DECODE_SAMPLERS)
+    INTEL_BATCH_DECODE_SAMPLERS |        \
+    INTEL_BATCH_DECODE_VB_DATA)
 
 struct intel_batch_decode_bo {
    uint64_t addr;

Reply via email to