mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +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> (cherry picked from commitce3edf51be)
This commit is contained in:
parent
c54295e993
commit
a8da5a0c0d
2 changed files with 7 additions and 1 deletions
|
|
@ -760,7 +760,7 @@
|
|||
"description": "mesa: fix a VBO buffer reference leak in _mesa_bind_vertex_buffer",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "03ba57c6c53214b19aa0fdb66c680f2cadc3bbd9"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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