From 0de687d8f817b36324a5c239cd5f23422831aa17 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: (cherry picked from commit 3b90c46bdf9b536e6856b1ead5f8d806080728f7) --- .pick_status.json | 2 +- src/gallium/drivers/r300/r300_context.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 37108f61c24..aaf935074f6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2654,7 +2654,7 @@ "description": "r300: fix vertex_buffer related refcnt imbalance", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "8a963d122d4b67209214b0483084ba950814f42b", "notes": null diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index edad0071a5a..f77a6d6e97d 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)