Mesa (master): zink: flush all resources with persistent maps on work batch before draw/compute

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 10 13:33:26 UTC 2021


Module: Mesa
Branch: master
Commit: e388fae89873dd425b2f021c2e52cfc83e1f5a2c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e388fae89873dd425b2f021c2e52cfc83e1f5a2c

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Aug 13 10:54:25 2020 -0400

zink: flush all resources with persistent maps on work batch before draw/compute

these require explicit memory sync on our part

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

---

 src/gallium/drivers/zink/zink_batch.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index 0ade85d13d1..a27e9bd681f 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -107,6 +107,19 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
    if (!batch->fence)
       return;
 
+   util_dynarray_foreach(&batch->persistent_resources, struct zink_resource*, res) {
+       struct zink_screen *screen = zink_screen(ctx->base.screen);
+       assert(!(*res)->offset);
+       VkMappedMemoryRange range = {
+          VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
+          NULL,
+          (*res)->mem,
+          (*res)->offset,
+          VK_WHOLE_SIZE,
+       };
+       vkFlushMappedMemoryRanges(screen->dev, 1, &range);
+   }
+
    VkSubmitInfo si = {};
    si.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
    si.waitSemaphoreCount = 0;



More information about the mesa-commit mailing list