Commit eb76860d authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜
Browse files

pan/va: Add shader-db support



Only reports the common subset from Bifrost. Valhall specific reporting
will come in a later commit once I can get my hands on performance
counters (or juryrig a mali-oc demon -- oh hey, let's do that!)
Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
parent c3090465
......@@ -3097,6 +3097,33 @@ bi_print_stats(bi_context *ctx, unsigned size, FILE *fp)
ctx->spills, ctx->fills);
}
static void
va_print_stats(bi_context *ctx, unsigned size, FILE *fp)
{
struct bi_stats stats = { 0 };
/* Count instructions. TODO: normalized cycle counts. */
bi_foreach_instr_global(ctx, I) {
stats.nr_ins++;
}
/* Thread count and register pressure are traded off */
unsigned nr_threads = (ctx->info->work_reg_count <= 32) ? 2 : 1;
/* Dump stats */
fprintf(stderr, "%s - %s shader: "
"%u inst, "
"%u quadwords, %u threads, %u loops, "
"%u:%u spills:fills\n",
ctx->nir->info.label ?: "",
ctx->inputs->is_blend ? "PAN_SHADER_BLEND" :
gl_shader_stage_name(ctx->stage),
stats.nr_ins,
size / 16, nr_threads,
ctx->loop_count,
ctx->spills, ctx->fills);
}
static int
glsl_type_size(const struct glsl_type *type, bool bindless)
{
......@@ -3789,7 +3816,12 @@ bifrost_compile_shader_nir(nir_shader *nir,
if ((bifrost_debug & BIFROST_DBG_SHADERDB || inputs->shaderdb) &&
!skip_internal) {
bi_print_stats(ctx, binary->size, stderr);
if (ctx->arch >= 9) {
va_print_stats(ctx, binary->size, stderr);
} else {
bi_print_stats(ctx, binary->size, stderr);
}
}
ralloc_free(ctx);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment