pvr: return FORMAT_NOT_SUPPORTED for unknown image types

VK_KHR_maintenance5 requires the driver to accept values beyond the
defined enumerants for physical-device-level functions. Although the
VkImageType enumeration hasn't received any new enumerants since
VK_VERSION_1_0, it's possible that it gets extended in the future.

Change the code to return a VK_ERROR_FORMAT_NOT_SUPPORTED instead of
using UNREACHABLE (which triggers an assert).

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
This commit is contained in:
Icenowy Zheng 2026-05-14 16:20:39 +08:00 committed by Marge Bot
parent bd496a6aad
commit 582a791980

View file

@ -743,7 +743,8 @@ pvr_get_image_format_properties(struct pvr_physical_device *pdevice,
break;
default:
UNREACHABLE("Invalid image type.");
result = vk_error(pdevice, VK_ERROR_FORMAT_NOT_SUPPORTED);
goto err_unsupported_format;
}
/* The spec says maxMipLevels may be 1 when tiling is VK_IMAGE_TILING_LINEAR