gallium/u_threaded: don't sync the thread for all unsychronized mappings
authorMarek Olšák <marek.olsak@amd.com>
Wed, 11 Mar 2020 21:27:29 +0000 (17:27 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 17 Mar 2020 19:13:57 +0000 (19:13 +0000)
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>

src/gallium/auxiliary/util/u_threaded_context.c

index 30790949336317260248c9abe399931392fff30b..63ca61bb24997675064c43a1d32209345994423b 100644 (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;
    }