diff --git a/docs/envvars.rst b/docs/envvars.rst index 26186cc789b..e65e362adcc 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -518,6 +518,25 @@ Intel driver environment variables ``wm`` dump shader assembly for fragment shaders (same as ``fs``) +.. envvar:: INTEL_DECODE + + a comma-separated list of enable/disable flags configuring the + output produced by ``INTEL_DEBUG=bat`` (use with + ``INTEL_DECODE=+color,-floats``) : + + ``color`` + print colored output + + ``floats`` + try to decode floating point data in buffers + + ``full`` + print additional custom information for instructions (usually + pulling more information by inspecting memory) + + ``offsets`` + print offsets of instructions + .. envvar:: INTEL_MEASURE Collects GPU timestamps over common intervals, and generates a CSV report diff --git a/src/intel/common/intel_batch_decoder.c b/src/intel/common/intel_batch_decoder.c index a73ee2d7175..30ce06eea8f 100644 --- a/src/intel/common/intel_batch_decoder.c +++ b/src/intel/common/intel_batch_decoder.c @@ -24,10 +24,19 @@ #include "common/intel_decoder.h" #include "intel_disasm.h" #include "util/macros.h" +#include "util/u_debug.h" #include "util/u_math.h" /* Needed for ROUND_DOWN_TO */ #include +static const struct debug_control debug_control[] = { + { "color", INTEL_BATCH_DECODE_IN_COLOR }, + { "full", INTEL_BATCH_DECODE_FULL }, + { "offsets", INTEL_BATCH_DECODE_OFFSETS }, + { "floats", INTEL_BATCH_DECODE_FLOATS }, + { NULL, 0 } +}; + void intel_batch_decode_ctx_init(struct intel_batch_decode_ctx *ctx, const struct brw_isa_info *isa, @@ -49,7 +58,7 @@ intel_batch_decode_ctx_init(struct intel_batch_decode_ctx *ctx, ctx->get_state_size = get_state_size; ctx->user_data = user_data; ctx->fp = fp; - ctx->flags = flags; + ctx->flags = parse_enable_string(getenv("INTEL_DECODE"), flags, debug_control); ctx->max_vbo_decoded_lines = -1; /* No limit! */ ctx->engine = INTEL_ENGINE_CLASS_RENDER;