[Mesa-dev] [PATCH 4/4] mesa/varray: add interface support for ARB_vertex_type_2_10_10_10_rev

Eric Anholt eric at anholt.net
Mon Sep 5 11:14:43 PDT 2011


On Sun,  4 Sep 2011 15:05:05 +0100, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This just adds all the API check for vertex arrays using 2101010 types.
> 
> 2101010 is also useable with GL_BGRA.

Except for one tiny nit, this (along with 2/4) is:

Reviewed-by: Eric Anholt <eric at anholt.net>

> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/main/varray.c |   48 +++++++++++++++++++++++++++++++++++++++---------
>  1 files changed, 39 insertions(+), 9 deletions(-)
> 
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index 29a345f..e9a7b47 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -150,18 +160,26 @@ update_array(struct gl_context *ctx,
>     if (ctx->Extensions.EXT_vertex_array_bgra &&
>         sizeMax == BGRA_OR_4 &&
>         size == GL_BGRA) {
> -      if (type != GL_UNSIGNED_BYTE) {
> +      if (type != GL_UNSIGNED_BYTE &&
> +         (ctx->Extensions.ARB_vertex_type_2_10_10_10_rev &&
> +          (type != GL_UNSIGNED_INT_2_10_10_10_REV &&
> +           type != GL_INT_2_10_10_10_REV))) {
>           _mesa_error(ctx, GL_INVALID_VALUE, "%s(GL_BGRA/GLubyte)", func);
>           return;
>        }
>        format = GL_BGRA;
>        size = 4;
> -   }
> -   else if (size < sizeMin || size > sizeMax || size > 4) {
> +   } else if (size < sizeMin || size > sizeMax || size > 4) {
>        _mesa_error(ctx, GL_INVALID_VALUE, "%s(size=%d)", func, size);
>        return;
>     }

unrelated whitespace change.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110905/eebb9081/attachment.pgp>


More information about the mesa-dev mailing list