From f6bd494cfac760384807fb558a511db3ff9d495d Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 4 Aug 2022 20:28:40 -0700 Subject: [PATCH] tu: Treat viewFormatCount==0 as no format list. "If viewFormatCount is zero, pViewFormats is ignored and the image is created as if the VkImageFormatListCreateInfo structure were not included in the pNext chain of VkImageCreateInfo." Part-of: --- src/freedreno/vulkan/tu_image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 6630c812321..887119e1692 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -352,7 +352,7 @@ format_list_reinterprets_r8g8_r16(enum pipe_format format, const VkImageFormatLi /* If there's no format list, then the app may reinterpret to any compatible * format. */ - if (!fmt_list) + if (!fmt_list || !fmt_list->viewFormatCount) return true; bool has_r8g8 = false; @@ -374,7 +374,7 @@ format_list_has_swaps(const VkImageFormatListCreateInfo *fmt_list) /* If there's no format list, then the app may reinterpret to any compatible * format, and presumably one would have the swap set. */ - if (!fmt_list) + if (!fmt_list || !fmt_list->viewFormatCount) return true; for (uint32_t i = 0; i < fmt_list->viewFormatCount; i++) {