Skip to content

mesa: fix RefCount for upload buffer

Yogesh Mohan Marmithu requested to merge yogeshmohan/mesa:upload_buf_refcnt into main

even if the obj, offset and stride are same the RefCount has to be reduced since RefCount has been increased somewhere else.

Whenever vertex data is uploaded into upload_buffer RefCount is taken. For drivers with PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET enabled, the offset is calculated as negative number considering the start index given in glDrawRangeElements() API. Due to this there is chance that two vertices data uploaded in upload_buffer can have same offset. This patch ensures that for those bufObj also RefCount is decremented in _mesa_bind_vertex_buffer()

This patch fixes Xonotics performance issue. This patch fixes regression caused by patch !20624 (merged) /diffs?commit_id=616d595d

This change was suggested in !23020 (ff9eb48e)

Merge request reports