}
void
-disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_registers)
+disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_registers, const char *prefix)
{
uint32_t *words = (uint32_t *) code;
unsigned num_words = size / 4;
(nr_registers <= 8) ? 2 :
1;
- printf("%s shader: "
+ printf("%s"
"%u inst, %u bundles, %u quadwords, "
"%u registers, %u threads, 0 loops\n",
- "FRAGMENT", /* TODO */
+ prefix,
nr_ins, nr_bundles, nr_quadwords,
nr_registers, nr_threads);
#include <stddef.h>
-void disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned regs);
+void disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned regs, const char *prefix);
program->tls_size = ctx->tls_size;
if (midgard_debug & MIDGARD_DBG_SHADERS)
- disassemble_midgard(program->compiled.data, program->compiled.size, false, 0);
+ disassemble_midgard(program->compiled.data, program->compiled.size, false, 0, "");
if (midgard_debug & MIDGARD_DBG_SHADERDB) {
unsigned nr_bundles = 0, nr_ins = 0, nr_quadwords = 0;
pandecode_log("};\n");
}
+static unsigned shader_id = 0;
+
static void
pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
bool is_bifrost, unsigned nr_regs)
printf("\n\n");
+ char prefix[512];
+
+ snprintf(prefix, sizeof(prefix) - 1, "shader%d - %s shader: ",
+ shader_id++,
+ (type == JOB_TYPE_TILER) ? "FRAGMENT" : "VERTEX");
+
if (is_bifrost) {
disassemble_bifrost(code, sz, false);
} else {
- disassemble_midgard(code, sz, true, nr_regs);
+ disassemble_midgard(code, sz, true, nr_regs, prefix);
}
printf("\n\n");