From 2c70b1a21771a4490279dd38fd6744e3c950df58 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Tue, 7 Jun 2022 08:54:34 +0200 Subject: [PATCH] v3d: release all color buffers on context destroy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All of them must be released on context destroy, and not only the first one. Signed-off-by: Juan A. Suarez Romero Reviewed-by: Alejandro PiƱeiro Part-of: --- src/gallium/drivers/v3d/v3d_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/v3d/v3d_context.c b/src/gallium/drivers/v3d/v3d_context.c index c7c6134461d..dd914035643 100644 --- a/src/gallium/drivers/v3d/v3d_context.c +++ b/src/gallium/drivers/v3d/v3d_context.c @@ -293,7 +293,9 @@ v3d_context_destroy(struct pipe_context *pctx) slab_destroy_child(&v3d->transfer_pool); - pipe_surface_reference(&v3d->framebuffer.cbufs[0], NULL); + for (int i = 0; i < v3d->framebuffer.nr_cbufs; i++) + pipe_surface_reference(&v3d->framebuffer.cbufs[i], NULL); + pipe_surface_reference(&v3d->framebuffer.zsbuf, NULL); if (v3d->sand8_blit_vs)