summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-02-03 15:06:16 +0100
committerMathias Fröhlich <[email protected]>2018-02-06 21:20:14 +0100
commit2313c33e950a1b17e7787dd8a3b2f1e823d0cfd4 (patch)
treea885ab8dd272795da341bfd1747cb36d9de90a84 /src/mesa/program
parent6c691081a183aec51d5305592b9fa391ebb447ab (diff)
mesa: Use atomics for buffer objects reference counts.
The mutex is currently used for reference counting and updating the minmax index cache. The change uses atomics directly for reference counting and the mutex for the minmax cache. This is safe since the reference count is not modified beside in _mesa_reference_buffer_object where atomics aim to be used. While using the minmax cache, the calling code holds a reference to the buffer object. Thus unreferencing or even referencing the buffer object does not need to be serialized with accessing the minmax cache. The change reduces the time _mesa_reference_buffer_object_ takes by about a factor of two when looking at perf results for some of my favorite use cases. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/program')
0 files changed, 0 insertions, 0 deletions