[Mesa-dev] [PATCH 18/23] radeonsi: add si_shader_destroy_binary

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


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

---
 src/gallium/drivers/radeonsi/si_shader.c | 14 +++++++++-----
 src/gallium/drivers/radeonsi/si_shader.h |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 770f5b7..0773fff 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -4219,6 +4219,14 @@ out:
 	return r;
 }
 
+void si_shader_destroy_binary(struct radeon_shader_binary *binary)
+{
+	FREE(binary->code);
+	FREE(binary->rodata);
+	FREE(binary->relocs);
+	FREE(binary->disasm_string);
+}
+
 void si_shader_destroy(struct si_shader *shader)
 {
 	if (shader->gs_copy_shader) {
@@ -4230,9 +4238,5 @@ void si_shader_destroy(struct si_shader *shader)
 		r600_resource_reference(&shader->scratch_bo, NULL);
 
 	r600_resource_reference(&shader->bo, NULL);
-
-	FREE(shader->binary.code);
-	FREE(shader->binary.rodata);
-	FREE(shader->binary.relocs);
-	FREE(shader->binary.disasm_string);
+	si_shader_destroy_binary(&shader->binary);
 }
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 2220fc7..780383c 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -341,6 +341,7 @@ int si_compile_llvm(struct si_screen *sscreen,
 		    struct pipe_debug_callback *debug,
 		    unsigned processor);
 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_binary_read(struct si_screen *sscreen,
-- 
2.1.4



More information about the mesa-dev mailing list