diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index cd23c1c901e..0870c96bf05 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -703,6 +703,10 @@ static const struct debug_named_value common_debug_options[] = { { "nowc", DBG_NO_WC, "Disable GTT write combining" }, { "check_vm", DBG_CHECK_VM, "Check VM faults and dump debug info." }, + /* shared-db */ + { "shaderdb", DBG_SHADER_DB, "Dump shader-db analysis." }, + { "precompile", DBG_SHADER_DB, "Synonym for shaderdb. This is needed to maintain the compatibility with the shader-db repository." }, + DEBUG_NAMED_VALUE_END /* must be last */ }; diff --git a/src/gallium/drivers/r600/r600_pipe_common.h b/src/gallium/drivers/r600/r600_pipe_common.h index 9774ef3575c..c60a4640e35 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.h +++ b/src/gallium/drivers/r600/r600_pipe_common.h @@ -77,6 +77,8 @@ struct u_log_context; #define DBG_INFO (1ull << 40) #define DBG_NO_WC (1ull << 41) #define DBG_CHECK_VM (1ull << 42) +/* shader-db */ +#define DBG_SHADER_DB (1ull << 43) /* gap */ #define DBG_TEST_VMFAULT_CP (1ull << 51) #define DBG_TEST_VMFAULT_SDMA (1ull << 52) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 731041f4ad1..0e19e6a0597 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -275,14 +275,16 @@ int r600_pipe_shader_create(struct pipe_context *ctx, goto error; } - util_debug_message(&rctx->b.debug, SHADER_INFO, "%s shader: %d dw, %d gprs, %d alu_groups, %d loops, %d cf, %d stack", - _mesa_shader_stage_to_abbrev(processor), - shader->shader.bc.ndw, - shader->shader.bc.ngpr, - shader->shader.bc.nalu_groups, - shader->shader.num_loops, - shader->shader.bc.ncf, - shader->shader.bc.nstack); + if (unlikely(rctx->screen->b.debug_flags & DBG_SHADER_DB)) { + util_debug_message(&rctx->b.debug, SHADER_INFO, "%s shader: %d dw, %d gprs, %d alu_groups, %d loops, %d cf, %d stack", + _mesa_shader_stage_to_abbrev(processor), + shader->shader.bc.ndw, + shader->shader.bc.ngpr, + shader->shader.bc.nalu_groups, + shader->shader.num_loops, + shader->shader.bc.ncf, + shader->shader.bc.nstack); + } if (!sel->nir_blob && sel->nir && sel->ir_type != PIPE_SHADER_IR_TGSI) { struct blob blob;