[Mesa-dev] [PATCH 15/23] radeonsi: always keep shader code, rodata, and relocs in memory

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


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

We won't compile shaders in draw calls, but we will concatenate shader
binaries according to states in draw calls, so keep the binaries.
---
 src/gallium/drivers/radeonsi/si_shader.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index de117d9..abc1652 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3908,14 +3908,9 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader,
 		return r;
 
 	FREE(shader->binary.config);
-	FREE(shader->binary.rodata);
 	FREE(shader->binary.global_symbol_offsets);
-	if (shader->config.scratch_bytes_per_wave == 0) {
-		FREE(shader->binary.code);
-		FREE(shader->binary.relocs);
-		memset(&shader->binary, 0,
-		       offsetof(struct radeon_shader_binary, disasm_string));
-	}
+	shader->binary.config = NULL;
+	shader->binary.global_symbol_offsets = NULL;
 	return r;
 }
 
@@ -4228,6 +4223,7 @@ void si_shader_destroy(struct si_shader *shader)
 	r600_resource_reference(&shader->bo, NULL);
 
 	FREE(shader->binary.code);
+	FREE(shader->binary.rodata);
 	FREE(shader->binary.relocs);
 	FREE(shader->binary.disasm_string);
 }
-- 
2.1.4



More information about the mesa-dev mailing list