pan/mdg: Don't disassemble blit shaders
authorIcecream95 <ixn@keemail.me>
Fri, 17 Jul 2020 10:34:04 +0000 (22:34 +1200)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Jul 2020 13:37:31 +0000 (09:37 -0400)
There are a lot of them and they are mostly uninteresting, so don't
disassemble them or print shader-db results.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5948>

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

index 06ee980ff3b4c26ac1bbacb865d464952e435997..64e67ae463d02f67ff5b0850d73009c0d311e8fc 100644 (file)
@@ -171,7 +171,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
                 bifrost_compile_shader_nir(s, &program, dev->gpu_id);
         } else {
                 midgard_compile_shader_nir(s, &program, false, 0, dev->gpu_id,
-                                dev->debug & PAN_DBG_PRECOMPILE);
+                                dev->debug & PAN_DBG_PRECOMPILE, false);
         }
 
         /* Prepare the compiled binary for upload */
index 74aac4ebb38b1c356048da81afe8550d98bc3120..f9be2d890ad14167074f87ec4086c1d59c9515ca 100644 (file)
@@ -217,7 +217,7 @@ panfrost_compile_blend_shader(
            .rt_formats = {format}
         };
 
-        midgard_compile_shader_nir(shader, &program, true, rt, dev->gpu_id, false);
+        midgard_compile_shader_nir(shader, &program, true, rt, dev->gpu_id, false, false);
 
         /* Allow us to patch later */
         res.patch_index = program.blend_patch_offset;
index dcb9f8dd194f00a1b432aa1f7eabd33af3eda9f0..ece664bb5b911da6f9a6e29f4d90b98293dfc2a2 100644 (file)
@@ -100,7 +100,7 @@ panfrost_build_blit_shader(panfrost_program *program, unsigned gpu_id, gl_frag_r
         else
                 nir_store_var(b, c_out, nir_channel(b, &tex->dest.ssa, 0), 0xFF);
 
-        midgard_compile_shader_nir(shader, program, false, 0, gpu_id, false);
+        midgard_compile_shader_nir(shader, program, false, 0, gpu_id, false, true);
 }
 
 /* Compile and upload all possible blit shaders ahead-of-time to reduce draw
index fa9ff9eb07fa0e2853784dd28d84370eb5306d4c..085edc5d0d4d5acff99b09aa754cf43f410c82b8 100644 (file)
@@ -2847,7 +2847,7 @@ mir_add_writeout_loops(compiler_context *ctx)
 }
 
 int
-midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb)
+midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb, bool silent)
 {
         struct util_dynarray *compiled = &program->compiled;
 
@@ -2909,7 +2909,7 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
 
         NIR_PASS_V(nir, midgard_nir_reorder_writeout);
 
-        if (midgard_debug & MIDGARD_DBG_SHADERS) {
+        if ((midgard_debug & MIDGARD_DBG_SHADERS) && !silent) {
                 nir_print_shader(nir, stdout);
         }
 
@@ -3161,10 +3161,10 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
         program->blend_patch_offset = ctx->blend_constant_offset;
         program->tls_size = ctx->tls_size;
 
-        if (midgard_debug & MIDGARD_DBG_SHADERS)
+        if ((midgard_debug & MIDGARD_DBG_SHADERS) && !silent)
                 disassemble_midgard(stdout, program->compiled.data, program->compiled.size, gpu_id, ctx->stage);
 
-        if (midgard_debug & MIDGARD_DBG_SHADERDB || shaderdb) {
+        if ((midgard_debug & MIDGARD_DBG_SHADERDB || shaderdb) && !silent) {
                 unsigned nr_bundles = 0, nr_ins = 0;
 
                 /* Count instructions and bundles */
index bf98342c4f6793ddb127e7b11358b333d36e8e13..c47c6c92c908a89e0695b9dbf64d38ee1d8be275 100644 (file)
@@ -30,7 +30,7 @@
 #include "panfrost/util/pan_ir.h"
 
 int
-midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb);
+midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb, bool silent);
 
 /* NIR options are shared between the standalone compiler and the online
  * compiler. Defining it here is the simplest, though maybe not the Right