radv: don't degrade tiling mode for small compressed or depth texture.
authorDave Airlie <airlied@redhat.com>
Mon, 21 Aug 2017 04:10:21 +0000 (14:10 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 24 Aug 2017 00:14:15 +0000 (01:14 +0100)
This is what radeonsi does, so we should do the same, also vega
doesn't support linear depth textures anyways.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c

index 78f52a8f729b1c6911a5613da87f09248b77dc02..684e804cc9924f5dc64a0c9b94dfdab7a2d8f3c9 100644 (file)
@@ -44,12 +44,16 @@ radv_choose_tiling(struct radv_device *Device,
                return RADEON_SURF_MODE_LINEAR_ALIGNED;
        }
 
-       /* Textures with a very small height are recommended to be linear. */
-       if (pCreateInfo->imageType == VK_IMAGE_TYPE_1D ||
-           /* Only very thin and long 2D textures should benefit from
-            * linear_aligned. */
-           (pCreateInfo->extent.width > 8 && pCreateInfo->extent.height <= 2))
-               return RADEON_SURF_MODE_LINEAR_ALIGNED;
+       if (!vk_format_is_compressed(pCreateInfo->format) &&
+           !vk_format_is_depth_or_stencil(pCreateInfo->format)) {
+               /* Textures with a very small height are recommended to be linear. */
+               if (pCreateInfo->imageType == VK_IMAGE_TYPE_1D ||
+                   /* Only very thin and long 2D textures should benefit from
+                    * linear_aligned. */
+                   (pCreateInfo->extent.width > 8 && pCreateInfo->extent.height <= 2))
+                       return RADEON_SURF_MODE_LINEAR_ALIGNED;
+
+       }
 
        /* MSAA resources must be 2D tiled. */
        if (pCreateInfo->samples > 1)