diff options
author | Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> | 2023-03-31 17:01:53 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2023-04-05 11:35:50 -0700 |
commit | b9df35b553119bf62aa7d5593f78bd60c29c46b8 (patch) | |
tree | 0ffc30269bea625e85d6b4731f22b1cf11a38b9a | |
parent | 9df373d050c7744f80aa34b2a323cd04172ac9af (diff) | |
download | mesa-b9df35b553119bf62aa7d5593f78bd60c29c46b8.tar.gz |
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 c1368685c3666520584174705da83af52391df0e)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json index 3bb9ffb6b43..389dedcf190 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 }, diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index c0ea0e22e50..b456db9d33c 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -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; |