panfrost: Let precompile imply shaderdb
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 16 Dec 2019 23:05:21 +0000 (18:05 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 17 Dec 2019 17:42:57 +0000 (17:42 +0000)
This cuts down the number of random environmental variables we need
flying around; now PAN_MESA_DEBUG=precompile is sufficient and
MIDGARD_MESA_DEBUG=shaderdb will be implied.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3125>

src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_blend_shaders.c
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_compile.h

index 62a4dd654b6ffbca42c4c63ec1539f076a515b76..87127ba945b29cc0c319e1684cff044aa380cd1f 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 #include "pan_bo.h"
 #include "pan_context.h"
+#include "pan_util.h"
 
 #include "compiler/nir/nir.h"
 #include "nir/tgsi_to_nir.h"
@@ -65,7 +66,8 @@ panfrost_shader_compile(
                 .alpha_ref = state->alpha_state.ref_value
         };
 
-        midgard_compile_shader_nir(s, &program, false, 0, screen->gpu_id);
+        midgard_compile_shader_nir(s, &program, false, 0, screen->gpu_id,
+                        pan_debug & PAN_DBG_PRECOMPILE);
 
         /* Prepare the compiled binary for upload */
         int size = program.compiled.size;
index 62177ccf7e443a0829e3f39c527ef8ec7dcb6a40..d043d9b84e8acf156ca824e110edd3317d2dee3a 100644 (file)
@@ -174,7 +174,7 @@ panfrost_compile_blend_shader(
         /* Compile the built shader */
 
         midgard_program program;
-        midgard_compile_shader_nir(shader, &program, true, rt, screen->gpu_id);
+        midgard_compile_shader_nir(shader, &program, true, rt, screen->gpu_id, false);
 
         /* Allow us to patch later */
         res.patch_index = program.blend_patch_offset;
index 7d31d4f66185dcfd32515c75d29d72af28f81b44..58d7902577a56a243fa757589baebbe3e356882b 100644 (file)
@@ -2420,7 +2420,7 @@ midgard_get_first_tag_from_block(compiler_context *ctx, unsigned block_idx)
 }
 
 int
-midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id)
+midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb)
 {
         struct util_dynarray *compiled = &program->compiled;
 
@@ -2735,7 +2735,7 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
         if (midgard_debug & MIDGARD_DBG_SHADERS)
                 disassemble_midgard(program->compiled.data, program->compiled.size, gpu_id, ctx->stage);
 
-        if (midgard_debug & MIDGARD_DBG_SHADERDB) {
+        if (midgard_debug & MIDGARD_DBG_SHADERDB || shaderdb) {
                 unsigned nr_bundles = 0, nr_ins = 0;
 
                 /* Count instructions and bundles */
index 9d27c338f4bba73b50e1ec7789c630386e08b7dc..51966b46471091031022894918b396e24bff8445 100644 (file)
@@ -91,7 +91,7 @@ typedef struct {
 } midgard_program;
 
 int
-midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id);
+midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb);
 
 /* NIR options are shared between the standalone compiler and the online
  * compiler. Defining it here is the simplest, though maybe not the Right