From: Jonathan Marek Date: Fri, 4 Oct 2019 19:57:28 +0000 (-0400) Subject: turnip: disable tiling as necessary X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4154e7d3ec1a37992c7a307febba1b237c47190;p=mesa.git turnip: disable tiling as necessary Signed-off-by: Jonathan Marek Reviewed-by: Kristian H. Kristensen --- diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 9c558407309..6ac1d48c188 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -185,9 +185,18 @@ tu_image_create(VkDevice _device, vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_MEMORY_IMAGE_CREATE_INFO) != NULL; - image->tile_mode = TILE6_LINEAR; - if (pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL && !create_info->scanout) - image->tile_mode = TILE6_3; + image->tile_mode = TILE6_3; + + if (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR || + /* compressed textures can't use tiling? */ + vk_format_is_compressed(image->vk_format) || + /* scanout needs to be linear (what about tiling modifiers?) */ + create_info->scanout || + /* image_to_image copy doesn't deal with tiling+swap */ + tu6_get_native_format(image->vk_format)->swap || + /* r8g8 formats are tiled different and could break image_to_image copy */ + (image->cpp == 2 && vk_format_get_nr_components(image->vk_format) == 2)) + image->tile_mode = TILE6_LINEAR; setup_slices(image, pCreateInfo);