From 08ee0488e6ae4c3728f00b24a2744cb3bd1929e8 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 3 Sep 2014 18:45:55 -0400 Subject: [PATCH] freedreno/ir3: bit of debug Make it easier to figure out which compiler stage failed. Signed-off-by: Rob Clark --- .../drivers/freedreno/ir3/ir3_compiler.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c index 472efd89266..e23dcdbc2c7 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c @@ -1172,7 +1172,7 @@ get_tex_info(struct ir3_compile_context *ctx, return NULL; } -static bool check_swiz(struct tgsi_src_register *src, int8_t order[4]) +static bool check_swiz(struct tgsi_src_register *src, const int8_t order[4]) { unsigned i; for (i = 1; (i < 4) && order[i] >= 0; i++) @@ -2560,6 +2560,7 @@ ir3_compile_shader(struct ir3_shader_variant *so, assert(so->ir); if (compile_init(&ctx, so, tokens) != TGSI_PARSE_OK) { + DBG("INIT failed!"); ret = -1; goto out; } @@ -2611,11 +2612,18 @@ ir3_compile_shader(struct ir3_shader_variant *so, compile_dump(&ctx); ret = ir3_block_flatten(block); - if (ret < 0) + if (ret < 0) { + DBG("FLATTEN failed!"); goto out; + } if ((ret > 0) && (fd_mesa_debug & FD_DBG_OPTDUMP)) compile_dump(&ctx); + if (fd_mesa_debug & FD_DBG_OPTMSGS) { + printf("BEFORE CP:\n"); + ir3_dump_instr_list(block->head); + } + ir3_block_cp(block); if (fd_mesa_debug & FD_DBG_OPTDUMP) @@ -2629,8 +2637,10 @@ ir3_compile_shader(struct ir3_shader_variant *so, } ret = ir3_block_sched(block); - if (ret) + if (ret) { + DBG("SCHED failed!"); goto out; + } if (fd_mesa_debug & FD_DBG_OPTMSGS) { printf("AFTER SCHED:\n"); @@ -2639,8 +2649,10 @@ ir3_compile_shader(struct ir3_shader_variant *so, ret = ir3_block_ra(block, so->type, key.half_precision, so->frag_coord, so->frag_face, &so->has_samp); - if (ret) + if (ret) { + DBG("RA failed!"); goto out; + } if (fd_mesa_debug & FD_DBG_OPTMSGS) { printf("AFTER RA:\n"); -- 2.30.2