gallium/u_threaded: don't sync the thread for all unsychronized mappings

This was missing for the READ case. This improves glBegin/End performance.
(vbo maps with WRITE | READ | UNSYCHRONIZED)

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4153>
This commit is contained in:
Marek Olšák 2020-03-11 17:27:29 -04:00 committed by Marge Bot
parent 5960dadd1f
commit 99a29a20d2
1 changed files with 3 additions and 0 deletions

View File

@ -1393,6 +1393,9 @@ tc_improve_map_buffer_flags(struct threaded_context *tc,
/* Handle CPU reads trivially. */
if (usage & PIPE_TRANSFER_READ) {
if (usage & PIPE_TRANSFER_UNSYNCHRONIZED)
usage |= TC_TRANSFER_MAP_THREADED_UNSYNC; /* don't sync */
/* Drivers aren't allowed to do buffer invalidations. */
return usage & ~PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
}