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

Author: Mike Blumenkrantz <[email protected]>
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 <[email protected]>
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;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to