summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/radeon_elf_util.c6
-rw-r--r--src/gallium/drivers/radeon/radeon_elf_util.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/radeon_elf_util.c b/src/gallium/drivers/radeon/radeon_elf_util.c
index ec39a890950..8cda57afff6 100644
--- a/src/gallium/drivers/radeon/radeon_elf_util.c
+++ b/src/gallium/drivers/radeon/radeon_elf_util.c
@@ -161,3 +161,9 @@ const unsigned char *radeon_shader_binary_config_start(
}
return binary->config;
}
+
+void radeon_shader_binary_free_members(struct radeon_shader_binary *binary) {
+ FREE(binary->code);
+ FREE(binary->config);
+ FREE(binary->rodata);
+}
diff --git a/src/gallium/drivers/radeon/radeon_elf_util.h b/src/gallium/drivers/radeon/radeon_elf_util.h
index 8095e2f19e7..ccac5638310 100644
--- a/src/gallium/drivers/radeon/radeon_elf_util.h
+++ b/src/gallium/drivers/radeon/radeon_elf_util.h
@@ -46,4 +46,9 @@ const unsigned char *radeon_shader_binary_config_start(
const struct radeon_shader_binary *binary,
uint64_t symbol_offset);
+/**
+ * Free all memory allocated for members of \p binary. This function does
+ * not free \p binary.
+ */
+void radeon_shader_binary_free_members(struct radeon_shader_binary *binary);
#endif /* RADEON_ELF_UTIL_H */