From c1368685c3666520584174705da83af52391df0e Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 31 Mar 2023 17:01:53 +0200 Subject: [PATCH] util/vbuf: fix index_bo leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When indices are unrolled we still have to release the index_bo references passed to us. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8272 Reviewed-by: Mike Blumenkrantz Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_vbuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index c16861f..7b8f955 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -1729,6 +1729,8 @@ void u_vbuf_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *inf } if (unroll_indices) { + if (!new_info.has_user_indices && info->take_index_buffer_ownership) + pipe_drop_resource_references(new_info.index.resource, 1); new_info.index_size = 0; new_draw.index_bias = 0; new_info.index_bounds_valid = true; -- 2.7.4