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: 8a963d122d ("r300g/swtcl: don't do stuff which is only for HWTCL")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27678>
(cherry picked from commit 3b90c46bdf)
This commit is contained in:
Patrick Lerda 2024-02-16 14:22:05 +01:00 committed by Eric Engestrom
parent 8dd90997d7
commit 0de687d8f8
2 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -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)