summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-07-12 12:58:49 +0200
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:46 +0000
commit97f4827e2ec9c311a669f1e64827ce52b12b4250 (patch)
tree3ef5e776b9346efba4b86002519f771eee6ceadc /src
parenta005fae564b2b67f7c93207ac24fb92259231901 (diff)
zink: wait for transfer when reading
TODO: this could really benefit from a separate transfer-queue, I think. Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/zink/zink_resource.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 029e5e91942..781e865cbf8 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -456,6 +456,15 @@ zink_transfer_map(struct pipe_context *pctx,
false);
if (ret == false)
return NULL;
+
+ /* need to wait for rendering to finish */
+ struct pipe_fence_handle *fence = NULL;
+ pctx->flush(pctx, &fence, PIPE_FLUSH_HINT_FINISH);
+ if (fence) {
+ pctx->screen->fence_finish(pctx->screen, NULL, fence,
+ PIPE_TIMEOUT_INFINITE);
+ pctx->screen->fence_reference(pctx->screen, &fence, NULL);
+ }
}
VkResult result = vkMapMemory(screen->dev, staging_res->mem,