Mesa (main): zink: ensure sparse allocations aren't marked host-visible

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 8 13:37:58 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jul  7 15:36:45 2021 -0400

zink: ensure sparse allocations aren't marked host-visible

Fixes: 5fee58bf599 ("zink: collapse host_visible and non-coherent alignment alloc cases")

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11768>

---

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

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 407c142df61..90920d8b66a 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -498,7 +498,8 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
 
    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->flags & PIPE_RESOURCE_FLAG_SPARSE))
+      obj->host_visible = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
    if (templ->target == PIPE_BUFFER && !obj->coherent && obj->host_visible) {
       mai.allocationSize = reqs.size = align(reqs.size, screen->info.props.limits.nonCoherentAtomSize);
    }



More information about the mesa-commit mailing list