From: Marek Olšák <marek.ol...@amd.com> The discard range codepath takes precedence, so if we get both unsynchronized and discard_range, choose unsynchronized. --- src/gallium/auxiliary/util/u_threaded_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index cbcd405..8e3cc34 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1330,22 +1330,24 @@ tc_improve_map_buffer_flags(struct threaded_context *tc, usage &= ~PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE; /* GL_AMD_pinned_memory and persistent mappings can't use staging * buffers. */ if (usage & (PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_PERSISTENT) || tres->is_user_ptr) usage &= ~PIPE_TRANSFER_DISCARD_RANGE; /* Unsychronized buffer mappings don't have to synchronize the thread. */ - if (usage & PIPE_TRANSFER_UNSYNCHRONIZED) + if (usage & PIPE_TRANSFER_UNSYNCHRONIZED) { + usage &= ~PIPE_TRANSFER_DISCARD_RANGE; usage |= TC_TRANSFER_MAP_THREADED_UNSYNC; /* notify the driver */ + } /* Never invalidate inside the driver and never infer "unsynchronized". */ return usage | TC_TRANSFER_MAP_NO_INVALIDATE | TC_TRANSFER_MAP_IGNORE_VALID_RANGE; } static void * tc_transfer_map(struct pipe_context *_pipe, struct pipe_resource *resource, unsigned level, -- 2.7.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev