mesa: added gl_array_object::Weight array field

We don't really implement vertex weights but in the VBO code this
fixes and odd case for the legacy_array[] setup.  Before, the
vbo->draw_prims() call was always indicating that the vertex weight
array was present/enabled when it really wasn't.
This commit is contained in:
Brian Paul 2009-05-21 10:15:18 -06:00
parent 1889890c88
commit 8fa0cb2b42
3 changed files with 5 additions and 1 deletions

View file

@ -81,6 +81,7 @@ unbind_array_object_vbos(GLcontext *ctx, struct gl_array_object *obj)
GLuint i;
_mesa_reference_buffer_object(ctx, &obj->Vertex.BufferObj, NULL);
_mesa_reference_buffer_object(ctx, &obj->Weight.BufferObj, NULL);
_mesa_reference_buffer_object(ctx, &obj->Normal.BufferObj, NULL);
_mesa_reference_buffer_object(ctx, &obj->Color.BufferObj, NULL);
_mesa_reference_buffer_object(ctx, &obj->SecondaryColor.BufferObj, NULL);
@ -223,6 +224,7 @@ _mesa_initialize_array_object( GLcontext *ctx,
/* Init the individual arrays */
init_array(ctx, &obj->Vertex, 4, GL_FLOAT);
init_array(ctx, &obj->Weight, 1, GL_FLOAT);
init_array(ctx, &obj->Normal, 3, GL_FLOAT);
init_array(ctx, &obj->Color, 4, GL_FLOAT);
init_array(ctx, &obj->SecondaryColor, 4, GL_FLOAT);
@ -326,6 +328,7 @@ _mesa_update_array_object_max_element(GLcontext *ctx,
GLuint i, min = ~0;
min = update_min(min, &arrayObj->Vertex);
min = update_min(min, &arrayObj->Weight);
min = update_min(min, &arrayObj->Normal);
min = update_min(min, &arrayObj->Color);
min = update_min(min, &arrayObj->SecondaryColor);

View file

@ -1563,6 +1563,7 @@ struct gl_array_object
/** Conventional vertex arrays */
/*@{*/
struct gl_client_array Vertex;
struct gl_client_array Weight;
struct gl_client_array Normal;
struct gl_client_array Color;
struct gl_client_array SecondaryColor;

View file

@ -103,7 +103,7 @@ static void bind_array_obj( GLcontext *ctx )
* go away.
*/
exec->array.legacy_array[VERT_ATTRIB_POS] = &arrayObj->Vertex;
exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &vbo->legacy_currval[VERT_ATTRIB_WEIGHT];
exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &arrayObj->Weight;
exec->array.legacy_array[VERT_ATTRIB_NORMAL] = &arrayObj->Normal;
exec->array.legacy_array[VERT_ATTRIB_COLOR0] = &arrayObj->Color;
exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &arrayObj->SecondaryColor;