From 99a29a20d2e7b931c5ee6478665f0784eca2c0d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 11 Mar 2020 17:27:29 -0400 Subject: [PATCH] gallium/u_threaded: don't sync the thread for all unsychronized mappings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This was missing for the READ case. This improves glBegin/End performance. (vbo maps with WRITE | READ | UNSYCHRONIZED) Acked-by: Alyssa Rosenzweig Reviewed-by: Mathias Fröhlich Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 3079094..63ca61b 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -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; } -- 2.7.4