From dc3dd9690ba4df9d20248d1d066ddfbdbf8ed979 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 31 Mar 2022 17:52:45 +0200 Subject: [PATCH] dzn: Return a valid imageFormatProperties.maxMipLevels maxMipLevels is encoding the maximum number of MIP levels, but dzn_physical_device_get_max_mip_levels() return the maximum MIP level. Let's rename the function and add one to the returned value to fix the problem. 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 313bd464d1c..fe9d5cc8951 100644 --- a/src/microsoft/vulkan/dzn_device.cpp +++ b/src/microsoft/vulkan/dzn_device.cpp @@ -444,7 +444,7 @@ dzn_physical_device_get_mem_type_mask_for_resource(const dzn_physical_device *pd } static uint32_t -dzn_physical_device_get_max_mip_levels(bool is_3d) +dzn_physical_device_get_max_mip_level(bool is_3d) { return is_3d ? 11 : 14; } @@ -452,7 +452,7 @@ dzn_physical_device_get_max_mip_levels(bool is_3d) static uint32_t dzn_physical_device_get_max_extent(bool is_3d) { - uint32_t max_mip = dzn_physical_device_get_max_mip_levels(is_3d); + uint32_t max_mip = dzn_physical_device_get_max_mip_level(is_3d); return 1 << max_mip; } @@ -729,7 +729,7 @@ dzn_physical_device_get_image_format_properties(dzn_physical_device *pdev, if (info->tiling == VK_IMAGE_TILING_OPTIMAL && dfmt_info.Support1 & D3D12_FORMAT_SUPPORT1_MIP) - properties->imageFormatProperties.maxMipLevels = dzn_physical_device_get_max_mip_levels(is_3d); + properties->imageFormatProperties.maxMipLevels = dzn_physical_device_get_max_mip_level(is_3d) + 1; else properties->imageFormatProperties.maxMipLevels = 1;