From 3b90c46bdf9b536e6856b1ead5f8d806080728f7 Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Fri, 16 Feb 2024 14:22:05 +0100 Subject: [PATCH] r300: fix vertex_buffer related refcnt imbalance Indeed, vertex_buffer was not properly freed. For instance, this issue is triggered with: "piglit/bin/fcc-read-after-clear blit rb -auto -fbo" while setting GALLIUM_REFCNT_LOG=refcnt.log. Fixes: 8a963d122d4b ("r300g/swtcl: don't do stuff which is only for HWTCL") Signed-off-by: Patrick Lerda Part-of: --- src/gallium/drivers/r300/r300_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index e644e25f6de..8bdea751e8e 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -86,6 +86,9 @@ static void r300_destroy_context(struct pipe_context* context) if (r300->draw) draw_destroy(r300->draw); + for (unsigned i = 0; i < r300->nr_vertex_buffers; i++) + pipe_vertex_buffer_unreference(&r300->vertex_buffer[i]); + if (r300->uploader) u_upload_destroy(r300->uploader); if (r300->context.stream_uploader)