mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
mesa: fix a VBO buffer reference leak in _mesa_bind_vertex_buffer
Fixes: 03ba57c6c5 - mesa: extend _mesa_bind_vertex_buffer to take ownership of the buffer reference
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23112>
This commit is contained in:
parent
2ae220f451
commit
ce3edf51be
1 changed files with 6 additions and 0 deletions
|
|
@ -304,6 +304,12 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
|
|||
}
|
||||
|
||||
vao->NonDefaultStateMask |= BITFIELD_BIT(index);
|
||||
} else {
|
||||
/* Since this function owns the vbo reference, it must release it if it
|
||||
* doesn't use it.
|
||||
*/
|
||||
if (take_vbo_ownership)
|
||||
_mesa_reference_buffer_object(ctx, &vbo, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue