[Mesa-dev] [PATCH 5/5] anv: Handle failure in make_hiz_surface_maybe()

Jason Ekstrand jason at jlekstrand.net
Mon Mar 6 23:24:50 UTC 2017


On Mon, Mar 6, 2017 at 10:18 AM, Chad Versace <chadversary at chromium.org>
wrote:

> make_ccs_surface_maybe() correctly handles failure
> isl_surf_get_ccs_surf(). When it fails, the resultant VkImage is still
> valid, just without a ccs surface.
>
> Same of make_mcs_surface_maybe() and isl_surf_get_mcs_surf().
>
> Fix make_hiz_surface_maybe() to do the same.
>

except that isl_surf_get_hiz_surf, as currently called, should *never*
fail.  When we do gen7 HiZ, we may want to handle failure though...  In any
case, we probably at least want a perf warning if HiZ surface creation
fails given that we expect it not to.


> ---
>  src/intel/vulkan/anv_image.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
> index 52a126fe995..9cb689b208d 100644
> --- a/src/intel/vulkan/anv_image.c
> +++ b/src/intel/vulkan/anv_image.c
> @@ -158,7 +158,9 @@ make_hiz_surface_maybe(const struct anv_device *dev,
>     } else {
>        ok = isl_surf_get_hiz_surf(&dev->isl_dev,
> &image->depth_surface.isl,
>                                   &image->aux_surface.isl);
> -      assert(ok);
> +      if (!ok)
> +         return;
> +
>        add_surface(image, &image->aux_surface);
>        image->aux_usage = ISL_AUX_USAGE_HIZ;
>     }
> --
> 2.12.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170306/1a51e6fd/attachment.html>


More information about the mesa-dev mailing list