gallium/u_threaded: disallow discard_range if map_buffer is unsynchronized

The discard range codepath takes precedence, so if we get both
unsynchronized and discard_range, choose unsynchronized.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2017-08-25 15:34:17 +02:00
parent 63e79a8a77
commit 28c4c55810
1 changed files with 3 additions and 1 deletions

View File

@ -1337,8 +1337,10 @@ tc_improve_map_buffer_flags(struct threaded_context *tc,
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 |