summaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-10-04 15:57:28 -0400
committerJonathan Marek <[email protected]>2019-10-15 07:56:19 -0400
commitf4154e7d3ec1a37992c7a307febba1b237c47190 (patch)
treec16be6d25e555f3402c83fe27edbceda661483ff /src/freedreno/vulkan
parent057c0f5caa809dc5c4ba5ceeac098b07eb70dd19 (diff)
turnip: disable tiling as necessary
Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/freedreno/vulkan')
-rw-r--r--src/freedreno/vulkan/tu_image.c15
1 files changed, 12 insertions, 3 deletions
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);