aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-02-11 22:06:05 +0000
committerBrian Paul <[email protected]>2004-02-11 22:06:05 +0000
commit2020278d06f927eed0bcba919f70846df090fc45 (patch)
tree697316b48af48bd9d59d178408692f4c1d318487 /src/mesa/main/varray.c
parent840e82163d0efb6275ccfe766f063a4e1079c26f (diff)
Do more bookkeeping of vertex buffer object reference counts.
Incr/decr counts when doing glPush/PopClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT).
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index c9896ae3ca6..c0b7bcfabe9 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -58,7 +58,9 @@ update_array(GLcontext *ctx, struct gl_client_array *array,
array->Ptr = (const GLubyte *) ptr;
#if FEATURE_ARB_vertex_buffer_object
array->BufferObj->RefCount--;
- /* XXX free buffer object if RefCount == 0 ? */
+ if (array->BufferObj->RefCount <= 0) {
+ (*ctx->Driver.DeleteBuffer)( ctx, array->BufferObj );
+ }
array->BufferObj = ctx->Array.ArrayBufferObj;
array->BufferObj->RefCount++;
/* Compute the index of the last array element that's inside the buffer.