[Mesa-dev] [PATCH 03/11] mesa: add mesa_type_is_double helper function

Ian Romanick idr at freedesktop.org
Fri Aug 22 17:14:50 PDT 2014


On 08/14/2014 03:52 AM, Dave Airlie wrote:
> This is a helper to return if a type is based on a double.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/program/prog_parameter.h | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
> index 6b3b3c2..9ee0f5e 100644
> --- a/src/mesa/program/prog_parameter.h
> +++ b/src/mesa/program/prog_parameter.h
> @@ -151,6 +151,28 @@ _mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list,
>                                  const gl_constant_value v[], GLuint vSize,
>                                  GLint *posOut, GLuint *swizzleOut);
>  
> +static INLINE GLboolean mesa_type_is_double(int dataType)

s/GLboolean/bool/ and

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> +{
> +   switch (dataType) {
> +   case GL_DOUBLE:
> +   case GL_DOUBLE_VEC2:
> +   case GL_DOUBLE_VEC3:
> +   case GL_DOUBLE_VEC4:
> +   case GL_DOUBLE_MAT2:
> +   case GL_DOUBLE_MAT2x3:
> +   case GL_DOUBLE_MAT2x4:
> +   case GL_DOUBLE_MAT3:
> +   case GL_DOUBLE_MAT3x2:
> +   case GL_DOUBLE_MAT3x4:
> +   case GL_DOUBLE_MAT4:
> +   case GL_DOUBLE_MAT4x2:
> +   case GL_DOUBLE_MAT4x3:
> +      return GL_TRUE;
> +   default:
> +      return GL_FALSE;
> +   }
> +}
> +
>  #ifdef __cplusplus
>  }
>  #endif
> 



More information about the mesa-dev mailing list