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 <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
}
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;
}
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;
}
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;