zink: Take the tiling path for resources with modifiers.
authorEmma Anholt <emma@anholt.net>
Wed, 27 Jul 2022 18:59:22 +0000 (11:59 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 5 Aug 2022 00:23:16 +0000 (00:23 +0000)
transfer_map (the only consumer of the flag now) was doing direct mapping
on resources with modifiers (UBWC compressed images on turnip) and
accessing them as linear.  We definitely want the staging blit path
instead.

Fixes glReadPixels() from gbm surfaces on turnip.

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

src/gallium/drivers/zink/zink_resource.c

index 74c1c0f..fe2e0e3 100644 (file)
@@ -737,7 +737,7 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
       }
 
       if (optimal_tiling)
-         *optimal_tiling = ici.tiling == VK_IMAGE_TILING_OPTIMAL;
+         *optimal_tiling = ici.tiling != VK_IMAGE_TILING_LINEAR;
 
       if (ici.usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT)
          obj->transfer_dst = true;