[Mesa-dev] [PATCH] intel/isl: Add an assert to check zero width/height surface

Jason Ekstrand jason at jlekstrand.net
Wed Sep 21 18:46:14 UTC 2016


The genxml packing structs will assert this for you. I'm guessing it did
and you found it rather obtuse. :-)

Rb

On Sep 21, 2016 9:16 PM, "Anuj Phogat" <anuj.phogat at gmail.com> wrote:

> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/intel/isl/isl_surface_state.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/intel/isl/isl_surface_state.c
> b/src/intel/isl/isl_surface_state.c
> index 1a1a819..b20f767 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -249,6 +249,9 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
>     s.IntegerSurfaceFormat = isl_format_has_int_channel(s.SurfaceFormat);
>  #endif
>
> +   assert(info->surf->logical_level0_px.width > 0 &&
> +          info->surf->logical_level0_px.height > 0);
> +
>     s.Width = info->surf->logical_level0_px.width - 1;
>     s.Height = info->surf->logical_level0_px.height - 1;
>
> --
> 2.5.5
>
> _______________________________________________
> 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/20160921/ea0aa00a/attachment.html>


More information about the mesa-dev mailing list