summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-20 21:10:20 -0700
committerJason Ekstrand <[email protected]>2016-07-22 16:48:54 -0700
commitc8da91aa243dd5dcb4b529ce5be15b45384a50d2 (patch)
tree7c6ced1a4d13fc569875b390abc6c4587f57176e /src
parent34a39e91bac2c2f12389cded943019b79c7a9a06 (diff)
anv/image: Assert that the image format is actually supported
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_image.c7
1 files changed, 5 insertions, 2 deletions
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,