Skip to content

glthread: fix upload buffer refcnt imbalance

Patrick Lerda requested to merge noblock/mesa:glthreadfixuploadbuffer into main

This issue is happening on the user_buffer_mask path (e.g. radeonsi).

The upload buffer processes a specific counter which is managed by _mesa_reference_buffer_object(), these calls should be properly balanced. Once the first counter requests a cleanup, the second counter which is equivalent to pipe_resource_reference() is taken into account. The second counter should be properly balanced as well.

This change ensures that these counters are properly balanced.

For instance, this issue is triggered on radeonsi with all piglit primitive-restart-draw-mode variants: "piglit/bin/primitive-restart-draw-mode line_loop -auto", "piglit/bin/primitive-restart-draw-mode polygon -auto"... while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 68a926a1 ("glthread: set GL_OUT_OF_MEMORY if we fail to upload vertices")

Signed-off-by: Patrick Lerda patrick9876@free.fr

Merge request reports