Mesa (master): zink: only use host mem for staging resources with linear tiling

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 5 22:33:23 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Feb  3 17:29:24 2021 -0500

zink: only use host mem for staging resources with linear tiling

VK_EXT_4444_formats strikes again

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

---

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

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 82ef081e3d8..b2eaaedee15 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -429,7 +429,7 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
       }
 
       vkGetImageMemoryRequirements(screen->dev, obj->image, &reqs);
-      if (templ->usage == PIPE_USAGE_STAGING)
+      if (templ->usage == PIPE_USAGE_STAGING && ici.tiling == VK_IMAGE_TILING_LINEAR)
         flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
       else
         flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;



More information about the mesa-commit mailing list