summaryrefslogtreecommitdiff
path: root/src/mesa/main/arrayobj.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-09-11 17:32:18 +0100
committerAlan Hourihane <alanh@tungstengraphics.com>2008-09-11 17:32:18 +0100
commit47ad296a183929c2007c35c60d722b4ac680417d (patch)
tree62bcc7af01606d32d7f137ccf8f342c9b0a6774a /src/mesa/main/arrayobj.c
parentb6458225039ef4cf5c91080e7547ed73fb264c46 (diff)
parent4d42c5bebf8740ebfc15571d24b6c92f79e09263 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa into gallium-0.2
Conflicts: src/mesa/drivers/dri/i915/intel_ioctl.c src/mesa/main/texstore.c src/mesa/tnl/t_vp_build.c src/mesa/vbo/vbo_exec_draw.c
Diffstat (limited to 'src/mesa/main/arrayobj.c')
-rw-r--r--src/mesa/main/arrayobj.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index d62661e2b5..1461239317 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 7.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
* (C) Copyright IBM Corporation 2006
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -77,7 +77,7 @@ lookup_arrayobj(GLcontext *ctx, GLuint id)
struct gl_array_object *
_mesa_new_array_object( GLcontext *ctx, GLuint name )
{
- struct gl_array_object *obj = MALLOC_STRUCT(gl_array_object);
+ struct gl_array_object *obj = CALLOC_STRUCT(gl_array_object);
if (obj)
_mesa_initialize_array_object(ctx, obj, name);
return obj;
@@ -219,6 +219,15 @@ _mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj )
}
+static void
+unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
+{
+ if (bufObj != ctx->Array.NullBufferObj) {
+ _mesa_reference_buffer_object(ctx, &bufObj, NULL);
+ }
+}
+
+
/**********************************************************************/
/* API Functions */
/**********************************************************************/
@@ -320,18 +329,18 @@ _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids)
/* 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 );
+ unbind_buffer_object( ctx, obj->Vertex.BufferObj );
+ unbind_buffer_object( ctx, obj->Normal.BufferObj );
+ unbind_buffer_object( ctx, obj->Color.BufferObj );
+ unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj );
+ unbind_buffer_object( ctx, obj->FogCoord.BufferObj );
+ unbind_buffer_object( ctx, obj->Index.BufferObj );
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- _mesa_unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj );
+ unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj );
}
- _mesa_unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj );
+ unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj );
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- _mesa_unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj );
+ unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj );
}
#endif