radeonsi: add si_shader_destroy_binary
authorMarek Olšák <marek.olsak@amd.com>
Sun, 27 Dec 2015 23:53:29 +0000 (00:53 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 7 Jan 2016 17:26:06 +0000 (18:26 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h

index 498822483002f8c49a28164dbb51c0a6b3a78bb1..af32bd73d03fd98c048ecf063fea13364e73736d 100644 (file)
@@ -4218,6 +4218,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) {
@@ -4229,9 +4237,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);
 }
index 2220fc7b91b9bf01ccfe039be59931f5bbb774ff..780383c09ee9ef614e4f47000d93b8fe737c16de 100644 (file)
@@ -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,