[Mesa-dev] [PATCH] radeonsi/compute: Fix memory leak
Aaron Watry
awatry at gmail.com
Wed Mar 12 11:29:24 PDT 2014
Free shader buffer object for all kernels when deleting compute state.
Signed-off-by: Aaron Watry <awatry at gmail.com>
---
src/gallium/drivers/radeonsi/si_compute.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index e16feab..c0637f6 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -301,6 +301,12 @@ static void si_delete_compute_state(struct pipe_context *ctx, void* state){
}
if (program->kernels) {
+ for (int i = 0; i < program->num_kernels; i++){
+ if (program->kernels[i].bo){
+ si_pipe_shader_destroy(ctx, &program->kernels[i]);
+ }
+ }
+
FREE(program->kernels);
}
--
1.8.3.2
More information about the mesa-dev
mailing list