From 8dfab9b382dd7f542ae806c9e80c4601ba848769 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 31 Mar 2022 17:56:37 +0200 Subject: [PATCH] dzn: Make sure the properties are all zero when the format is not supported Move one of the is_supported() check before we start filling the structure so we don't end up with a partially filled object when we return VK_ERROR_FORMAT_NOT_SUPPORTED (which deqp doesn't seem to like, so it's probably coming from a spec requirement). Reviewed-by: Erik Faye-Lund Part-of: --- src/microsoft/vulkan/dzn_device.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/microsoft/vulkan/dzn_device.cpp b/src/microsoft/vulkan/dzn_device.cpp index fe9d5cc8951..6227a7bb681 100644 --- a/src/microsoft/vulkan/dzn_device.cpp +++ b/src/microsoft/vulkan/dzn_device.cpp @@ -724,6 +724,9 @@ dzn_physical_device_get_image_format_properties(dzn_physical_device *pdev, (!(dfmt_info.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) || is_bgra4)) return VK_ERROR_FORMAT_NOT_SUPPORTED; + if (info->type == VK_IMAGE_TYPE_3D && info->tiling != VK_IMAGE_TILING_OPTIMAL) + return VK_ERROR_FORMAT_NOT_SUPPORTED; + bool is_3d = info->type == VK_IMAGE_TYPE_3D; uint32_t max_extent = dzn_physical_device_get_max_extent(is_3d); @@ -750,9 +753,6 @@ dzn_physical_device_get_image_format_properties(dzn_physical_device *pdev, properties->imageFormatProperties.maxExtent.depth = 1; break; case VK_IMAGE_TYPE_3D: - if (info->tiling != VK_IMAGE_TILING_OPTIMAL) - return VK_ERROR_FORMAT_NOT_SUPPORTED; - properties->imageFormatProperties.maxExtent.width = max_extent; properties->imageFormatProperties.maxExtent.height = max_extent; properties->imageFormatProperties.maxExtent.depth = max_extent;