[Mesa-dev] [PATCH] mesa: simplify _mesa_IsVertexArray()

Alejandro Piñeiro apinheiro at igalia.com
Tue Jun 20 14:47:38 UTC 2017


Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>

On 20/06/17 15:13, Samuel Pitoiset wrote:
> _mesa_lookup_vao() already returns NULL if id is zero.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/mesa/main/arrayobj.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
> index 82c00fbe826..7988a225baf 100644
> --- a/src/mesa/main/arrayobj.c
> +++ b/src/mesa/main/arrayobj.c
> @@ -605,14 +605,9 @@ _mesa_IsVertexArray( GLuint id )
>     GET_CURRENT_CONTEXT(ctx);
>     ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
>  
> -   if (id == 0)
> -      return GL_FALSE;
> -
>     obj = _mesa_lookup_vao(ctx, id);
> -   if (obj == NULL)
> -      return GL_FALSE;
>  
> -   return obj->EverBound;
> +   return obj ? obj->EverBound : GL_FALSE;
>  }
>  
>  



More information about the mesa-dev mailing list