Mesa (main): turnip: Disable tiling on 1D images.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 2 20:16:29 UTC 2022


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

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Mar  8 17:17:00 2022 -0800

turnip: Disable tiling on 1D images.

If we know the height is 1, then it would be a waste to align each
miplevel to tile height.  For non-mipmapped textures, it doesn't save us
memory (since you still align to 4 on the last miplevel), but it should be
better cache locality by not loading those unused lines.

Incidentally, this gets us some more coverage of swap != WZYX cases in CTS
tests, which often use optimal tiling without also testing linear.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>

---

 src/freedreno/vulkan/tu_image.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c
index 570486d5ff2..3587d60557c 100644
--- a/src/freedreno/vulkan/tu_image.c
+++ b/src/freedreno/vulkan/tu_image.c
@@ -402,6 +402,12 @@ tu_CreateImage(VkDevice _device,
       ubwc_enabled = false;
    }
 
+   /* No sense in tiling a 1D image, you'd just waste space and cache locality. */
+   if (pCreateInfo->imageType == VK_IMAGE_TYPE_1D) {
+      tile_mode = TILE6_LINEAR;
+      ubwc_enabled = false;
+   }
+
    enum pipe_format format =
       tu_vk_format_to_pipe_format(image->vk_format);
    /* Whether a view of the image with an R8G8 format could be made. */



More information about the mesa-commit mailing list