From: Jason Ekstrand Date: Thu, 21 Jul 2016 04:10:20 +0000 (-0700) Subject: anv/image: Assert that the image format is actually supported X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c8da91aa243dd5dcb4b529ce5be15b45384a50d2;p=mesa.git anv/image: Assert that the image format is actually supported Signed-off-by: Jason Ekstrand Reviewed-by: Kenneth Graunke Cc: "12.0" --- diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index e467e87d229..dff51bc78a3 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -137,10 +137,13 @@ make_surface(const struct anv_device *dev, image->extent = anv_sanitize_image_extent(vk_info->imageType, vk_info->extent); + enum isl_format format = anv_get_isl_format(&dev->info, vk_info->format, + aspect, vk_info->tiling); + assert(format != ISL_FORMAT_UNSUPPORTED); + ok = isl_surf_init(&dev->isl_dev, &anv_surf->isl, .dim = vk_to_isl_surf_dim[vk_info->imageType], - .format = anv_get_isl_format(&dev->info, vk_info->format, - aspect, vk_info->tiling), + .format = format, .width = image->extent.width, .height = image->extent.height, .depth = image->extent.depth,