freedreno: Include binning shaders in shader-db.
authorEric Anholt <eric@anholt.net>
Wed, 5 Jun 2019 18:29:19 +0000 (11:29 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 22 Jun 2019 00:14:43 +0000 (17:14 -0700)
We want to see if we've improved our binning VS output, as well as the
render VS.

Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_shader.c
src/gallium/drivers/freedreno/ir3/ir3_gallium.c

index 952ac9e1b2fc7a4b0df9dc3085447323ca87aad2..610ae655a83c1e65ea2817cd6a00c995e3eabfd4 100644 (file)
@@ -243,8 +243,10 @@ ir3_shader_get_variant(struct ir3_shader *shader, struct ir3_shader_key *key,
                        shader_variant(shader, key, created);
 
        if (v && binning_pass) {
-               if (!v->binning)
+               if (!v->binning) {
                        v->binning = create_variant(shader, key, true);
+                       *created = true;
+               }
                return v->binning;
        }
 
index 9fd84899b36eb96f1d9563df520812afedec1bfd..4a7d3e8dbfdd512765380a0314167fd2e2a5d97b 100644 (file)
 #include "ir3/ir3_nir.h"
 
 static void
-dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug)
+dump_shader_info(struct ir3_shader_variant *v, bool binning_pass,
+               struct pipe_debug_callback *debug)
 {
        if (!unlikely(fd_mesa_debug & FD_DBG_SHADERDB))
                return;
 
        pipe_debug_message(debug, SHADER_INFO,
-                       "%s shader: %u inst, %u dwords, "
+                       "%s%s shader: %u inst, %u dwords, "
                        "%u half, %u full, %u const, %u constlen, "
                        "%u (ss), %u (sy), %d max_sun, %d loops\n",
+                       binning_pass ? "B" : "",
                        ir3_shader_stage(v->shader),
                        v->info.instrs_count,
                        v->info.sizedwords,
@@ -80,7 +82,7 @@ ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key,
        v = ir3_shader_get_variant(shader, &key, binning_pass, &created);
 
        if (created) {
-               dump_shader_info(v, debug);
+               dump_shader_info(v, binning_pass, debug);
        }
 
        return v;
@@ -137,6 +139,9 @@ ir3_shader_create(struct ir3_compiler *compiler,
                static struct ir3_shader_key key;
                memset(&key, 0, sizeof(key));
                ir3_shader_variant(shader, key, false, debug);
+
+               if (nir->info.stage != MESA_SHADER_FRAGMENT)
+                       ir3_shader_variant(shader, key, true, debug);
        }
        return shader;
 }