[Mesa-dev] [PATCH 3/4] glsl: Add method glsl_type::is_signed_vector()

Kenneth Graunke kenneth at whitecape.org
Thu Oct 7 17:07:07 PDT 2010


On Thursday 07 October 2010 16:34:47 Chad Versace wrote:
> From: Chad Versace <chad at chad-versace.us>
> 
> ---
>  src/glsl/glsl_types.h |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
> index dccab0a..da38d48 100644
> --- a/src/glsl/glsl_types.h
> +++ b/src/glsl/glsl_types.h
> @@ -249,6 +249,15 @@ struct glsl_type {
>     }
> 
>     /**
> +    * \brief Query whether or not a type is a vector
> +    */
> +   bool is_integer_vector() const

This function name doesn't match the one in your commit message...

> +   {
> +       return is_vector()
> +           and (base_type == GLSL_TYPE_INT or base_type ==
> GLSL_TYPE_UINT); +   }

Please use && and ||.

Rather than adding this function, you can pretty easily just do:
type->is_integer() && type->is_vector()


More information about the mesa-dev mailing list