diff --git a/src/intel/common/intel_batch_decoder.c b/src/intel/common/intel_batch_decoder.c index 4c3482852e4..8821bf16b07 100644 --- a/src/intel/common/intel_batch_decoder.c +++ b/src/intel/common/intel_batch_decoder.c @@ -610,6 +610,38 @@ decode_single_ksp(struct intel_batch_decode_ctx *ctx, const uint32_t *p) } } +static void +decode_mesh_task_ksp(struct intel_batch_decode_ctx *ctx, const uint32_t *p) +{ + struct intel_group *inst = intel_ctx_find_instruction(ctx, p); + + uint64_t ksp = 0; + uint64_t local_x_maximum = 0; + uint64_t threads = 0; + + struct intel_field_iterator iter; + intel_field_iterator_init(&iter, inst, p, 0, false); + while (intel_field_iterator_next(&iter)) { + if (strcmp(iter.name, "Kernel Start Pointer") == 0) { + ksp = iter.raw_value; + } else if (strcmp(iter.name, "Local X Maximum") == 0) { + local_x_maximum = iter.raw_value; + } else if (strcmp(iter.name, "Number of Threads in GPGPU Thread Group") == 0) { + threads = iter.raw_value; + } + } + + const char *type = + strcmp(inst->name, "3DSTATE_MESH_SHADER") == 0 ? "mesh shader" : + strcmp(inst->name, "3DSTATE_TASK_SHADER") == 0 ? "task shader" : + NULL; + + if (threads && local_x_maximum) { + ctx_disassemble_program(ctx, ksp, type); + fprintf(ctx->fp, "\n"); + } +} + static void decode_ps_kern(struct intel_batch_decode_ctx *ctx, struct intel_group *inst, const uint32_t *p) @@ -1309,6 +1341,8 @@ struct custom_decoder { { "3DSTATE_HS", decode_single_ksp }, { "3DSTATE_PS", decode_ps_kernels }, { "3DSTATE_WM", decode_ps_kernels }, + { "3DSTATE_MESH_SHADER", decode_mesh_task_ksp }, + { "3DSTATE_TASK_SHADER", decode_mesh_task_ksp }, { "3DSTATE_CONSTANT_VS", decode_3dstate_constant }, { "3DSTATE_CONSTANT_GS", decode_3dstate_constant }, { "3DSTATE_CONSTANT_PS", decode_3dstate_constant },