zink: only unmap PIPE_MAP_ONCE in synchronous mode

this flag cannot be used to infer that a transfer_map call will be matched
by a transfer_unmap call when tc reordering is active

fixes #4600

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10114>
This commit is contained in:
Mike Blumenkrantz
2021-04-08 14:52:47 -04:00
committed by Marge Bot
parent b7a0265c27
commit 0dfc076743
+1 -1
View File
@@ -1083,7 +1083,7 @@ zink_transfer_unmap(struct pipe_context *pctx,
zink_transfer_flush_region(pctx, ptrans, &ptrans->box);
}
if (trans->base.b.usage & PIPE_MAP_ONCE && !trans->staging_res)
if (trans->base.b.usage & PIPE_MAP_ONCE && !trans->staging_res && !screen->threaded)
unmap_resource(screen, res);
if ((trans->base.b.usage & PIPE_MAP_PERSISTENT) && !(trans->base.b.usage & PIPE_MAP_COHERENT))
res->obj->persistent_maps--;