Mesa (main): zink: check actual mem props to determine if resource object is coherent

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 17 01:17:17 UTC 2021


Module: Mesa
Branch: main
Commit: 3c2f343618535bf9833111adb47c8e83f30810bc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c2f343618535bf9833111adb47c8e83f30810bc

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu May  6 12:55:07 2021 -0400

zink: check actual mem props to determine if resource object is coherent

this was correct for what it has been used for until now, but it will no
longer be correct going forward

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11397>

---

 src/gallium/drivers/zink/zink_resource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 6b235202d96..800d7e29805 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -494,9 +494,8 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
    mai.allocationSize = reqs.size;
    mai.memoryTypeIndex = get_memory_type_index(screen, &reqs, flags);
 
-   obj->coherent = flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
-
    VkMemoryType mem_type = screen->info.mem_props.memoryTypes[mai.memoryTypeIndex];
+   obj->coherent = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
    obj->host_visible = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
    if (templ->target == PIPE_BUFFER && !obj->coherent) {
       mai.allocationSize = reqs.size = align(reqs.size, screen->info.props.limits.nonCoherentAtomSize);



More information about the mesa-commit mailing list