util/blitter: fix util_blitter_clear_buffer() refcnt imbalance
authorPatrick Lerda <patrick9876@free.fr>
Tue, 13 Jun 2023 13:23:53 +0000 (15:23 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Jun 2023 03:36:35 +0000 (03:36 +0000)
commit23c003b88c54e00436b4e2684e6227e79538cf5a
tree004ab6ad9d628bb242fddd932a96cb319a1678d8
parent3d22bcb7903d168e1c79252b283adbad4124e8bb
util/blitter: fix util_blitter_clear_buffer() refcnt imbalance

Indeed, the vertex state was restored using a specific
condition at the util_blitter_restore_vertex_states()
level. This change ensures that the condition is the
same when the vertex state is saved.

The function util_blitter_clear_buffer() is only called
by the r600 driver on pre-evergreen gpus.

This issue is triggered on a rv770 gpu with "piglit/bin/fbo-1d -auto -fbo"
or "piglit/bin/draw_buffers_gles2 -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 5f566faa4607 ("radeonsi: don't save and restore vertex buffers and elements for u_blitter")
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/23721>
src/gallium/auxiliary/util/u_blitter.c