[Mesa-dev] [PATCH] radv: Fix VK_KHR_image_format_list.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Sep 25 04:47:52 UTC 2017


Spec adding corner cases ...

Fixes: 969537d9358 "radv: Add support for more DCC compression with VK_KHR_image_format_list."
---
 src/amd/vulkan/radv_image.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index cff1b8d03f8..84e26cc37c1 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -122,7 +122,9 @@ radv_init_surface(struct radv_device *device,
 		          (const struct  VkImageFormatListCreateInfoKHR *)
 		                vk_find_struct_const(pCreateInfo->pNext,
 		                                     IMAGE_FORMAT_LIST_CREATE_INFO_KHR);
-		if (format_list) {
+
+		/* We have to ignore the existence of the list if viewFormatCount = 0 */
+		if (format_list && format_list->viewFormatCount) {
 			/* compatibility is transitive, so we only need to check
 			 * one format with everything else. */
 			for (unsigned i = 0; i < format_list->viewFormatCount; ++i) {
-- 
2.14.1



More information about the mesa-dev mailing list