gallium/u_threaded: always map idle buffers unsynchronized

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10662>
This commit is contained in:
Marek Olšák 2021-05-05 20:32:45 -04:00 committed by Marge Bot
parent e8b2779455
commit 6ac085966b

View file

@ -1937,11 +1937,12 @@ tc_improve_map_buffer_flags(struct threaded_context *tc,
return usage & ~PIPE_MAP_DISCARD_WHOLE_RESOURCE;
}
/* See if the buffer range being mapped has never been initialized,
* in which case it can be mapped unsynchronized. */
/* See if the buffer range being mapped has never been initialized or
* the buffer is idle, in which case it can be mapped unsynchronized. */
if (!(usage & PIPE_MAP_UNSYNCHRONIZED) &&
!tres->is_shared &&
!util_ranges_intersect(&tres->valid_buffer_range, offset, offset + size))
((!tres->is_shared &&
!util_ranges_intersect(&tres->valid_buffer_range, offset, offset + size)) ||
!tc_is_buffer_busy(tc, tres, usage)))
usage |= PIPE_MAP_UNSYNCHRONIZED;
if (!(usage & PIPE_MAP_UNSYNCHRONIZED)) {