zink: handle PIPE_MAP_DONTBLOCK for buffer read maps
this is mostly used by queries Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9962>
This commit is contained in:
parent
cc7a187411
commit
a084d012a9
|
@ -849,9 +849,15 @@ buffer_transfer_map(struct zink_context *ctx, struct zink_resource *res, unsigne
|
|||
} else if ((usage & PIPE_MAP_READ) && !(usage & PIPE_MAP_PERSISTENT)) {
|
||||
assert(!(usage & (TC_TRANSFER_MAP_THREADED_UNSYNC | PIPE_MAP_THREAD_SAFE)));
|
||||
uint32_t latest_write = get_most_recent_access(res, ZINK_RESOURCE_ACCESS_WRITE);
|
||||
if (latest_write)
|
||||
if (latest_write) {
|
||||
if (usage & PIPE_MAP_DONTBLOCK) {
|
||||
if (latest_write == ctx->curr_batch ||
|
||||
!zink_check_batch_completion(ctx, latest_write))
|
||||
return NULL;
|
||||
} else
|
||||
zink_wait_on_batch(ctx, latest_write);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ptr) {
|
||||
ptr = map_resource(screen, res);
|
||||
|
|
Loading…
Reference in New Issue