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>
This commit is contained in:
Emma Anholt 2022-03-08 17:17:00 -08:00 committed by Marge Bot
parent 71fcb751eb
commit 4cd51efedb

View file

@ -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. */