From 4cd51efedbb516afa39ce043e9b2aa039534fd63 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 8 Mar 2022 17:17:00 -0800 Subject: [PATCH] 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: --- 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. */