[Mesa-dev] [PATCH 23/23] radeonsi: adjust the parameters of si_shader_dump

Nicolai Hähnle nhaehnle at gmail.com
Wed Jan 6 13:07:50 PST 2016


I like the code structure established by this series. Patches 20-23 are

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 06.01.2016 07:41, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> The function will be extended to dump all binaries shaders will consist of,
> so si_shader* makes sense here.
> ---
>   src/gallium/drivers/radeonsi/si_compute.c |  6 ++----
>   src/gallium/drivers/radeonsi/si_shader.c  | 18 +++++++-----------
>   src/gallium/drivers/radeonsi/si_shader.h  |  7 ++-----
>   3 files changed, 11 insertions(+), 20 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
> index ffac656..5a08cbf 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -125,8 +125,7 @@ static void *si_create_compute_state(
>   			si_compile_llvm(sctx->screen, &program->kernels[i].binary,
>   					&program->kernels[i].config, sctx->tm,
>   					mod, &sctx->b.debug, TGSI_PROCESSOR_COMPUTE);
> -			si_shader_dump(sctx->screen, &program->kernels[i].binary,
> -				       &program->kernels[i].config,
> +			si_shader_dump(sctx->screen, &program->kernels[i],
>   				       &sctx->b.debug, TGSI_PROCESSOR_COMPUTE);
>   			si_shader_binary_upload(sctx->screen, &program->kernels[i]);
>   			LLVMDisposeModule(mod);
> @@ -143,8 +142,7 @@ static void *si_create_compute_state(
>   	init_scratch_buffer(sctx, program);
>   	si_shader_binary_read_config(&program->shader.binary,
>   				     &program->shader.config, 0);
> -	si_shader_dump(sctx->screen, &program->shader.binary,
> -		       &program->shader.config, &sctx->b.debug,
> +	si_shader_dump(sctx->screen, &program->shader, &sctx->b.debug,
>   		       TGSI_PROCESSOR_COMPUTE);
>   	si_shader_binary_upload(sctx->screen, &program->shader);
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index 58d16cf..b1a9a1e 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -3873,17 +3873,15 @@ static void si_shader_dump_stats(struct si_screen *sscreen,
>   			   conf->lds_size, conf->scratch_bytes_per_wave);
>   }
>
> -void si_shader_dump(struct si_screen *sscreen,
> -		    struct radeon_shader_binary *binary,
> -		    struct si_shader_config *conf,
> -		    struct pipe_debug_callback *debug,
> -		    unsigned processor)
> +void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
> +		    struct pipe_debug_callback *debug, unsigned processor)
>   {
>   	if (r600_can_dump_shader(&sscreen->b, processor))
>   		if (!(sscreen->b.debug_flags & DBG_NO_ASM))
> -			si_shader_dump_disassembly(binary, debug);
> +			si_shader_dump_disassembly(&shader->binary, debug);
>
> -	si_shader_dump_stats(sscreen, conf, binary->code_size, debug, processor);
> +	si_shader_dump_stats(sscreen, &shader->config,
> +			     shader->binary.code_size, debug, processor);
>   }
>
>   int si_compile_llvm(struct si_screen *sscreen,
> @@ -3996,8 +3994,7 @@ static int si_generate_gs_copy_shader(struct si_screen *sscreen,
>   			    bld_base->base.gallivm->module,
>   			    debug, TGSI_PROCESSOR_GEOMETRY);
>   	if (!r) {
> -		si_shader_dump(sscreen, &si_shader_ctx->shader->binary,
> -			       &si_shader_ctx->shader->config, debug,
> +		si_shader_dump(sscreen, si_shader_ctx->shader, debug,
>   			       TGSI_PROCESSOR_GEOMETRY);
>   		r = si_shader_binary_upload(sscreen, si_shader_ctx->shader);
>   	}
> @@ -4202,8 +4199,7 @@ int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
>   		goto out;
>   	}
>
> -	si_shader_dump(sscreen, &shader->binary, &shader->config,
> -		       debug, si_shader_ctx.type);
> +	si_shader_dump(sscreen, shader, debug, si_shader_ctx.type);
>
>   	r = si_shader_binary_upload(sscreen, shader);
>   	if (r) {
> diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
> index 712bcd9..1635358 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.h
> +++ b/src/gallium/drivers/radeonsi/si_shader.h
> @@ -344,11 +344,8 @@ void si_shader_destroy(struct si_shader *shader);
>   void si_shader_destroy_binary(struct radeon_shader_binary *binary);
>   unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index);
>   int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader);
> -void si_shader_dump(struct si_screen *sscreen,
> -		    struct radeon_shader_binary *binary,
> -		    struct si_shader_config *conf,
> -		    struct pipe_debug_callback *debug,
> -		    unsigned processor);
> +void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
> +		    struct pipe_debug_callback *debug, unsigned processor);
>   void si_shader_apply_scratch_relocs(struct si_context *sctx,
>   			struct si_shader *shader,
>   			uint64_t scratch_va);
>


More information about the mesa-dev mailing list