anv: return VK_ERROR_OUT_OF_DEVICE_MEMORY when surface size is out of HW limits
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Fri, 12 Jan 2018 08:41:17 +0000 (09:41 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Thu, 18 Jan 2018 05:48:47 +0000 (06:48 +0100)
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_image.c

index 4d13e05e11f86be2e89b9d5990d809bb09d16983..72e408764d8cc5905d30d66cea6693945fcbc8b9 100644 (file)
@@ -335,10 +335,8 @@ make_surface(const struct anv_device *dev,
       .usage = usage,
       .tiling_flags = tiling_flags);
 
-   /* isl_surf_init() will fail only if provided invalid input. Invalid input
-    * is illegal in Vulkan.
-    */
-   assert(ok);
+   if (!ok)
+      return VK_ERROR_OUT_OF_DEVICE_MEMORY;
 
    image->planes[plane].aux_usage = ISL_AUX_USAGE_NONE;