mesa/st: fix refcnt imbalance related to st_feedback_draw_vbo()

This issue is happening on radeonsi. The reference was allocated
via _mesa_get_bufferobj_reference() with setup_arrays().
The same reference was never freed.

For instance, this issue is triggered on radeonsi with
"piglit/bin/gl-1.0-rendermode-feedback -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: ff8c2a1748 ("mesa/bufferobj: rename bufferobj functions to be more consistent.")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22921>
This commit is contained in:
Patrick Lerda 2023-04-28 12:52:08 +02:00 committed by Marge Bot
parent 8bbd049a92
commit dc07e0d3fe

View file

@ -462,6 +462,8 @@ st_feedback_draw_vbo(struct gl_context *ctx,
if (vb_transfer[buf])
pipe_buffer_unmap(pipe, vb_transfer[buf]);
draw_set_mapped_vertex_buffer(draw, buf, NULL, 0);
if (!vbuffers[buf].is_user_buffer)
pipe_resource_reference(&vbuffers[buf].buffer.resource, NULL);
}
draw_set_vertex_buffers(draw, 0, 0, num_vbuffers, NULL);