From: Alyssa Rosenzweig Date: Mon, 16 Dec 2019 23:05:21 +0000 (-0500) Subject: panfrost: Let precompile imply shaderdb X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35418f677051b75a9d8b37bafc806303bc3b44ad;p=mesa.git panfrost: Let precompile imply shaderdb 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 Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 62a4dd654b6..87127ba945b 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -27,6 +27,7 @@ #include #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; diff --git a/src/gallium/drivers/panfrost/pan_blend_shaders.c b/src/gallium/drivers/panfrost/pan_blend_shaders.c index 62177ccf7e4..d043d9b84e8 100644 --- a/src/gallium/drivers/panfrost/pan_blend_shaders.c +++ b/src/gallium/drivers/panfrost/pan_blend_shaders.c @@ -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; diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 7d31d4f6618..58d7902577a 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -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 */ diff --git a/src/panfrost/midgard/midgard_compile.h b/src/panfrost/midgard/midgard_compile.h index 9d27c338f4b..51966b46471 100644 --- a/src/panfrost/midgard/midgard_compile.h +++ b/src/panfrost/midgard/midgard_compile.h @@ -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