From: Eric Anholt Date: Thu, 14 Mar 2019 20:59:13 +0000 (-0700) Subject: v3d: Replace the old shader-db env var output with the ARB_debug_output. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e0a72ce096bf368e184acfbeed28916cc0e968f;p=mesa.git v3d: Replace the old shader-db env var output with the ARB_debug_output. We're using ARB_debug_output for the main shader-db, but I had this env var left around from the shader-db-2 support (vc4 apitrace-based). Keep the env var around since it's nice sometimes to get the stats on a shader you're optimizing without having to do a shader-db run, but drop the old formatting that's not useful and keeps tricking me when I go to add another measurement to the shader-db output. --- diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index 8632936b67b..b785b53c62c 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -913,6 +913,9 @@ uint64_t *v3d_compile(const struct v3d_compiler *compiler, c->spills, c->fills); if (ret >= 0) { + if (V3D_DEBUG & V3D_DEBUG_SHADERDB) + fprintf(stderr, "SHADER-DB: %s\n", shaderdb); + c->debug_output(shaderdb, c->debug_output_data); free(shaderdb); } diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c index 1ffb37f1a38..1c79ac93530 100644 --- a/src/broadcom/compiler/vir_register_allocate.c +++ b/src/broadcom/compiler/vir_register_allocate.c @@ -680,17 +680,5 @@ v3d_register_allocate(struct v3d_compile *c, bool *spilled) ralloc_free(g); - if (V3D_DEBUG & V3D_DEBUG_SHADERDB) { - fprintf(stderr, "SHADER-DB: %s prog %d/%d: %d spills\n", - vir_get_stage_name(c), - c->program_id, c->variant_id, - c->spills); - - fprintf(stderr, "SHADER-DB: %s prog %d/%d: %d fills\n", - vir_get_stage_name(c), - c->program_id, c->variant_id, - c->fills); - } - return temp_registers; } diff --git a/src/broadcom/compiler/vir_to_qpu.c b/src/broadcom/compiler/vir_to_qpu.c index 111a6c929a2..75129a1d6bf 100644 --- a/src/broadcom/compiler/vir_to_qpu.c +++ b/src/broadcom/compiler/vir_to_qpu.c @@ -405,7 +405,7 @@ v3d_vir_to_qpu(struct v3d_compile *c, struct qpu_reg *temp_registers) vir_for_each_block(block, c) v3d_generate_code_block(c, block, temp_registers); - uint32_t cycles = v3d_qpu_schedule_instructions(c); + v3d_qpu_schedule_instructions(c); c->qpu_insts = rzalloc_array(c, uint64_t, c->qpu_inst_count); int i = 0; @@ -422,23 +422,6 @@ v3d_vir_to_qpu(struct v3d_compile *c, struct qpu_reg *temp_registers) } assert(i == c->qpu_inst_count); - if (V3D_DEBUG & V3D_DEBUG_SHADERDB) { - fprintf(stderr, "SHADER-DB: %s prog %d/%d: %d instructions\n", - vir_get_stage_name(c), - c->program_id, c->variant_id, - c->qpu_inst_count); - } - - /* The QPU cycle estimates are pretty broken (see waddr_latency()), so - * don't report them for now. - */ - if (false) { - fprintf(stderr, "SHADER-DB: %s prog %d/%d: %d estimated cycles\n", - vir_get_stage_name(c), - c->program_id, c->variant_id, - cycles); - } - if (V3D_DEBUG & (V3D_DEBUG_QPU | v3d_debug_flag_for_shader_stage(c->s->info.stage))) { v3d_dump_qpu(c);