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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
This commit is contained in:
Emma Anholt
2022-08-04 20:28:40 -07:00
committed by Marge Bot
parent 41280ba289
commit f6bd494cfa
+2 -2
View File
@@ -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++) {