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 <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8942>
This commit is contained in:
Mike Blumenkrantz 2020-08-13 10:24:46 -04:00 committed by Marge Bot
parent 152916b2bb
commit 4a7a226e49
1 changed files with 3 additions and 0 deletions

View File

@ -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;