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

Ian Romanick idr at freedesktop.org
Tue Feb 10 09:24:46 PST 2015


On 02/10/2015 08:10 AM, Brian Paul wrote:
> 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.

I was going to say the same thing. :)

> But not a big deal.  Reviewed-by: Brian Paul <brianp at vmware.com>
> 
> -Brian
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list