Mesa (main): intel/decoder: Dump Task/Mesh shaders

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 4 21:15:00 UTC 2021


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

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Thu Jul 29 15:20:15 2021 +0200

intel/decoder: Dump Task/Mesh shaders

Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Acked-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13657>

---

 src/intel/common/intel_batch_decoder.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

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 },



More information about the mesa-commit mailing list