summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Watry <[email protected]>2014-03-12 13:26:10 -0500
committerAaron Watry <[email protected]>2014-03-15 11:59:19 -0500
commitec1ada73271b273da7f6bf64ff34d33f2df00a2d (patch)
tree113f3f11c833055d818a7b902804cbc286d09aa7
parent8199d149edd21d74ff70bed652e50d176136aab6 (diff)
radeonsi/compute: Fix memory leak
Free shader buffer object for all kernels when deleting compute state. Signed-off-by: Aaron Watry <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_compute.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index e16feab5234..c0637f6f7ec 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);
}