[Mesa-dev] [PATCH V5 2/6] i965: Add helper functions for interpolation map

Paul Berry stereotype441 at gmail.com
Wed Jul 31 06:42:00 PDT 2013


On 31 July 2013 04:07, Chris Forbes <chrisf at ijw.co.nz> wrote:

> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/drivers/dri/i965/brw_context.h | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h
> b/src/mesa/drivers/dri/i965/brw_context.h
> index 7b5fd13..9580f29 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -420,6 +420,24 @@ struct interpolation_mode_map {
>     unsigned char mode[BRW_VARYING_SLOT_COUNT];
>  };
>
> +static inline int brw_any_flat_varyings(struct interpolation_mode_map
> *map)
> +{
> +   for (int i = 0; i < BRW_VARYING_SLOT_COUNT; i++)
> +      if (map->mode[i] == INTERP_QUALIFIER_FLAT)
> +         return 1;
> +
> +   return 0;
> +}
> +
> +static inline int brw_any_noperspective_varyings(struct
> interpolation_mode_map *map)
> +{
> +   for (int i = 0; i < BRW_VARYING_SLOT_COUNT; i++)
> +      if (map->mode[i] == INTERP_QUALIFIER_NOPERSPECTIVE)
> +         return 1;
> +
> +   return 0;
> +}
> +
>

Can we please make these functions return bool instead of int?  Using int
instead of bool is dangerous, and has caused real bugs (see
https://bugs.freedesktop.org/show_bug.cgi?id=54805 for example).

With that fixed, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


>
>  struct brw_sf_prog_data {
>     GLuint urb_read_length;
> --
> 1.8.3.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130731/374a5490/attachment-0001.html>


More information about the mesa-dev mailing list