From 0e284f71e1a487369591d7028470584cad4e3140 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:11:51 -0600 Subject: [PATCH] nvk: Unconditionally zero image format properties It seems like this shouldn't be neded but some of the tests complain if we don't because they call vkGetPhysicalDeviceImageFormatProperties() and vkGetPhysicalDeviceImageFormatProperties2() and compare if they return identical results even if they return error. Zero is the reasonable thing to do if you don't support a format anyway because then it's a maximum extent, sample count, etc. of zero. Part-of: --- src/nouveau/vulkan/nvk_image.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 869d18c..451793b 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -83,6 +83,10 @@ nvk_GetPhysicalDeviceImageFormatProperties2( { VK_FROM_HANDLE(nvk_physical_device, pdevice, physicalDevice); + /* Initialize to zero in case we return VK_ERROR_FORMAT_NOT_SUPPORTED */ + memset(&pImageFormatProperties->imageFormatProperties, 0, + sizeof(pImageFormatProperties->imageFormatProperties)); + VkFormatFeatureFlags2KHR features = nvk_get_image_format_features(pdevice, pImageFormatInfo->format, pImageFormatInfo->tiling); -- 2.7.4