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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:11:51 -06:00 committed by Marge Bot
parent cf76c3d17c
commit 0e284f71e1

View file

@ -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);