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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Aug 13 10:24:46 2020 -0400

zink: set HOST_COHERENT bit for coherent resource creation

this allows memory to be mapped during draws without requiring a flush

Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>

---

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

diff --git a/src/gallium/drivers/zink/zink_resource.c 
b/src/gallium/drivers/zink/zink_resource.c
index 94a8beb0efa..2fdf275cfeb 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -290,6 +290,9 @@ resource_create(struct pipe_screen *pscreen,
         flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
    }
 
+   if (templ->flags & PIPE_RESOURCE_FLAG_MAP_COHERENT)
+      flags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
+
    VkMemoryAllocateInfo mai = {};
    mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
    mai.allocationSize = reqs.size;

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

Reply via email to