zink: limit host-visible bind-flags
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 4 Feb 2021 09:46:56 +0000 (10:46 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Feb 2021 11:24:50 +0000 (11:24 +0000)
The only type that should really require to be host-visible is the
display-target, and that's just because of our silly flush_frontbuffer
implementation.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>

src/gallium/drivers/zink/zink_resource.c

index 490ab36..6bc8a3d 100644 (file)
@@ -285,7 +285,8 @@ resource_create(struct pipe_screen *pscreen,
       res->aspect = aspect_from_format(templ->format);
 
       vkGetImageMemoryRequirements(screen->dev, res->image, &reqs);
-      if (templ->usage == PIPE_USAGE_STAGING || (screen->winsys && (templ->bind & (PIPE_BIND_SCANOUT|PIPE_BIND_DISPLAY_TARGET|PIPE_BIND_SHARED))))
+      if (templ->usage == PIPE_USAGE_STAGING ||
+          (screen->winsys && (templ->bind & PIPE_BIND_DISPLAY_TARGET)))
         flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
       else
         flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;