radeonsi: release saved resources in si_compute_copy_image
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 9 Jan 2020 13:41:48 +0000 (14:41 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 10 Jan 2020 07:41:35 +0000 (08:41 +0100)
Fixes: 1b25d340b79 ("radeonsi: use compute for resource_copy_region when possible")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_compute_blit.c

index accf04ff9d0ca47f143040de61a7d6bf74a1351d..18dafac1a45d6c6549d1bbcd7058e6e9e17dc070 100644 (file)
@@ -486,6 +486,9 @@ void si_compute_copy_image(struct si_context *sctx,
        ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 2, saved_image);
        ctx->set_constant_buffer(ctx, PIPE_SHADER_COMPUTE, 0, &saved_cb);
        si_compute_internal_end(sctx);
+       for (int i = 0; i < 2; i++)
+               pipe_resource_reference(&saved_image[i].resource, NULL);
+       pipe_resource_reference(&saved_cb.buffer, NULL);
 }
 
 void si_retile_dcc(struct si_context *sctx, struct si_texture *tex)