From ee34e6ef716bb630440299ac1efbc2055ef09ffd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 12 Jun 2006 16:26:29 +0000 Subject: Add support for GL_APPLE_vertex_array_object. Several test programs and demos are also added. Adding basic support to drivers should be as easy as just enabling the extension, though thorough test would also be required. --- src/mesa/main/api_arrayelt.c | 36 ++-- src/mesa/main/api_validate.c | 10 +- src/mesa/main/arrayobj.c | 426 +++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/arrayobj.h | 70 +++++++ src/mesa/main/attrib.c | 52 ++++-- src/mesa/main/bufferobj.c | 80 ++++---- src/mesa/main/bufferobj.h | 2 + src/mesa/main/context.c | 1 + src/mesa/main/dd.h | 10 + src/mesa/main/dlist.c | 7 + src/mesa/main/enable.c | 40 ++-- src/mesa/main/enums.c | 227 +++++++++++------------ src/mesa/main/extensions.c | 2 + src/mesa/main/get.c | 306 +++++++++++++++---------------- src/mesa/main/get_gen.py | 102 +++++------ src/mesa/main/getstring.c | 16 +- src/mesa/main/mtypes.h | 26 ++- src/mesa/main/state.c | 83 +++++---- src/mesa/main/varray.c | 90 ++------- 19 files changed, 1042 insertions(+), 544 deletions(-) create mode 100644 src/mesa/main/arrayobj.c create mode 100644 src/mesa/main/arrayobj.h (limited to 'src/mesa/main') diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 9c65ae5b9a1..dda659bbc3f 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1078,38 +1078,38 @@ static void _ae_update_state( GLcontext *ctx ) GLuint i; /* conventional vertex arrays */ - if (ctx->Array.Index.Enabled) { - aa->array = &ctx->Array.Index; + if (ctx->Array.ArrayObj->Index.Enabled) { + aa->array = &ctx->Array.ArrayObj->Index; aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)]; aa++; } - if (ctx->Array.EdgeFlag.Enabled) { - aa->array = &ctx->Array.EdgeFlag; + if (ctx->Array.ArrayObj->EdgeFlag.Enabled) { + aa->array = &ctx->Array.ArrayObj->EdgeFlag; aa->offset = _gloffset_EdgeFlagv; aa++; } - if (ctx->Array.Normal.Enabled) { - aa->array = &ctx->Array.Normal; + if (ctx->Array.ArrayObj->Normal.Enabled) { + aa->array = &ctx->Array.ArrayObj->Normal; aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)]; aa++; } - if (ctx->Array.Color.Enabled) { - aa->array = &ctx->Array.Color; + if (ctx->Array.ArrayObj->Color.Enabled) { + aa->array = &ctx->Array.ArrayObj->Color; aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; aa++; } - if (ctx->Array.SecondaryColor.Enabled) { - aa->array = &ctx->Array.SecondaryColor; + if (ctx->Array.ArrayObj->SecondaryColor.Enabled) { + aa->array = &ctx->Array.ArrayObj->SecondaryColor; aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; aa++; } - if (ctx->Array.FogCoord.Enabled) { - aa->array = &ctx->Array.FogCoord; + if (ctx->Array.ArrayObj->FogCoord.Enabled) { + aa->array = &ctx->Array.ArrayObj->FogCoord; aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; aa++; } for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - struct gl_client_array *attribArray = &ctx->Array.TexCoord[i]; + struct gl_client_array *attribArray = &ctx->Array.ArrayObj->TexCoord[i]; if (attribArray->Enabled) { /* NOTE: we use generic glVertexAttribNV functions here. * If we ever remove GL_NV_vertex_program this will have to change. @@ -1126,7 +1126,7 @@ static void _ae_update_state( GLcontext *ctx ) /* generic vertex attribute arrays */ for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */ - struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i]; + struct gl_client_array *attribArray = &ctx->Array.ArrayObj->VertexAttrib[i]; if (attribArray->Enabled) { at->array = attribArray; /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV @@ -1151,17 +1151,17 @@ static void _ae_update_state( GLcontext *ctx ) } /* finally, vertex position */ - if (ctx->Array.VertexAttrib[0].Enabled) { + if (ctx->Array.ArrayObj->VertexAttrib[0].Enabled) { /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's * issued as the last (provoking) attribute). */ - aa->array = &ctx->Array.VertexAttrib[0]; + aa->array = &ctx->Array.ArrayObj->VertexAttrib[0]; assert(aa->array->Size >= 2); /* XXX fix someday? */ aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; aa++; } - else if (ctx->Array.Vertex.Enabled) { - aa->array = &ctx->Array.Vertex; + else if (ctx->Array.ArrayObj->Vertex.Enabled) { + aa->array = &ctx->Array.ArrayObj->Vertex; aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; aa++; } diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index d1c8f42e747..3d20ba7d144 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -60,8 +60,8 @@ _mesa_validate_DrawElements(GLcontext *ctx, _mesa_update_state(ctx); /* Always need vertex positions */ - if (!ctx->Array.Vertex.Enabled - && !(ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled)) + if (!ctx->Array.ArrayObj->Vertex.Enabled + && !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled)) return GL_FALSE; /* Vertex buffer object tests */ @@ -166,8 +166,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, _mesa_update_state(ctx); /* Always need vertex positions */ - if (!ctx->Array.Vertex.Enabled - && !(ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled)) + if (!ctx->Array.ArrayObj->Vertex.Enabled + && !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled)) return GL_FALSE; if (ctx->Const.CheckArrayBounds) { @@ -226,7 +226,7 @@ _mesa_validate_DrawArrays(GLcontext *ctx, _mesa_update_state(ctx); /* Always need vertex positions */ - if (!ctx->Array.Vertex.Enabled && !ctx->Array.VertexAttrib[0].Enabled) + if (!ctx->Array.ArrayObj->Vertex.Enabled && !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) return GL_FALSE; if (ctx->Const.CheckArrayBounds) { diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c new file mode 100644 index 00000000000..86f2e163194 --- /dev/null +++ b/src/mesa/main/arrayobj.c @@ -0,0 +1,426 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * (C) Copyright IBM Corporation 2006 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +/** + * \file arrayobj.c + * Functions for the GL_APPLE_vertex_array_object extension. + * + * \todo + * The code in this file borrows a lot from bufferobj.c. There's a certain + * amount of cruft left over from that origin that may be unnecessary. + * + * \author Ian Romanick + * \author Brian Paul + */ + + +#include "glheader.h" +#include "hash.h" +#include "imports.h" +#include "context.h" +#if FEATURE_ARB_vertex_buffer_object +#include "bufferobj.h" +#endif +#include "arrayobj.h" +#include "dispatch.h" + + +/** + * Look up the array object for the given ID. + * + * \returns + * Either a pointer to the array object with the specified ID or \c NULL for + * a non-existent ID. The spec defines ID 0 as being technically + * non-existent. + */ + +static INLINE struct gl_array_object * +lookup_arrayobj(GLcontext *ctx, GLuint id) +{ + return (id == 0) + ? NULL + : (struct gl_array_object *) _mesa_HashLookup(ctx->Shared->ArrayObjects, + id); +} + + +/** + * Allocate and initialize a new array object. + * + * This function is intended to be called via + * \c dd_function_table::NewArrayObject. + */ +struct gl_array_object * +_mesa_new_array_object( GLcontext *ctx, GLuint name ) +{ + struct gl_array_object *obj; + + (void) ctx; + + obj = MALLOC_STRUCT(gl_array_object); + _mesa_initialize_array_object(ctx, obj, name); + return obj; +} + + +/** + * Delete an array object. + * + * This function is intended to be called via + * \c dd_function_table::DeleteArrayObject. + */ +void +_mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ) +{ + (void) ctx; + + _mesa_free(obj); +} + + +void +_mesa_initialize_array_object( GLcontext *ctx, + struct gl_array_object *obj, + GLuint name ) +{ + GLuint i; + + + obj->Name = name; + + /* Vertex arrays */ + obj->Vertex.Size = 4; + obj->Vertex.Type = GL_FLOAT; + obj->Vertex.Stride = 0; + obj->Vertex.StrideB = 0; + obj->Vertex.Ptr = NULL; + obj->Vertex.Enabled = GL_FALSE; + obj->Vertex.Flags = CA_CLIENT_DATA; + obj->Normal.Type = GL_FLOAT; + obj->Normal.Stride = 0; + obj->Normal.StrideB = 0; + obj->Normal.Ptr = NULL; + obj->Normal.Enabled = GL_FALSE; + obj->Normal.Flags = CA_CLIENT_DATA; + obj->Color.Size = 4; + obj->Color.Type = GL_FLOAT; + obj->Color.Stride = 0; + obj->Color.StrideB = 0; + obj->Color.Ptr = NULL; + obj->Color.Enabled = GL_FALSE; + obj->Color.Flags = CA_CLIENT_DATA; + obj->SecondaryColor.Size = 4; + obj->SecondaryColor.Type = GL_FLOAT; + obj->SecondaryColor.Stride = 0; + obj->SecondaryColor.StrideB = 0; + obj->SecondaryColor.Ptr = NULL; + obj->SecondaryColor.Enabled = GL_FALSE; + obj->SecondaryColor.Flags = CA_CLIENT_DATA; + obj->FogCoord.Size = 1; + obj->FogCoord.Type = GL_FLOAT; + obj->FogCoord.Stride = 0; + obj->FogCoord.StrideB = 0; + obj->FogCoord.Ptr = NULL; + obj->FogCoord.Enabled = GL_FALSE; + obj->FogCoord.Flags = CA_CLIENT_DATA; + obj->Index.Type = GL_FLOAT; + obj->Index.Stride = 0; + obj->Index.StrideB = 0; + obj->Index.Ptr = NULL; + obj->Index.Enabled = GL_FALSE; + obj->Index.Flags = CA_CLIENT_DATA; + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + obj->TexCoord[i].Size = 4; + obj->TexCoord[i].Type = GL_FLOAT; + obj->TexCoord[i].Stride = 0; + obj->TexCoord[i].StrideB = 0; + obj->TexCoord[i].Ptr = NULL; + obj->TexCoord[i].Enabled = GL_FALSE; + obj->TexCoord[i].Flags = CA_CLIENT_DATA; + } + obj->EdgeFlag.Stride = 0; + obj->EdgeFlag.StrideB = 0; + obj->EdgeFlag.Ptr = NULL; + obj->EdgeFlag.Enabled = GL_FALSE; + obj->EdgeFlag.Flags = CA_CLIENT_DATA; + for (i = 0; i < VERT_ATTRIB_MAX; i++) { + obj->VertexAttrib[i].Size = 4; + obj->VertexAttrib[i].Type = GL_FLOAT; + obj->VertexAttrib[i].Stride = 0; + obj->VertexAttrib[i].StrideB = 0; + obj->VertexAttrib[i].Ptr = NULL; + obj->VertexAttrib[i].Enabled = GL_FALSE; + obj->VertexAttrib[i].Normalized = GL_FALSE; + obj->VertexAttrib[i].Flags = CA_CLIENT_DATA; + } + + +#if FEATURE_ARB_vertex_buffer_object + /* Vertex array buffers */ + obj->Vertex.BufferObj = ctx->Array.NullBufferObj; + obj->Normal.BufferObj = ctx->Array.NullBufferObj; + obj->Color.BufferObj = ctx->Array.NullBufferObj; + obj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj; + obj->FogCoord.BufferObj = ctx->Array.NullBufferObj; + obj->Index.BufferObj = ctx->Array.NullBufferObj; + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + obj->TexCoord[i].BufferObj = ctx->Array.NullBufferObj; + } + obj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj; + for (i = 0; i < VERT_ATTRIB_MAX; i++) { + obj->VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj; + } +#endif +} + + +/** + * Add the given array object to the array object pool. + */ +void +_mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj ) +{ + if (obj->Name > 0) { + /* insert into hash table */ + _mesa_HashInsert(ctx->Shared->ArrayObjects, obj->Name, obj); + } +} + + +/** + * Remove the given array object from the array object pool. + * Do not deallocate the array object though. + */ +void +_mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj ) +{ + if (obj->Name > 0) { + /* remove from hash table */ + _mesa_HashRemove(ctx->Shared->ArrayObjects, obj->Name); + } +} + + +/**********************************************************************/ +/* API Functions */ +/**********************************************************************/ + +/** + * Bind a new array. + * + * \todo + * The binding could be done more efficiently by comparing the non-NULL + * pointers in the old and new objects. The only arrays that are "dirty" are + * the ones that are non-NULL in either object. + */ +void GLAPIENTRY +_mesa_BindVertexArrayAPPLE( GLuint id ) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_array_object * const oldObj = ctx->Array.ArrayObj; + struct gl_array_object *newObj = NULL; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + + ASSERT(oldObj != NULL); + + if ( oldObj->Name == id ) + return; /* rebinding the same array object- no change */ + + /* + * Get pointer to new array object (newBufObj) + */ + if (id == 0) { + /* The spec says there is no array object named 0, but we use + * one internally because it simplifies things. + */ + newObj = ctx->Array.DefaultArrayObj; + } + else { + /* non-default array object */ + newObj = lookup_arrayobj(ctx, id); + if (!newObj) { + /* If this is a new array object id, allocate an array object now. + */ + + newObj = (*ctx->Driver.NewArrayObject)(ctx, id); + if (!newObj) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE"); + return; + } + _mesa_save_array_object(ctx, newObj); + } + } + + + ctx->NewState |= _NEW_ARRAY; + ctx->Array.NewState |= _NEW_ARRAY_ALL; + ctx->Array.ArrayObj = newObj; + + + /* Pass BindVertexArray call to device driver */ + if (ctx->Driver.BindArrayObject && newObj) + (*ctx->Driver.BindArrayObject)( ctx, newObj ); +} + + +/** + * Delete a set of array objects. + * + * \param n Number of array objects to delete. + * \param ids Array of \c n array object IDs. + */ +void GLAPIENTRY +_mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) +{ + GET_CURRENT_CONTEXT(ctx); + GLsizei i; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArrayAPPLE(n)"); + return; + } + + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + + for (i = 0; i < n; i++) { + struct gl_array_object *obj = lookup_arrayobj(ctx, ids[i]); + + if ( obj != NULL ) { + ASSERT( obj->Name == ids[i] ); + + + /* If the array object is currently bound, the spec says "the binding + * for that object reverts to zero and the default vertex array + * becomes current." + */ + if ( obj == ctx->Array.ArrayObj ) { + CALL_BindVertexArrayAPPLE( ctx->Exec, (0) ); + } + +#if FEATURE_ARB_vertex_buffer_object + /* Unbind any buffer objects that might be bound to arrays in + * this array object. + */ + _mesa_unbind_buffer_object( ctx, obj->Vertex.BufferObj ); + _mesa_unbind_buffer_object( ctx, obj->Normal.BufferObj ); + _mesa_unbind_buffer_object( ctx, obj->Color.BufferObj ); + _mesa_unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj ); + _mesa_unbind_buffer_object( ctx, obj->FogCoord.BufferObj ); + _mesa_unbind_buffer_object( ctx, obj->Index.BufferObj ); + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + _mesa_unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj ); + } + _mesa_unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj ); + for (i = 0; i < VERT_ATTRIB_MAX; i++) { + _mesa_unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj ); + } +#endif + + /* The ID is immediately freed for re-use */ + _mesa_remove_array_object(ctx, obj); + ctx->Driver.DeleteArrayObject(ctx, obj); + } + } + + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); +} + + +/** + * Generate a set of unique array object IDs and store them in \c buffer. + * + * \param n Number of IDs to generate. + * \param buffer Array of \c n locations to store the IDs. + */ +void GLAPIENTRY +_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint first; + GLint i; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGenVertexArraysAPPLE"); + return; + } + + if (!buffer) { + return; + } + + /* + * This must be atomic (generation and allocation of array object IDs) + */ + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + + first = _mesa_HashFindFreeKeyBlock(ctx->Shared->ArrayObjects, n); + + /* Allocate new, empty array objects and return identifiers */ + for (i = 0; i < n; i++) { + struct gl_array_object *obj; + GLuint name = first + i; + + obj = (*ctx->Driver.NewArrayObject)( ctx, name ); + if (!obj) { + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE"); + return; + } + _mesa_save_array_object(ctx, obj); + buffer[i] = first + i; + } + + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); +} + + +/** + * Determine if ID is the name of an array object. + * + * \param id ID of the potential array object. + * \return \c GL_TRUE if \c id is the name of a array object, + * \c GL_FALSE otherwise. + */ +GLboolean GLAPIENTRY +_mesa_IsVertexArrayAPPLE( GLuint id ) +{ + struct gl_array_object * obj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + + if (id == 0) + return GL_FALSE; + + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + obj = lookup_arrayobj(ctx, id); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); + + return (obj != NULL) ? GL_TRUE : GL_FALSE; +} diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h new file mode 100644 index 00000000000..c7d66ec1669 --- /dev/null +++ b/src/mesa/main/arrayobj.h @@ -0,0 +1,70 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * (C) Copyright IBM Corporation 2006 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef ARRAYOBJ_H +#define ARRAYOBJ_H + +#include "context.h" + +/** + * \file arrayobj.h + * Functions for the GL_APPLE_vertex_array_object extension. + * + * \author Ian Romanick + * \author Brian Paul + */ + +/* + * Internal functions + */ + +struct gl_array_object * _mesa_new_array_object( GLcontext *ctx, + GLuint name ); + +void _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ); + +void _mesa_initialize_array_object( GLcontext *ctx, + struct gl_array_object *obj, GLuint name ); + +void _mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj ); + +void _mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj ); + + + +/* + * API functions + */ + +void GLAPIENTRY _mesa_BindVertexArrayAPPLE( GLuint id ); + +void GLAPIENTRY _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids); + +void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer); + +GLboolean GLAPIENTRY _mesa_IsVertexArrayAPPLE( GLuint id ); + +#endif /* ARRAYOBJ_H */ diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index eaf20a5b73e..da6f1f902d2 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1210,17 +1210,17 @@ static void adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step) { GLuint i; - array->Vertex.BufferObj->RefCount += step; - array->Normal.BufferObj->RefCount += step; - array->Color.BufferObj->RefCount += step; - array->SecondaryColor.BufferObj->RefCount += step; - array->FogCoord.BufferObj->RefCount += step; - array->Index.BufferObj->RefCount += step; - array->EdgeFlag.BufferObj->RefCount += step; + array->ArrayObj->Vertex.BufferObj->RefCount += step; + array->ArrayObj->Normal.BufferObj->RefCount += step; + array->ArrayObj->Color.BufferObj->RefCount += step; + array->ArrayObj->SecondaryColor.BufferObj->RefCount += step; + array->ArrayObj->FogCoord.BufferObj->RefCount += step; + array->ArrayObj->Index.BufferObj->RefCount += step; + array->ArrayObj->EdgeFlag.BufferObj->RefCount += step; for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) - array->TexCoord[i].BufferObj->RefCount += step; + array->ArrayObj->TexCoord[i].BufferObj->RefCount += step; for (i = 0; i < VERT_ATTRIB_MAX; i++) - array->VertexAttrib[i].BufferObj->RefCount += step; + array->ArrayObj->VertexAttrib[i].BufferObj->RefCount += step; array->ArrayBufferObj->RefCount += step; array->ElementArrayBufferObj->RefCount += step; @@ -1272,8 +1272,16 @@ _mesa_PushClientAttrib(GLbitfield mask) } if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { struct gl_array_attrib *attr; + struct gl_array_object *obj; + attr = MALLOC_STRUCT( gl_array_attrib ); + obj = MALLOC_STRUCT( gl_array_object ); + MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); + MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); + + attr->ArrayObj = obj; + newnode = new_attrib_node( GL_CLIENT_VERTEX_ARRAY_BIT ); newnode->data = attr; newnode->next = head; @@ -1331,13 +1339,31 @@ _mesa_PopClientAttrib(void) sizeof(struct gl_pixelstore_attrib) ); ctx->NewState |= _NEW_PACKUNPACK; break; - case GL_CLIENT_VERTEX_ARRAY_BIT: + case GL_CLIENT_VERTEX_ARRAY_BIT: { + struct gl_array_attrib * data = + (struct gl_array_attrib *) attr->data; + adjust_buffer_object_ref_counts(&ctx->Array, -1); - MEMCPY( &ctx->Array, attr->data, - sizeof(struct gl_array_attrib) ); - /* decrement reference counts on buffer objects */ + + ctx->Array.ActiveTexture = data->ActiveTexture; + ctx->Array.LockFirst = data->LockFirst; + ctx->Array.LockCount = data->LockCount; + + _mesa_BindVertexArrayAPPLE( data->ArrayObj->Name ); + + MEMCPY( ctx->Array.ArrayObj, data->ArrayObj, + sizeof( struct gl_array_object ) ); + + FREE( data->ArrayObj ); + + /* FIXME: Should some bits in ctx->Array->NewState also be set + * FIXME: here? It seems like it should be set to inclusive-or + * FIXME: of the old ArrayObj->_Enabled and the new _Enabled. + */ + ctx->NewState |= _NEW_ARRAY; break; + } default: _mesa_problem( ctx, "Bad attrib flag in PopClientAttrib"); break; diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index d6cc78e18d5..6deb823f348 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -169,6 +169,22 @@ _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) } +void +_mesa_unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) +{ + if (bufObj != ctx->Array.NullBufferObj) { + bufObj->RefCount--; + if (bufObj->RefCount <= 0) { + ASSERT(ctx->Array.ArrayBufferObj != bufObj); + ASSERT(ctx->Array.ElementArrayBufferObj != bufObj); + ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj); + ASSERT(ctx->Driver.DeleteBuffer); + ctx->Driver.DeleteBuffer(ctx, bufObj); + } + } +} + + /** * Initialize a buffer object to default values. */ @@ -389,21 +405,6 @@ _mesa_init_buffer_objects( GLcontext *ctx ) ctx->Array.ArrayBufferObj = ctx->Array.NullBufferObj; ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj; - - /* Vertex array buffers */ - ctx->Array.Vertex.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.Normal.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.Color.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.SecondaryColor.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.FogCoord.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.Index.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - ctx->Array.TexCoord[i].BufferObj = ctx->Array.NullBufferObj; - } - ctx->Array.EdgeFlag.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - ctx->Array.VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj; - } } @@ -585,52 +586,52 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) ASSERT(bufObj->Name == ids[i]); - if (ctx->Array.Vertex.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->Vertex.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.Vertex.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->Vertex.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } - if (ctx->Array.Normal.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->Normal.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.Normal.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->Normal.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } - if (ctx->Array.Color.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->Color.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.Color.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->Color.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } - if (ctx->Array.SecondaryColor.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->SecondaryColor.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.SecondaryColor.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } - if (ctx->Array.FogCoord.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->FogCoord.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.FogCoord.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->FogCoord.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } - if (ctx->Array.Index.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->Index.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.Index.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->Index.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } - if (ctx->Array.EdgeFlag.BufferObj == bufObj) { + if (ctx->Array.ArrayObj->EdgeFlag.BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.EdgeFlag.BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } for (j = 0; j < MAX_TEXTURE_UNITS; j++) { - if (ctx->Array.TexCoord[j].BufferObj == bufObj) { + if (ctx->Array.ArrayObj->TexCoord[j].BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.TexCoord[j].BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->TexCoord[j].BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } } for (j = 0; j < VERT_ATTRIB_MAX; j++) { - if (ctx->Array.VertexAttrib[j].BufferObj == bufObj) { + if (ctx->Array.ArrayObj->VertexAttrib[j].BufferObj == bufObj) { bufObj->RefCount--; - ctx->Array.VertexAttrib[j].BufferObj = ctx->Array.NullBufferObj; + ctx->Array.ArrayObj->VertexAttrib[j].BufferObj = ctx->Array.NullBufferObj; ctx->Array.NullBufferObj->RefCount++; } } @@ -649,16 +650,9 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) _mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 ); } - /* The ID is immediately freed for re-use */ - _mesa_remove_buffer_object(ctx, bufObj); - bufObj->RefCount--; - if (bufObj->RefCount <= 0) { - ASSERT(ctx->Array.ArrayBufferObj != bufObj); - ASSERT(ctx->Array.ElementArrayBufferObj != bufObj); - ASSERT(ctx->Array.Vertex.BufferObj != bufObj); - ASSERT(ctx->Driver.DeleteBuffer); - ctx->Driver.DeleteBuffer(ctx, bufObj); - } + /* The ID is immediately freed for re-use */ + _mesa_remove_buffer_object(ctx, bufObj); + _mesa_unbind_buffer_object(ctx, bufObj); } } diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index bc1005332ca..05e27c984ea 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -83,6 +83,8 @@ _mesa_validate_pbo_access(GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *ptr); +extern void +_mesa_unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ); /* * API functions diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 2379c6d7668..08020dbac88 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -698,6 +698,7 @@ alloc_shared_state( GLcontext *ctx ) #endif ss->BufferObjects = _mesa_NewHashTable(); + ss->ArrayObjects = _mesa_NewHashTable(); ss->GL2Objects = _mesa_NewHashTable (); diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 4d9cea1e59e..6675d56ed82 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -832,6 +832,16 @@ struct dd_function_table { /*@}*/ + /** + * \name Vertex Array objects + */ + /*@{*/ + struct gl_array_object * (*NewArrayObject)(GLcontext *ctx, GLuint id); + void (*DeleteArrayObject)(GLcontext *ctx, struct gl_array_object *obj); + void (*BindArrayObject)(GLcontext *ctx, struct gl_array_object *obj); + /*@}*/ + + /** * \name Support for multiple T&L engines */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index cbf00f735ed..883fa730163 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -43,6 +43,7 @@ #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" #endif +#include "arrayobj.h" #include "clip.h" #include "colormac.h" #include "colortab.h" @@ -8031,6 +8032,12 @@ _mesa_init_dlist_table(struct _glapi_table *table) /* 268. GL_EXT_stencil_two_side */ SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT); + /* 273. GL_APPLE_vertex_array_object */ + SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE); + SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE); + SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE); + SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE); + /* ???. GL_EXT_depth_bounds_test */ SET_DepthBoundsEXT(table, save_DepthBoundsEXT); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index af54fea30bb..1d439e675f4 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -57,35 +57,35 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state ) switch (cap) { case GL_VERTEX_ARRAY: - var = &ctx->Array.Vertex.Enabled; + var = &ctx->Array.ArrayObj->Vertex.Enabled; flag = _NEW_ARRAY_VERTEX; break; case GL_NORMAL_ARRAY: - var = &ctx->Array.Normal.Enabled; + var = &ctx->Array.ArrayObj->Normal.Enabled; flag = _NEW_ARRAY_NORMAL; break; case GL_COLOR_ARRAY: - var = &ctx->Array.Color.Enabled; + var = &ctx->Array.ArrayObj->Color.Enabled; flag = _NEW_ARRAY_COLOR0; break; case GL_INDEX_ARRAY: - var = &ctx->Array.Index.Enabled; + var = &ctx->Array.ArrayObj->Index.Enabled; flag = _NEW_ARRAY_INDEX; break; case GL_TEXTURE_COORD_ARRAY: - var = &ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled; + var = &ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); break; case GL_EDGE_FLAG_ARRAY: - var = &ctx->Array.EdgeFlag.Enabled; + var = &ctx->Array.ArrayObj->EdgeFlag.Enabled; flag = _NEW_ARRAY_EDGEFLAG; break; case GL_FOG_COORDINATE_ARRAY_EXT: - var = &ctx->Array.FogCoord.Enabled; + var = &ctx->Array.ArrayObj->FogCoord.Enabled; flag = _NEW_ARRAY_FOGCOORD; break; case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &ctx->Array.SecondaryColor.Enabled; + var = &ctx->Array.ArrayObj->SecondaryColor.Enabled; flag = _NEW_ARRAY_COLOR1; break; @@ -109,7 +109,7 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION(NV_vertex_program, cap); { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - var = &ctx->Array.VertexAttrib[n].Enabled; + var = &ctx->Array.ArrayObj->VertexAttrib[n].Enabled; flag = _NEW_ARRAY_ATTRIB(n); } break; @@ -129,9 +129,9 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state ) *var = state; if (state) - ctx->Array._Enabled |= flag; + ctx->Array.ArrayObj->_Enabled |= flag; else - ctx->Array._Enabled &= ~flag; + ctx->Array.ArrayObj->_Enabled &= ~flag; if (ctx->Driver.Enable) { (*ctx->Driver.Enable)( ctx, cap, state ); @@ -1206,23 +1206,23 @@ _mesa_IsEnabled( GLenum cap ) * CLIENT STATE!!! */ case GL_VERTEX_ARRAY: - return (ctx->Array.Vertex.Enabled != 0); + return (ctx->Array.ArrayObj->Vertex.Enabled != 0); case GL_NORMAL_ARRAY: - return (ctx->Array.Normal.Enabled != 0); + return (ctx->Array.ArrayObj->Normal.Enabled != 0); case GL_COLOR_ARRAY: - return (ctx->Array.Color.Enabled != 0); + return (ctx->Array.ArrayObj->Color.Enabled != 0); case GL_INDEX_ARRAY: - return (ctx->Array.Index.Enabled != 0); + return (ctx->Array.ArrayObj->Index.Enabled != 0); case GL_TEXTURE_COORD_ARRAY: - return (ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled != 0); + return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled != 0); case GL_EDGE_FLAG_ARRAY: - return (ctx->Array.EdgeFlag.Enabled != 0); + return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0); case GL_FOG_COORDINATE_ARRAY_EXT: CHECK_EXTENSION(EXT_fog_coord); - return (ctx->Array.FogCoord.Enabled != 0); + return (ctx->Array.ArrayObj->FogCoord.Enabled != 0); case GL_SECONDARY_COLOR_ARRAY_EXT: CHECK_EXTENSION(EXT_secondary_color); - return (ctx->Array.SecondaryColor.Enabled != 0); + return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0); /* GL_EXT_histogram */ case GL_HISTOGRAM: @@ -1331,7 +1331,7 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(NV_vertex_program); { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - return (ctx->Array.VertexAttrib[n].Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0); } case GL_MAP1_VERTEX_ATTRIB0_4_NV: case GL_MAP1_VERTEX_ATTRIB1_4_NV: diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index ecda0bfb5ed..2b3a275dba8 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1593,6 +1593,7 @@ static const char enum_string_table[] = "GL_VENDOR\0" "GL_VERSION\0" "GL_VERTEX_ARRAY\0" + "GL_VERTEX_ARRAY_BINDING_APPLE\0" "GL_VERTEX_ARRAY_BUFFER_BINDING\0" "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB\0" "GL_VERTEX_ARRAY_POINTER\0" @@ -1654,7 +1655,7 @@ static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1617] = +static const enum_elt all_enums[1618] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -3214,70 +3215,70 @@ static const enum_elt all_enums[1617] = { 33142, 0x00001F00 }, /* GL_VENDOR */ { 33152, 0x00001F02 }, /* GL_VERSION */ { 33163, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 33179, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 33210, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 33245, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 33269, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 33290, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 33313, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 33334, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 33361, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 33389, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 33417, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 33445, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 33473, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 33501, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 33529, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 33556, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 33583, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 33610, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 33637, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 33664, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 33691, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 33718, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 33745, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 33772, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 33810, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 33852, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 33887, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 33925, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 33960, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 33992, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 34026, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 34058, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 34078, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 34100, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 34129, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 34150, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 34183, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 34215, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 34246, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 34276, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 34297, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 34324, 0x00000BA2 }, /* GL_VIEWPORT */ - { 34336, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 34352, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 34372, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 34403, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 34438, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 34466, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 34491, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 34518, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 34543, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 34567, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 34586, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 34600, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 34618, 0x00001506 }, /* GL_XOR */ - { 34625, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 34644, 0x00008757 }, /* GL_YCBCR_MESA */ - { 34658, 0x00000000 }, /* GL_ZERO */ - { 34666, 0x00000D16 }, /* GL_ZOOM_X */ - { 34676, 0x00000D17 }, /* GL_ZOOM_Y */ + { 33179, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 33209, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 33240, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 33275, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 33299, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 33320, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 33343, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 33364, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 33391, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 33419, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 33447, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 33475, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 33503, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 33531, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 33559, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 33586, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 33613, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 33640, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 33667, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 33694, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 33721, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 33748, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 33775, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 33802, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 33840, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 33882, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 33917, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 33955, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 33990, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 34022, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 34056, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 34088, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 34108, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 34130, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 34159, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 34180, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 34213, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 34245, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 34276, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 34306, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 34327, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 34354, 0x00000BA2 }, /* GL_VIEWPORT */ + { 34366, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 34382, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 34402, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 34433, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 34468, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 34496, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 34521, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 34548, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 34573, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 34597, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 34616, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 34630, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 34648, 0x00001506 }, /* GL_XOR */ + { 34655, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 34674, 0x00008757 }, /* GL_YCBCR_MESA */ + { 34688, 0x00000000 }, /* GL_ZERO */ + { 34696, 0x00000D16 }, /* GL_ZOOM_X */ + { 34706, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1236] = +static const unsigned reduced_enums[1237] = { - 26, /* GL_ALL_CLIENT_ATTRIB_BITS */ 389, /* GL_FALSE */ 566, /* GL_LINES */ 568, /* GL_LINE_LOOP */ @@ -3418,7 +3419,7 @@ static const unsigned reduced_enums[1236] = 1309, /* GL_STENCIL_WRITEMASK */ 710, /* GL_MATRIX_MODE */ 867, /* GL_NORMALIZE */ - 1598, /* GL_VIEWPORT */ + 1599, /* GL_VIEWPORT */ 841, /* GL_MODELVIEW_STACK_DEPTH */ 1099, /* GL_PROJECTION_STACK_DEPTH */ 1500, /* GL_TEXTURE_STACK_DEPTH */ @@ -3498,8 +3499,8 @@ static const unsigned reduced_enums[1236] = 513, /* GL_INDEX_OFFSET */ 1139, /* GL_RED_SCALE */ 1137, /* GL_RED_BIAS */ - 1615, /* GL_ZOOM_X */ - 1616, /* GL_ZOOM_Y */ + 1616, /* GL_ZOOM_X */ + 1617, /* GL_ZOOM_Y */ 476, /* GL_GREEN_SCALE */ 474, /* GL_GREEN_BIAS */ 86, /* GL_BLUE_SCALE */ @@ -3600,7 +3601,7 @@ static const unsigned reduced_enums[1236] = 246, /* GL_COPY */ 46, /* GL_AND_INVERTED */ 865, /* GL_NOOP */ - 1611, /* GL_XOR */ + 1612, /* GL_XOR */ 927, /* GL_OR */ 866, /* GL_NOR */ 380, /* GL_EQUIV */ @@ -3825,9 +3826,9 @@ static const unsigned reduced_enums[1236] = 503, /* GL_INDEX_ARRAY */ 1435, /* GL_TEXTURE_COORD_ARRAY */ 368, /* GL_EDGE_FLAG_ARRAY */ - 1561, /* GL_VERTEX_ARRAY_SIZE */ - 1563, /* GL_VERTEX_ARRAY_TYPE */ - 1562, /* GL_VERTEX_ARRAY_STRIDE */ + 1562, /* GL_VERTEX_ARRAY_SIZE */ + 1564, /* GL_VERTEX_ARRAY_TYPE */ + 1563, /* GL_VERTEX_ARRAY_STRIDE */ 873, /* GL_NORMAL_ARRAY_TYPE */ 872, /* GL_NORMAL_ARRAY_STRIDE */ 133, /* GL_COLOR_ARRAY_SIZE */ @@ -3839,7 +3840,7 @@ static const unsigned reduced_enums[1236] = 1441, /* GL_TEXTURE_COORD_ARRAY_TYPE */ 1440, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ 372, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1560, /* GL_VERTEX_ARRAY_POINTER */ + 1561, /* GL_VERTEX_ARRAY_POINTER */ 871, /* GL_NORMAL_ARRAY_POINTER */ 132, /* GL_COLOR_ARRAY_POINTER */ 506, /* GL_INDEX_ARRAY_POINTER */ @@ -3939,7 +3940,7 @@ static const unsigned reduced_enums[1236] = 251, /* GL_CULL_VERTEX_EXT */ 253, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 252, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1608, /* GL_WRAP_BORDER_SUN */ + 1609, /* GL_WRAP_BORDER_SUN */ 1419, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ 555, /* GL_LIGHT_MODEL_COLOR_CONTROL */ 1240, /* GL_SINGLE_COLOR */ @@ -4092,18 +4093,19 @@ static const unsigned reduced_enums[1236] = 913, /* GL_OPERAND1_ALPHA */ 919, /* GL_OPERAND2_ALPHA */ 925, /* GL_OPERAND3_ALPHA_NV */ - 1612, /* GL_YCBCR_422_APPLE */ + 1558, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + 1613, /* GL_YCBCR_422_APPLE */ 1549, /* GL_UNSIGNED_SHORT_8_8_APPLE */ 1551, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ 1242, /* GL_SLICE_ACCUM_SUN */ 1118, /* GL_QUAD_MESH_SUN */ 1522, /* GL_TRIANGLE_MESH_SUN */ - 1589, /* GL_VERTEX_PROGRAM_ARB */ - 1597, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1582, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - 1585, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - 1586, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - 1587, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + 1590, /* GL_VERTEX_PROGRAM_ARB */ + 1598, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1583, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + 1586, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + 1587, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + 1588, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ 277, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ 1076, /* GL_PROGRAM_LENGTH_ARB */ 1090, /* GL_PROGRAM_STRING_ARB */ @@ -4124,33 +4126,33 @@ static const unsigned reduced_enums[1236] = 702, /* GL_MATRIX7_NV */ 263, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 260, /* GL_CURRENT_MATRIX_ARB */ - 1592, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - 1594, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + 1593, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + 1595, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ 1088, /* GL_PROGRAM_PARAMETER_NV */ - 1584, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + 1585, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ 1092, /* GL_PROGRAM_TARGET_NV */ 1089, /* GL_PROGRAM_RESIDENT_NV */ 1507, /* GL_TRACK_MATRIX_NV */ 1508, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1590, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1591, /* GL_VERTEX_PROGRAM_BINDING_NV */ 1070, /* GL_PROGRAM_ERROR_POSITION_ARB */ 291, /* GL_DEPTH_CLAMP_NV */ - 1564, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1571, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1572, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1573, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1574, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1575, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1576, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1577, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1578, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1579, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1565, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1566, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1567, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1568, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1569, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1570, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 1565, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1572, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1573, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1574, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1575, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1576, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1577, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1578, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1579, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1580, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1566, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1567, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1568, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1569, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1570, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1571, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ 620, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ 627, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ 628, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ @@ -4189,14 +4191,14 @@ static const unsigned reduced_enums[1236] = 218, /* GL_COMPRESSED_TEXTURE_FORMATS */ 788, /* GL_MAX_VERTEX_UNITS_ARB */ 18, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1607, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1588, /* GL_VERTEX_BLEND_ARB */ + 1608, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1589, /* GL_VERTEX_BLEND_ARB */ 278, /* GL_CURRENT_WEIGHT_ARB */ - 1606, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1605, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1604, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1603, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1600, /* GL_WEIGHT_ARRAY_ARB */ + 1607, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1606, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1605, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1604, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1601, /* GL_WEIGHT_ARRAY_ARB */ 317, /* GL_DOT3_RGB */ 318, /* GL_DOT3_RGBA */ 216, /* GL_COMPRESSED_RGB_FXT1_3DFX */ @@ -4241,7 +4243,7 @@ static const unsigned reduced_enums[1236] = 843, /* GL_MODULATE_ADD_ATI */ 844, /* GL_MODULATE_SIGNED_ADD_ATI */ 845, /* GL_MODULATE_SUBTRACT_ATI */ - 1613, /* GL_YCBCR_MESA */ + 1614, /* GL_YCBCR_MESA */ 934, /* GL_PACK_INVERT_MESA */ 97, /* GL_BUFFER_SIZE */ 99, /* GL_BUFFER_USAGE */ @@ -4299,7 +4301,7 @@ static const unsigned reduced_enums[1236] = 1122, /* GL_QUERY_RESULT */ 1124, /* GL_QUERY_RESULT_AVAILABLE */ 785, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - 1583, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + 1584, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ 308, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ 307, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ 774, /* GL_MAX_TEXTURE_COORDS_ARB */ @@ -4314,7 +4316,7 @@ static const unsigned reduced_enums[1236] = 373, /* GL_ELEMENT_ARRAY_BUFFER */ 50, /* GL_ARRAY_BUFFER_BINDING */ 375, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1558, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1559, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ 869, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 130, /* GL_COLOR_ARRAY_BUFFER_BINDING */ 504, /* GL_INDEX_ARRAY_BUFFER_BINDING */ @@ -4322,8 +4324,8 @@ static const unsigned reduced_enums[1236] = 369, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ 1221, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ 410, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1601, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1580, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1602, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1581, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ 1075, /* GL_PROGRAM_INSTRUCTIONS_ARB */ 750, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ 1081, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ @@ -4349,7 +4351,7 @@ static const unsigned reduced_enums[1236] = 1096, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ 1512, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ 1130, /* GL_READ_ONLY */ - 1609, /* GL_WRITE_ONLY */ + 1610, /* GL_WRITE_ONLY */ 1132, /* GL_READ_WRITE */ 91, /* GL_BUFFER_ACCESS */ 93, /* GL_BUFFER_MAPPED */ @@ -4410,7 +4412,7 @@ static const unsigned reduced_enums[1236] = 803, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ 1202, /* GL_SAMPLES_PASSED */ 433, /* GL_FRAGMENT_SHADER_ARB */ - 1596, /* GL_VERTEX_SHADER_ARB */ + 1597, /* GL_VERTEX_SHADER_ARB */ 1086, /* GL_PROGRAM_OBJECT_ARB */ 1234, /* GL_SHADER_OBJECT_ARB */ 735, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ @@ -4513,6 +4515,7 @@ static const unsigned reduced_enums[1236] = 1217, /* GL_SCISSOR_BIT */ 25, /* GL_ALL_ATTRIB_BITS */ 850, /* GL_MULTISAMPLE_BIT */ + 26, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; #define Elements(x) sizeof(x)/sizeof(*x) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 5bd2515f053..3c85022d323 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -128,6 +128,7 @@ static const struct { { OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) }, { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, { ON, "GL_APPLE_packed_pixels", F(APPLE_packed_pixels) }, + { OFF, "GL_APPLE_vertex_array_object", F(APPLE_vertex_array_object) }, { OFF, "GL_ATI_blend_equation_separate", F(EXT_blend_equation_separate) }, { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)}, { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)}, @@ -213,6 +214,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_ARB_vertex_buffer_object ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; #endif + ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; #if FEATURE_ATI_fragment_shader ctx->Extensions.ATI_fragment_shader = GL_TRUE; #endif diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 2e2da7d933d..3da2e689888 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -961,79 +961,79 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomY); break; case GL_VERTEX_ARRAY: - params[0] = ctx->Array.Vertex.Enabled; + params[0] = ctx->Array.ArrayObj->Vertex.Enabled; break; case GL_VERTEX_ARRAY_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Array.Vertex.Size); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Size); break; case GL_VERTEX_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.Vertex.Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Type); break; case GL_VERTEX_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.Vertex.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Stride); break; case GL_VERTEX_ARRAY_COUNT_EXT: params[0] = INT_TO_BOOLEAN(0); break; case GL_NORMAL_ARRAY: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.Normal.Enabled); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Enabled); break; case GL_NORMAL_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.Normal.Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Type); break; case GL_NORMAL_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.Normal.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Stride); break; case GL_NORMAL_ARRAY_COUNT_EXT: params[0] = INT_TO_BOOLEAN(0); break; case GL_COLOR_ARRAY: - params[0] = ctx->Array.Color.Enabled; + params[0] = ctx->Array.ArrayObj->Color.Enabled; break; case GL_COLOR_ARRAY_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Array.Color.Size); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Size); break; case GL_COLOR_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.Color.Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Type); break; case GL_COLOR_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.Color.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Stride); break; case GL_COLOR_ARRAY_COUNT_EXT: params[0] = INT_TO_BOOLEAN(0); break; case GL_INDEX_ARRAY: - params[0] = ctx->Array.Index.Enabled; + params[0] = ctx->Array.ArrayObj->Index.Enabled; break; case GL_INDEX_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.Index.Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Type); break; case GL_INDEX_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.Index.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Stride); break; case GL_INDEX_ARRAY_COUNT_EXT: params[0] = INT_TO_BOOLEAN(0); break; case GL_TEXTURE_COORD_ARRAY: - params[0] = ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled; + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; break; case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = INT_TO_BOOLEAN(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Size); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); break; case GL_TEXTURE_COORD_ARRAY_TYPE: - params[0] = ENUM_TO_BOOLEAN(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); break; case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: params[0] = INT_TO_BOOLEAN(0); break; case GL_EDGE_FLAG_ARRAY: - params[0] = ctx->Array.EdgeFlag.Enabled; + params[0] = ctx->Array.ArrayObj->EdgeFlag.Enabled; break; case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = INT_TO_BOOLEAN(ctx->Array.EdgeFlag.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.Stride); break; case GL_EDGE_FLAG_ARRAY_COUNT_EXT: params[0] = INT_TO_BOOLEAN(0); @@ -1307,19 +1307,19 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_SECONDARY_COLOR_ARRAY_EXT: CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = ctx->Array.SecondaryColor.Enabled; + params[0] = ctx->Array.ArrayObj->SecondaryColor.Enabled; break; case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Array.SecondaryColor.Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Type); break; case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.SecondaryColor.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Stride); break; case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: CHECK_EXT1(EXT_secondary_color, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.SecondaryColor.Size); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Size); break; case GL_CURRENT_FOG_COORDINATE_EXT: CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); @@ -1330,15 +1330,15 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_FOG_COORDINATE_ARRAY_EXT: CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = ctx->Array.FogCoord.Enabled; + params[0] = ctx->Array.ArrayObj->FogCoord.Enabled; break; case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = ENUM_TO_BOOLEAN(ctx->Array.FogCoord.Type); + params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Type); break; case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.FogCoord.Stride); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Stride); break; case GL_FOG_COORDINATE_SOURCE_EXT: CHECK_EXT1(EXT_fog_coord, "GetBooleanv"); @@ -1410,67 +1410,67 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[0].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[0].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY1_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[1].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[1].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY2_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[2].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[2].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY3_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[3].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[3].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY4_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[4].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[4].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY5_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[5].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[5].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY6_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[6].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[6].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY7_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[7].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[7].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY8_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[8].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[8].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY9_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[9].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[9].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY10_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[10].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[10].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY11_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[11].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[11].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY12_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[12].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[12].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY13_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[13].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[13].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY14_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[14].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[14].Enabled; break; case GL_VERTEX_ATTRIB_ARRAY15_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); - params[0] = ctx->Array.VertexAttrib[15].Enabled; + params[0] = ctx->Array.ArrayObj->VertexAttrib[15].Enabled; break; case GL_MAP1_VERTEX_ATTRIB0_4_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); @@ -1582,35 +1582,35 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.Vertex.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.Normal.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.Color.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.Index.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.EdgeFlag.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.SecondaryColor.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Array.FogCoord.BufferObj->Name); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); @@ -2779,79 +2779,79 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.ZoomY; break; case GL_VERTEX_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.Vertex.Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Enabled); break; case GL_VERTEX_ARRAY_SIZE: - params[0] = (GLfloat)(ctx->Array.Vertex.Size); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Size); break; case GL_VERTEX_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.Vertex.Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Type); break; case GL_VERTEX_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.Vertex.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Stride); break; case GL_VERTEX_ARRAY_COUNT_EXT: params[0] = (GLfloat)(0); break; case GL_NORMAL_ARRAY: - params[0] = ENUM_TO_FLOAT(ctx->Array.Normal.Enabled); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Enabled); break; case GL_NORMAL_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.Normal.Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Type); break; case GL_NORMAL_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.Normal.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.Stride); break; case GL_NORMAL_ARRAY_COUNT_EXT: params[0] = (GLfloat)(0); break; case GL_COLOR_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.Color.Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Color.Enabled); break; case GL_COLOR_ARRAY_SIZE: - params[0] = (GLfloat)(ctx->Array.Color.Size); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Size); break; case GL_COLOR_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.Color.Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Color.Type); break; case GL_COLOR_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.Color.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Stride); break; case GL_COLOR_ARRAY_COUNT_EXT: params[0] = (GLfloat)(0); break; case GL_INDEX_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.Index.Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Index.Enabled); break; case GL_INDEX_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.Index.Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Index.Type); break; case GL_INDEX_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.Index.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.Stride); break; case GL_INDEX_ARRAY_COUNT_EXT: params[0] = (GLfloat)(0); break; case GL_TEXTURE_COORD_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); break; case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = (GLfloat)(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Size); + params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); break; case GL_TEXTURE_COORD_ARRAY_TYPE: - params[0] = ENUM_TO_FLOAT(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); break; case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: params[0] = (GLfloat)(0); break; case GL_EDGE_FLAG_ARRAY: - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.EdgeFlag.Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->EdgeFlag.Enabled); break; case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = (GLfloat)(ctx->Array.EdgeFlag.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.Stride); break; case GL_EDGE_FLAG_ARRAY_COUNT_EXT: params[0] = (GLfloat)(0); @@ -3125,19 +3125,19 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_SECONDARY_COLOR_ARRAY_EXT: CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.SecondaryColor.Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Enabled); break; case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Array.SecondaryColor.Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Type); break; case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.SecondaryColor.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Stride); break; case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: CHECK_EXT1(EXT_secondary_color, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.SecondaryColor.Size); + params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Size); break; case GL_CURRENT_FOG_COORDINATE_EXT: CHECK_EXT1(EXT_fog_coord, "GetFloatv"); @@ -3148,15 +3148,15 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_FOG_COORDINATE_ARRAY_EXT: CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.FogCoord.Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Enabled); break; case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = ENUM_TO_FLOAT(ctx->Array.FogCoord.Type); + params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Type); break; case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_fog_coord, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.FogCoord.Stride); + params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.Stride); break; case GL_FOG_COORDINATE_SOURCE_EXT: CHECK_EXT1(EXT_fog_coord, "GetFloatv"); @@ -3228,67 +3228,67 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[0].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY1_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[1].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY2_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[2].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY3_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[3].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY4_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[4].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY5_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[5].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY6_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[6].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY7_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[7].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY8_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[8].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY9_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[9].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY10_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[10].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY11_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[11].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY12_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[12].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY13_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[13].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY14_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[14].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY15_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[15].Enabled); + params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled); break; case GL_MAP1_VERTEX_ATTRIB0_4_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); @@ -3400,35 +3400,35 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.Vertex.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.Normal.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.Color.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.Index.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.EdgeFlag.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.SecondaryColor.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); - params[0] = (GLfloat)(ctx->Array.FogCoord.BufferObj->Name); + params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); @@ -4597,79 +4597,79 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.ZoomY); break; case GL_VERTEX_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.Vertex.Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Vertex.Enabled); break; case GL_VERTEX_ARRAY_SIZE: - params[0] = ctx->Array.Vertex.Size; + params[0] = ctx->Array.ArrayObj->Vertex.Size; break; case GL_VERTEX_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.Vertex.Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Vertex.Type); break; case GL_VERTEX_ARRAY_STRIDE: - params[0] = ctx->Array.Vertex.Stride; + params[0] = ctx->Array.ArrayObj->Vertex.Stride; break; case GL_VERTEX_ARRAY_COUNT_EXT: params[0] = 0; break; case GL_NORMAL_ARRAY: - params[0] = ENUM_TO_INT(ctx->Array.Normal.Enabled); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Enabled); break; case GL_NORMAL_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.Normal.Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Type); break; case GL_NORMAL_ARRAY_STRIDE: - params[0] = ctx->Array.Normal.Stride; + params[0] = ctx->Array.ArrayObj->Normal.Stride; break; case GL_NORMAL_ARRAY_COUNT_EXT: params[0] = 0; break; case GL_COLOR_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.Color.Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Color.Enabled); break; case GL_COLOR_ARRAY_SIZE: - params[0] = ctx->Array.Color.Size; + params[0] = ctx->Array.ArrayObj->Color.Size; break; case GL_COLOR_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.Color.Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Color.Type); break; case GL_COLOR_ARRAY_STRIDE: - params[0] = ctx->Array.Color.Stride; + params[0] = ctx->Array.ArrayObj->Color.Stride; break; case GL_COLOR_ARRAY_COUNT_EXT: params[0] = 0; break; case GL_INDEX_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.Index.Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Index.Enabled); break; case GL_INDEX_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.Index.Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Index.Type); break; case GL_INDEX_ARRAY_STRIDE: - params[0] = ctx->Array.Index.Stride; + params[0] = ctx->Array.ArrayObj->Index.Stride; break; case GL_INDEX_ARRAY_COUNT_EXT: params[0] = 0; break; case GL_TEXTURE_COORD_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); break; case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = ctx->Array.TexCoord[ctx->Array.ActiveTexture].Size; + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size; break; case GL_TEXTURE_COORD_ARRAY_TYPE: - params[0] = ENUM_TO_INT(ctx->Array.TexCoord[ctx->Array.ActiveTexture].Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = ctx->Array.TexCoord[ctx->Array.ActiveTexture].Stride; + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride; break; case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: params[0] = 0; break; case GL_EDGE_FLAG_ARRAY: - params[0] = BOOLEAN_TO_INT(ctx->Array.EdgeFlag.Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->EdgeFlag.Enabled); break; case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = ctx->Array.EdgeFlag.Stride; + params[0] = ctx->Array.ArrayObj->EdgeFlag.Stride; break; case GL_EDGE_FLAG_ARRAY_COUNT_EXT: params[0] = 0; @@ -4943,19 +4943,19 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_SECONDARY_COLOR_ARRAY_EXT: CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.SecondaryColor.Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Enabled); break; case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Array.SecondaryColor.Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Type); break; case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = ctx->Array.SecondaryColor.Stride; + params[0] = ctx->Array.ArrayObj->SecondaryColor.Stride; break; case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: CHECK_EXT1(EXT_secondary_color, "GetIntegerv"); - params[0] = ctx->Array.SecondaryColor.Size; + params[0] = ctx->Array.ArrayObj->SecondaryColor.Size; break; case GL_CURRENT_FOG_COORDINATE_EXT: CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); @@ -4966,15 +4966,15 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_FOG_COORDINATE_ARRAY_EXT: CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.FogCoord.Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->FogCoord.Enabled); break; case GL_FOG_COORDINATE_ARRAY_TYPE_EXT: CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = ENUM_TO_INT(ctx->Array.FogCoord.Type); + params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->FogCoord.Type); break; case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); - params[0] = ctx->Array.FogCoord.Stride; + params[0] = ctx->Array.ArrayObj->FogCoord.Stride; break; case GL_FOG_COORDINATE_SOURCE_EXT: CHECK_EXT1(EXT_fog_coord, "GetIntegerv"); @@ -5046,67 +5046,67 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[0].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY1_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[1].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY2_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[2].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY3_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[3].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY4_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[4].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY5_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[5].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY6_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[6].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY7_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[7].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY8_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[8].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY9_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[9].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY10_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[10].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY11_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[11].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY12_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[12].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY13_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[13].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY14_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[14].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled); break; case GL_VERTEX_ATTRIB_ARRAY15_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[15].Enabled); + params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled); break; case GL_MAP1_VERTEX_ATTRIB0_4_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); @@ -5218,35 +5218,35 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.Vertex.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name; break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.Normal.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name; break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.Color.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name; break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.Index.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name; break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; + params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.EdgeFlag.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name; break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.SecondaryColor.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name; break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); - params[0] = ctx->Array.FogCoord.BufferObj->Name; + params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name; break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 78d50663550..e6e1828800f 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -463,35 +463,35 @@ StateVars = [ ( "GL_ZOOM_Y", GLfloat, ["ctx->Pixel.ZoomY"], "", None ), # Vertex arrays - ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.Vertex.Enabled"], "", None ), - ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.Vertex.Size"], "", None ), - ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.Vertex.Type"], "", None ), - ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.Vertex.Stride"], "", None ), + ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Vertex.Enabled"], "", None ), + ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Vertex.Size"], "", None ), + ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Vertex.Type"], "", None ), + ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Vertex.Stride"], "", None ), ( "GL_VERTEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.Normal.Enabled"], "", None ), - ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.Normal.Type"], "", None ), - ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.Normal.Stride"], "", None ), + ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.ArrayObj->Normal.Enabled"], "", None ), + ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Normal.Type"], "", None ), + ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Normal.Stride"], "", None ), ( "GL_NORMAL_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.Color.Enabled"], "", None ), - ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.Color.Size"], "", None ), - ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.Color.Type"], "", None ), - ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.Color.Stride"], "", None ), + ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Color.Enabled"], "", None ), + ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Color.Size"], "", None ), + ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Color.Type"], "", None ), + ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Color.Stride"], "", None ), ( "GL_COLOR_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_INDEX_ARRAY", GLboolean, ["ctx->Array.Index.Enabled"], "", None ), - ( "GL_INDEX_ARRAY_TYPE", GLenum, ["ctx->Array.Index.Type"], "", None ), - ( "GL_INDEX_ARRAY_STRIDE", GLint, ["ctx->Array.Index.Stride"], "", None ), + ( "GL_INDEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Index.Enabled"], "", None ), + ( "GL_INDEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Index.Type"], "", None ), + ( "GL_INDEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Index.Stride"], "", None ), ( "GL_INDEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), ( "GL_TEXTURE_COORD_ARRAY", GLboolean, - ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ), + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ), ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint, - ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Size"], "", None ), + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size"], "", None ), ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum, - ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Type"], "", None ), + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type"], "", None ), ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint, - ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ), + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ), ( "GL_TEXTURE_COORD_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), - ( "GL_EDGE_FLAG_ARRAY", GLboolean, ["ctx->Array.EdgeFlag.Enabled"], "", None ), - ( "GL_EDGE_FLAG_ARRAY_STRIDE", GLint, ["ctx->Array.EdgeFlag.Stride"], "", None ), + ( "GL_EDGE_FLAG_ARRAY", GLboolean, ["ctx->Array.ArrayObj->EdgeFlag.Enabled"], "", None ), + ( "GL_EDGE_FLAG_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->EdgeFlag.Stride"], "", None ), ( "GL_EDGE_FLAG_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), # GL_ARB_multitexture @@ -641,23 +641,23 @@ StateVars = [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]"], "FLUSH_CURRENT(ctx, 0);", ["EXT_secondary_color"] ), ( "GL_SECONDARY_COLOR_ARRAY_EXT", GLboolean, - ["ctx->Array.SecondaryColor.Enabled"], "", ["EXT_secondary_color"] ), + ["ctx->Array.ArrayObj->SecondaryColor.Enabled"], "", ["EXT_secondary_color"] ), ( "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT", GLenum, - ["ctx->Array.SecondaryColor.Type"], "", ["EXT_secondary_color"] ), + ["ctx->Array.ArrayObj->SecondaryColor.Type"], "", ["EXT_secondary_color"] ), ( "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT", GLint, - ["ctx->Array.SecondaryColor.Stride"], "", ["EXT_secondary_color"] ), + ["ctx->Array.ArrayObj->SecondaryColor.Stride"], "", ["EXT_secondary_color"] ), ( "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT", GLint, - ["ctx->Array.SecondaryColor.Size"], "", ["EXT_secondary_color"] ), + ["ctx->Array.ArrayObj->SecondaryColor.Size"], "", ["EXT_secondary_color"] ), # GL_EXT_fog_coord ( "GL_CURRENT_FOG_COORDINATE_EXT", GLfloat, ["ctx->Current.Attrib[VERT_ATTRIB_FOG][0]"], "FLUSH_CURRENT(ctx, 0);", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_ARRAY_EXT", GLboolean, ["ctx->Array.FogCoord.Enabled"], + ( "GL_FOG_COORDINATE_ARRAY_EXT", GLboolean, ["ctx->Array.ArrayObj->FogCoord.Enabled"], "", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_ARRAY_TYPE_EXT", GLenum, ["ctx->Array.FogCoord.Type"], + ( "GL_FOG_COORDINATE_ARRAY_TYPE_EXT", GLenum, ["ctx->Array.ArrayObj->FogCoord.Type"], "", ["EXT_fog_coord"] ), - ( "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT", GLint, ["ctx->Array.FogCoord.Stride"], + ( "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT", GLint, ["ctx->Array.ArrayObj->FogCoord.Stride"], "", ["EXT_fog_coord"] ), ( "GL_FOG_COORDINATE_SOURCE_EXT", GLenum, ["ctx->Fog.FogCoordinateSource"], "", ["EXT_fog_coord"] ), @@ -709,37 +709,37 @@ StateVars = [ ["(ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY0_NV", GLboolean, - ["ctx->Array.VertexAttrib[0].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[0].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY1_NV", GLboolean, - ["ctx->Array.VertexAttrib[1].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[1].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY2_NV", GLboolean, - ["ctx->Array.VertexAttrib[2].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[2].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY3_NV", GLboolean, - ["ctx->Array.VertexAttrib[3].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[3].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY4_NV", GLboolean, - ["ctx->Array.VertexAttrib[4].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[4].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY5_NV", GLboolean, - ["ctx->Array.VertexAttrib[5].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[5].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY6_NV", GLboolean, - ["ctx->Array.VertexAttrib[6].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[6].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY7_NV", GLboolean, - ["ctx->Array.VertexAttrib[7].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[7].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY8_NV", GLboolean, - ["ctx->Array.VertexAttrib[8].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[8].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY9_NV", GLboolean, - ["ctx->Array.VertexAttrib[9].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[9].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY10_NV", GLboolean, - ["ctx->Array.VertexAttrib[10].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[10].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY11_NV", GLboolean, - ["ctx->Array.VertexAttrib[11].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[11].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY12_NV", GLboolean, - ["ctx->Array.VertexAttrib[12].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[12].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY13_NV", GLboolean, - ["ctx->Array.VertexAttrib[13].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[13].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY14_NV", GLboolean, - ["ctx->Array.VertexAttrib[14].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[14].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY15_NV", GLboolean, - ["ctx->Array.VertexAttrib[15].Enabled"], "", ["NV_vertex_program"] ), + ["ctx->Array.ArrayObj->VertexAttrib[15].Enabled"], "", ["NV_vertex_program"] ), ( "GL_MAP1_VERTEX_ATTRIB0_4_NV", GLboolean, ["ctx->Eval.Map1Attrib[0]"], "", ["NV_vertex_program"] ), ( "GL_MAP1_VERTEX_ATTRIB1_4_NV", GLboolean, @@ -808,23 +808,23 @@ StateVars = [ ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.SecondaryColor.BufferObj->Name"], + ["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.FogCoord.BufferObj->Name"], + ["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint, diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index b6eed5810cd..a741f8310be 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -182,28 +182,28 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) switch (pname) { case GL_VERTEX_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.Vertex.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->Vertex.Ptr; break; case GL_NORMAL_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.Normal.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->Normal.Ptr; break; case GL_COLOR_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.Color.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->Color.Ptr; break; case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT: - *params = (GLvoid *) ctx->Array.SecondaryColor.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->SecondaryColor.Ptr; break; case GL_FOG_COORDINATE_ARRAY_POINTER_EXT: - *params = (GLvoid *) ctx->Array.FogCoord.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->FogCoord.Ptr; break; case GL_INDEX_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.Index.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->Index.Ptr; break; case GL_TEXTURE_COORD_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.TexCoord[clientUnit].Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->TexCoord[clientUnit].Ptr; break; case GL_EDGE_FLAG_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.EdgeFlag.Ptr; + *params = (GLvoid *) ctx->Array.ArrayObj->EdgeFlag.Ptr; break; case GL_FEEDBACK_BUFFER_POINTER: *params = ctx->Feedback.Buffer; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e9893dda619..4ef08dd0748 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1663,11 +1663,10 @@ struct gl_client_array }; -/** - * Vertex array state - */ -struct gl_array_attrib -{ +struct gl_array_object { + /** Name of the array object as received from glGenVertexArrayAPPLE. */ + GLuint Name; + /** Conventional vertex arrays */ /*@{*/ struct gl_client_array Vertex; @@ -1683,11 +1682,22 @@ struct gl_array_attrib /** Generic arrays for vertex programs/shaders; */ struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; + GLbitfield _Enabled; /**< mask of _NEW_ARRAY_* values */ +}; + + +/** + * Vertex array state + */ +struct gl_array_attrib +{ + struct gl_array_object *ArrayObj; + struct gl_array_object *DefaultArrayObj; + GLint ActiveTexture; /**< Client Active Texture */ GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ - GLbitfield _Enabled; /**< mask of _NEW_ARRAY_* values */ GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */ #if FEATURE_ARB_vertex_buffer_object @@ -2103,6 +2113,9 @@ struct gl_shared_state struct _mesa_HashTable *FrameBuffers; #endif + /** Objects associated with the GL_APPLE_vertex_array_object extension. */ + struct _mesa_HashTable *ArrayObjects; + void *DriverData; /**< Device driver shared state */ }; @@ -2460,6 +2473,7 @@ struct gl_extensions /* vendor extensions */ GLboolean APPLE_client_storage; GLboolean APPLE_packed_pixels; + GLboolean APPLE_vertex_array_object; GLboolean ATI_texture_mirror_once; GLboolean ATI_texture_env_combine3; GLboolean ATI_fragment_shader; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index dbf0834df45..56b835f5373 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -45,6 +45,7 @@ #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" #endif +#include "arrayobj.h" #include "buffers.h" #include "clip.h" #include "colortab.h" @@ -537,6 +538,12 @@ _mesa_init_exec_table(struct _glapi_table *exec) /* glVertexAttrib*NV functions handled in api_loopback.c */ #endif + /* 273. GL_APPLE_vertex_array_object */ + SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE); + SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE); + SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE); + SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); + /* 282. GL_NV_fragment_program */ #if FEATURE_NV_fragment_program SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV); @@ -821,15 +828,15 @@ update_arrays( GLcontext *ctx ) /* 0 */ if (ctx->ShaderObjects._VertexShaderPresent - && ctx->Array.VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled) { - min = ctx->Array.VertexAttrib[VERT_ATTRIB_GENERIC0]._MaxElement; + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled) { + min = ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC0]._MaxElement; } else if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled) { - min = ctx->Array.VertexAttrib[VERT_ATTRIB_POS]._MaxElement; + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) { + min = ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS]._MaxElement; } - else if (ctx->Array.Vertex.Enabled) { - min = ctx->Array.Vertex._MaxElement; + else if (ctx->Array.ArrayObj->Vertex.Enabled) { + min = ctx->Array.ArrayObj->Vertex._MaxElement; } else { /* can't draw anything without vertex positions! */ @@ -838,86 +845,86 @@ update_arrays( GLcontext *ctx ) /* 1 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_WEIGHT]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT]._MaxElement); } /* no conventional vertex weight array */ /* 2 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]._MaxElement); } - else if (ctx->Array.Normal.Enabled) { - min = MIN2(min, ctx->Array.Normal._MaxElement); + else if (ctx->Array.ArrayObj->Normal.Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->Normal._MaxElement); } /* 3 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]._MaxElement); } - else if (ctx->Array.Color.Enabled) { - min = MIN2(min, ctx->Array.Color._MaxElement); + else if (ctx->Array.ArrayObj->Color.Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->Color._MaxElement); } /* 4 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]._MaxElement); } - else if (ctx->Array.SecondaryColor.Enabled) { - min = MIN2(min, ctx->Array.SecondaryColor._MaxElement); + else if (ctx->Array.ArrayObj->SecondaryColor.Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->SecondaryColor._MaxElement); } /* 5 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_FOG]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG]._MaxElement); } - else if (ctx->Array.FogCoord.Enabled) { - min = MIN2(min, ctx->Array.FogCoord._MaxElement); + else if (ctx->Array.ArrayObj->FogCoord.Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->FogCoord._MaxElement); } /* 6 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]._MaxElement); } - else if (ctx->Array.Index.Enabled) { - min = MIN2(min, ctx->Array.Index._MaxElement); + else if (ctx->Array.ArrayObj->Index.Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->Index._MaxElement); } /* 7 */ if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[VERT_ATTRIB_SEVEN].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_SEVEN]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_SEVEN].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_SEVEN]._MaxElement); } /* 8..15 */ for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) { if (ctx->VertexProgram._Enabled - && ctx->Array.VertexAttrib[i].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[i]._MaxElement); + && ctx->Array.ArrayObj->VertexAttrib[i].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement); } else if (i - VERT_ATTRIB_TEX0 < ctx->Const.MaxTextureCoordUnits - && ctx->Array.TexCoord[i - VERT_ATTRIB_TEX0].Enabled) { - min = MIN2(min, ctx->Array.TexCoord[i - VERT_ATTRIB_TEX0]._MaxElement); + && ctx->Array.ArrayObj->TexCoord[i - VERT_ATTRIB_TEX0].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->TexCoord[i - VERT_ATTRIB_TEX0]._MaxElement); } } /* 16..31 */ if (ctx->ShaderObjects._VertexShaderPresent) { for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { - if (ctx->Array.VertexAttrib[i].Enabled) { - min = MIN2(min, ctx->Array.VertexAttrib[i]._MaxElement); + if (ctx->Array.ArrayObj->VertexAttrib[i].Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement); } } } - if (ctx->Array.EdgeFlag.Enabled) { - min = MIN2(min, ctx->Array.EdgeFlag._MaxElement); + if (ctx->Array.ArrayObj->EdgeFlag.Enabled) { + min = MIN2(min, ctx->Array.ArrayObj->EdgeFlag._MaxElement); } /* _MaxElement is one past the last legal array element */ diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 97b02142936..47c13a3eea0 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -31,6 +31,7 @@ #include "enums.h" #include "mtypes.h" #include "varray.h" +#include "arrayobj.h" #include "dispatch.h" #ifndef GL_BOOLEAN @@ -119,7 +120,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) return; } - update_array(ctx, &ctx->Array.Vertex, _NEW_ARRAY_VERTEX, + update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, elementSize, size, type, stride, GL_FALSE, ptr); if (ctx->Driver.VertexPointer) @@ -164,7 +165,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) return; } - update_array(ctx, &ctx->Array.Normal, _NEW_ARRAY_NORMAL, + update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, elementSize, 3, type, stride, GL_TRUE, ptr); if (ctx->Driver.NormalPointer) @@ -222,7 +223,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) return; } - update_array(ctx, &ctx->Array.Color, _NEW_ARRAY_COLOR0, + update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, elementSize, size, type, stride, GL_TRUE, ptr); if (ctx->Driver.ColorPointer) @@ -254,7 +255,7 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) return; } - update_array(ctx, &ctx->Array.FogCoord, _NEW_ARRAY_FOGCOORD, + update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, elementSize, 1, type, stride, GL_FALSE, ptr); if (ctx->Driver.FogCoordPointer) @@ -295,7 +296,7 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) return; } - update_array(ctx, &ctx->Array.Index, _NEW_ARRAY_INDEX, + update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, elementSize, 1, type, stride, GL_FALSE, ptr); if (ctx->Driver.IndexPointer) @@ -354,7 +355,7 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, return; } - update_array(ctx, &ctx->Array.SecondaryColor, _NEW_ARRAY_COLOR1, + update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1, elementSize, size, type, stride, GL_TRUE, ptr); if (ctx->Driver.SecondaryColorPointer) @@ -403,7 +404,7 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, return; } - update_array(ctx, &ctx->Array.TexCoord[unit], _NEW_ARRAY_TEXCOORD(unit), + update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], _NEW_ARRAY_TEXCOORD(unit), elementSize, size, type, stride, GL_FALSE, ptr); if (ctx->Driver.TexCoordPointer) @@ -422,7 +423,7 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) return; } - update_array(ctx, &ctx->Array.EdgeFlag, _NEW_ARRAY_EDGEFLAG, + update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, sizeof(GLboolean), 1, GL_BOOLEAN, stride, GL_FALSE, ptr); if (ctx->Driver.EdgeFlagPointer) @@ -479,7 +480,7 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, return; } - update_array(ctx, &ctx->Array.VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), + update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), elementSize, size, type, stride, normalized, ptr); if (ctx->Driver.VertexAttribPointer) @@ -550,7 +551,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, return; } - update_array(ctx, &ctx->Array.VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), + update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), elementSize, size, type, stride, normalized, ptr); /* XXX fix @@ -923,73 +924,8 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, void _mesa_init_varray(GLcontext *ctx) { - GLuint i; - - /* Vertex arrays */ - ctx->Array.Vertex.Size = 4; - ctx->Array.Vertex.Type = GL_FLOAT; - ctx->Array.Vertex.Stride = 0; - ctx->Array.Vertex.StrideB = 0; - ctx->Array.Vertex.Ptr = NULL; - ctx->Array.Vertex.Enabled = GL_FALSE; - ctx->Array.Vertex.Flags = CA_CLIENT_DATA; - ctx->Array.Normal.Type = GL_FLOAT; - ctx->Array.Normal.Stride = 0; - ctx->Array.Normal.StrideB = 0; - ctx->Array.Normal.Ptr = NULL; - ctx->Array.Normal.Enabled = GL_FALSE; - ctx->Array.Normal.Flags = CA_CLIENT_DATA; - ctx->Array.Color.Size = 4; - ctx->Array.Color.Type = GL_FLOAT; - ctx->Array.Color.Stride = 0; - ctx->Array.Color.StrideB = 0; - ctx->Array.Color.Ptr = NULL; - ctx->Array.Color.Enabled = GL_FALSE; - ctx->Array.Color.Flags = CA_CLIENT_DATA; - ctx->Array.SecondaryColor.Size = 4; - ctx->Array.SecondaryColor.Type = GL_FLOAT; - ctx->Array.SecondaryColor.Stride = 0; - ctx->Array.SecondaryColor.StrideB = 0; - ctx->Array.SecondaryColor.Ptr = NULL; - ctx->Array.SecondaryColor.Enabled = GL_FALSE; - ctx->Array.SecondaryColor.Flags = CA_CLIENT_DATA; - ctx->Array.FogCoord.Size = 1; - ctx->Array.FogCoord.Type = GL_FLOAT; - ctx->Array.FogCoord.Stride = 0; - ctx->Array.FogCoord.StrideB = 0; - ctx->Array.FogCoord.Ptr = NULL; - ctx->Array.FogCoord.Enabled = GL_FALSE; - ctx->Array.FogCoord.Flags = CA_CLIENT_DATA; - ctx->Array.Index.Type = GL_FLOAT; - ctx->Array.Index.Stride = 0; - ctx->Array.Index.StrideB = 0; - ctx->Array.Index.Ptr = NULL; - ctx->Array.Index.Enabled = GL_FALSE; - ctx->Array.Index.Flags = CA_CLIENT_DATA; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - ctx->Array.TexCoord[i].Size = 4; - ctx->Array.TexCoord[i].Type = GL_FLOAT; - ctx->Array.TexCoord[i].Stride = 0; - ctx->Array.TexCoord[i].StrideB = 0; - ctx->Array.TexCoord[i].Ptr = NULL; - ctx->Array.TexCoord[i].Enabled = GL_FALSE; - ctx->Array.TexCoord[i].Flags = CA_CLIENT_DATA; - } - ctx->Array.EdgeFlag.Stride = 0; - ctx->Array.EdgeFlag.StrideB = 0; - ctx->Array.EdgeFlag.Ptr = NULL; - ctx->Array.EdgeFlag.Enabled = GL_FALSE; - ctx->Array.EdgeFlag.Flags = CA_CLIENT_DATA; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - ctx->Array.VertexAttrib[i].Size = 4; - ctx->Array.VertexAttrib[i].Type = GL_FLOAT; - ctx->Array.VertexAttrib[i].Stride = 0; - ctx->Array.VertexAttrib[i].StrideB = 0; - ctx->Array.VertexAttrib[i].Ptr = NULL; - ctx->Array.VertexAttrib[i].Enabled = GL_FALSE; - ctx->Array.VertexAttrib[i].Normalized = GL_FALSE; - ctx->Array.VertexAttrib[i].Flags = CA_CLIENT_DATA; - } + ctx->Array.DefaultArrayObj = _mesa_new_array_object(ctx, 0); + ctx->Array.ArrayObj = ctx->Array.DefaultArrayObj; ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */ } -- cgit v1.2.3