[Mesa-dev] [PATCH 6/6] mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.

Eric Anholt eric at anholt.net
Sun Nov 27 13:52:29 PST 2011


On Sun, 27 Nov 2011 18:19:00 +0100, Mathias Fröhlich <Mathias.Froehlich at gmx.net> wrote:
> Replace the distinct struct gl_client_array members in gl_array_object by
> an array of gl_client_arrays indexed by VERT_ATTRIB_*.
> Renumber the vertex attributes slightly to keep the old semantics of the
> distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
> Update all occurances of the distinct struct members with the array
> equivalents.
> 
> Signed-off-by: Mathias Froehlich <Mathias.Froehlich at web.de>

> diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
> index f57579c..6c0dc7c 100644
> --- a/src/mesa/main/state.c
> +++ b/src/mesa/main/state.c
> @@ -83,98 +83,101 @@ update_arrays( struct gl_context *ctx )
>     struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
>     GLuint i, min = ~0;
>  
> -   /* find min of _MaxElement values for all enabled arrays */
> +   /* find min of _MaxElement values for all enabled arrays.
> +    * Note that the generic arrays always take precedence over
> +    * the legacy arrays.
> +    */

Not an issue for this patch, but I noticed that there's this
_mesa_update_array_object_max_element that does something similar, but
doesn't follow this rule and would trash the _MaxElement value.  Some
day, the body of this function should probably be moved to that one, and
state.c should call it.

It's also a bit disturbing that the code for which array to look at
based on program state is duplicated between vbo and here.

Other than the one patch with comments, the series overall looks like a
great clenaup and is:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- 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/20111127/a569b664/attachment.pgp>


More information about the mesa-dev mailing list