[Mesa-dev] [PATCH 06/11] mesa: Add _mesa_is_array_texture helper

Brian Paul brianp at vmware.com
Tue Feb 10 08:10:03 PST 2015


On 02/10/2015 08:40 AM, Eduardo Lima Mitev wrote:
> From: Iago Toral Quiroga <itoral at igalia.com>
>
> ---
>   src/mesa/main/teximage.c | 22 ++++++++++++++++++++++
>   src/mesa/main/teximage.h |  3 +++
>   2 files changed, 25 insertions(+)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index c9c48bb..f0d0ef0 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -739,6 +739,28 @@ _mesa_is_proxy_texture(GLenum target)
>
>
>   /**
> + * Test if a target is an array target.
> + *
> + * \param target texture target.
> + *
> + * \return GL_TRUE if the target is an array target, GL_FALSE otherwise.
> + */
> +GLboolean
> +_mesa_is_array_texture(GLenum target)
> +{
> +   switch (target) {
> +   case GL_TEXTURE_1D_ARRAY:
> +   case GL_TEXTURE_2D_ARRAY:
> +   case GL_TEXTURE_CUBE_MAP_ARRAY:
> +   case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
> +      return GL_TRUE;
> +   default:
> +      return GL_FALSE;
> +   };
> +}
> +
> +
> +/**
>    * Return the proxy target which corresponds to the given texture target
>    */
>   static GLenum
> diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
> index 02b0eda..6a77ece 100644
> --- a/src/mesa/main/teximage.h
> +++ b/src/mesa/main/teximage.h
> @@ -66,6 +66,9 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat );
>   extern GLboolean
>   _mesa_is_proxy_texture(GLenum target);
>
> +extern GLboolean
> +_mesa_is_array_texture(GLenum target);
> +
>   extern struct gl_texture_image *
>   _mesa_new_texture_image( struct gl_context *ctx );
>
>

For non-API booleans, we're usually using bool/true/false nowadays.

But not a big deal.  Reviewed-by: Brian Paul <brianp at vmware.com>

-Brian



More information about the mesa-dev mailing list