From a65f385b8deec6ac1f2ed7a52f7d76ec89e167b9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 May 2009 14:14:53 -0600 Subject: [PATCH] mesa: minor code simplification --- src/mesa/main/bufferobj.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index a806766386d..eefc1b04fa2 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -779,6 +779,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) for (i = 0; i < n; i++) { struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]); if (bufObj) { + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; GLuint j; ASSERT(bufObj->Name == ids[i]); @@ -791,18 +792,19 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) } /* unbind any vertex pointers bound to this buffer */ - unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->Color.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->SecondaryColor.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->FogCoord.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->Index.BufferObj, bufObj); - unbind(ctx, &ctx->Array.ArrayObj->EdgeFlag.BufferObj, bufObj); + unbind(ctx, &arrayObj->Vertex.BufferObj, bufObj); + unbind(ctx, &arrayObj->Weight.BufferObj, bufObj); + unbind(ctx, &arrayObj->Normal.BufferObj, bufObj); + unbind(ctx, &arrayObj->Color.BufferObj, bufObj); + unbind(ctx, &arrayObj->SecondaryColor.BufferObj, bufObj); + unbind(ctx, &arrayObj->FogCoord.BufferObj, bufObj); + unbind(ctx, &arrayObj->Index.BufferObj, bufObj); + unbind(ctx, &arrayObj->EdgeFlag.BufferObj, bufObj); for (j = 0; j < MAX_TEXTURE_COORD_UNITS; j++) { - unbind(ctx, &ctx->Array.ArrayObj->TexCoord[j].BufferObj, bufObj); + unbind(ctx, &arrayObj->TexCoord[j].BufferObj, bufObj); } for (j = 0; j < VERT_ATTRIB_MAX; j++) { - unbind(ctx, &ctx->Array.ArrayObj->VertexAttrib[j].BufferObj, bufObj); + unbind(ctx, &arrayObj->VertexAttrib[j].BufferObj, bufObj); } if (ctx->Array.ArrayBufferObj == bufObj) { -- 2.30.2