util/vbuf: fix index_bo leak

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 <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
(cherry picked from commit c1368685c3)
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2023-03-31 17:01:53 +02:00 committed by Dylan Baker
parent 9df373d050
commit b9df35b553
2 changed files with 3 additions and 1 deletions

View file

@ -661,7 +661,7 @@
"description": "util/vbuf: fix index_bo leak",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -1724,6 +1724,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;