[Mesa-dev] [PATCH 14/23] radeonsi: don't pass si_shader to si_shader_binary_read

Marek Olšák maraeo at gmail.com
Wed Jan 6 04:41:36 PST 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_compute.c |  3 ++-
 src/gallium/drivers/radeonsi/si_shader.c  | 23 ++++++++++++-----------
 src/gallium/drivers/radeonsi/si_shader.h  |  7 +++++--
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 7aedd39..a543c55 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -136,7 +136,8 @@ static void *si_create_compute_state(
 	 * the shader code to the GPU.
 	 */
 	init_scratch_buffer(sctx, program);
-	si_shader_binary_read(sctx->screen, &program->shader, &sctx->b.debug,
+	si_shader_binary_read(sctx->screen, &program->shader.binary,
+			      &program->shader.config, &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 f9e61a2..de117d9 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3853,12 +3853,13 @@ static void si_shader_dump_disassembly(const struct radeon_shader_binary *binary
 	}
 }
 
-void si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader,
-			   struct pipe_debug_callback *debug, unsigned processor)
+void si_shader_binary_read(struct si_screen *sscreen,
+			   struct radeon_shader_binary *binary,
+			   struct si_shader_config *conf,
+			   struct pipe_debug_callback *debug,
+			   unsigned processor)
 {
-	const struct radeon_shader_binary *binary = &shader->binary;
-
-	si_shader_binary_read_config(&shader->binary, &shader->config, 0);
+	si_shader_binary_read_config(binary, conf, 0);
 
 	if (r600_can_dump_shader(&sscreen->b, processor)) {
 		if (!(sscreen->b.debug_flags & DBG_NO_ASM))
@@ -3867,15 +3868,14 @@ void si_shader_binary_read(struct si_screen *sscreen, struct si_shader *shader,
 		fprintf(stderr, "*** SHADER STATS ***\n"
 			"SGPRS: %d\nVGPRS: %d\nCode Size: %d bytes\nLDS: %d blocks\n"
 			"Scratch: %d bytes per wave\n********************\n",
-			shader->config.num_sgprs, shader->config.num_vgprs, binary->code_size,
-			shader->config.lds_size, shader->config.scratch_bytes_per_wave);
+			conf->num_sgprs, conf->num_vgprs, binary->code_size,
+			conf->lds_size, conf->scratch_bytes_per_wave);
 	}
 
 	pipe_debug_message(debug, SHADER_INFO,
 			   "Shader Stats: SGPRS: %d VGPRS: %d Code Size: %d LDS: %d Scratch: %d",
-			   shader->config.num_sgprs, shader->config.num_vgprs,
-			   binary->code_size, shader->config.lds_size,
-			   shader->config.scratch_bytes_per_wave);
+			   conf->num_sgprs, conf->num_vgprs, binary->code_size,
+			   conf->lds_size, conf->scratch_bytes_per_wave);
 }
 
 int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader,
@@ -3900,7 +3900,8 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader,
 			return r;
 	}
 
-	si_shader_binary_read(sscreen, shader, debug, processor);
+	si_shader_binary_read(sscreen, &shader->binary, &shader->config,
+			      debug, processor);
 
 	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 93d5af6..b0abacc 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -339,8 +339,11 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader,
 void si_shader_destroy(struct si_shader *shader);
 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_binary_read(struct si_screen *sscreen, struct si_shader *shader,
-			   struct pipe_debug_callback *debug, unsigned processor);
+void si_shader_binary_read(struct si_screen *sscreen,
+			   struct radeon_shader_binary *binary,
+			   struct si_shader_config *conf,
+			   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);
-- 
2.1.4



More information about the mesa-dev mailing list