{
struct zink_screen *screen = zink_screen(pctx->screen);
struct zink_query *query = (struct zink_query *)q;
- unsigned flags = PIPE_MAP_READ | PIPE_MAP_ONCE;
+ unsigned flags = PIPE_MAP_READ;
if (!wait)
flags |= PIPE_MAP_DONTBLOCK;
/* At this point, the buffer is always idle (we checked it above). */
usage |= PIPE_MAP_UNSYNCHRONIZED;
}
+ } else if (usage & PIPE_MAP_DONTBLOCK) {
+ /* sparse/device-local will always need to wait since it has to copy */
+ if (!res->obj->host_visible)
+ return NULL;
+ if (!zink_resource_usage_check_completion(screen, res, ZINK_RESOURCE_ACCESS_WRITE))
+ return NULL;
+ usage |= PIPE_MAP_UNSYNCHRONIZED;
} else if (!(usage & PIPE_MAP_UNSYNCHRONIZED) &&
(((usage & PIPE_MAP_READ) && !(usage & PIPE_MAP_PERSISTENT) && res->base.b.usage != PIPE_USAGE_STAGING) || !res->obj->host_visible)) {
assert(!(usage & (TC_TRANSFER_MAP_THREADED_UNSYNC | PIPE_MAP_THREAD_SAFE)));
ptr = map_resource(screen, res);
ptr = ((uint8_t *)ptr) + trans->offset;
}
- } else if (usage & PIPE_MAP_DONTBLOCK) {
- /* sparse/device-local will always need to wait since it has to copy */
- if (!res->obj->host_visible)
- return NULL;
- if (!zink_resource_usage_check_completion(screen, res, ZINK_RESOURCE_ACCESS_WRITE))
- return NULL;
- usage |= PIPE_MAP_UNSYNCHRONIZED;
}
if (!(usage & PIPE_MAP_UNSYNCHRONIZED)) {