From 9168dcbbc1913322871ed4b5a038da9f0e911331 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 2 Jan 2022 13:13:10 -0500 Subject: [PATCH] pan/bi: Disambiguate IDVS variants in shader-db Label IDVS variants as being MESA_SHADER_{POSITION, VARYING} stages; reserve the MESA_SHADER_VERTEX label for non-IDVS shaders. This reduces confusion where a single shader compiles to two MESA_SHADER_VERTEX shaders with different stats. While we're at it, de-vendor the blend shader stage name; these stats are internal anyway. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 608f9af9657..5661800bf12 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -3156,6 +3156,19 @@ bi_count_tuple_stats(bi_clause *clause, bi_tuple *tuple, struct bi_stats *stats) } +static const char * +bi_shader_stage_name(bi_context *ctx) +{ + if (ctx->idvs == BI_IDVS_VARYING) + return "MESA_SHADER_VARYING"; + else if (ctx->idvs == BI_IDVS_POSITION) + return "MESA_SHADER_POSITION"; + else if (ctx->inputs->is_blend) + return "MESA_SHADER_BLEND"; + else + return gl_shader_stage_name(ctx->stage); +} + static void bi_print_stats(bi_context *ctx, unsigned size, FILE *fp) { @@ -3203,8 +3216,7 @@ bi_print_stats(bi_context *ctx, unsigned size, FILE *fp) "%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), + bi_shader_stage_name(ctx), stats.nr_ins, stats.nr_tuples, stats.nr_clauses, cycles_bound, cycles_arith, cycles_texture, cycles_varying, cycles_ldst,