pan/bi: Add internal debug flag

Since 3186401751 ("pan/bi: Suppress disassembly for internal shaders"),
we haven't had a good way to debug blit shaders. I keep rewriting this
patch manually, let's just a debug flag for it.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8723>
This commit is contained in:
Alyssa Rosenzweig 2020-12-30 14:16:51 -05:00 committed by Marge Bot
parent b1ebe7a19b
commit 61af9cb76b
2 changed files with 8 additions and 3 deletions

View file

@ -33,6 +33,7 @@
#define BIFROST_DBG_SHADERS 0x0002
#define BIFROST_DBG_SHADERDB 0x0004
#define BIFROST_DBG_VERBOSE 0x0008
#define BIFROST_DBG_INTERNAL 0x0010
extern int bifrost_debug;

View file

@ -42,6 +42,7 @@ static const struct debug_named_value bifrost_debug_options[] = {
{"shaders", BIFROST_DBG_SHADERS, "Dump shaders in NIR and MIR"},
{"shaderdb", BIFROST_DBG_SHADERDB, "Print statistics"},
{"verbose", BIFROST_DBG_VERBOSE, "Disassemble verbosely"},
{"internal", BIFROST_DBG_INTERNAL, "Dump even internal shaders"},
DEBUG_NAMED_VALUE_END
};
@ -2325,7 +2326,10 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir,
NIR_PASS_V(nir, pan_nir_reorder_writeout);
if (bifrost_debug & BIFROST_DBG_SHADERS && !nir->info.internal) {
bool skip_internal = nir->info.internal;
skip_internal &= !(bifrost_debug & BIFROST_DBG_INTERNAL);
if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal) {
nir_print_shader(nir, stdout);
}
@ -2370,11 +2374,11 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir,
bi_lower_fau(ctx, block);
}
if (bifrost_debug & BIFROST_DBG_SHADERS && !nir->info.internal)
if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal)
bi_print_shader(ctx, stdout);
bi_schedule(ctx);
bi_register_allocate(ctx);
if (bifrost_debug & BIFROST_DBG_SHADERS && !nir->info.internal)
if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal)
bi_print_shader(ctx, stdout);
util_dynarray_init(&program->compiled, NULL);