summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.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/bufferobj.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/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 25457183431..97893b721db 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -329,7 +329,13 @@ _mesa_init_buffer_objects( GLcontext *ctx )
{
GLuint i;
+ /* Allocate the default buffer object and set refcount so high that
+ * it never gets deleted.
+ */
ctx->Array.NullBufferObj = _mesa_new_buffer_object(ctx, 0, 0);
+ if (ctx->Array.NullBufferObj)
+ ctx->Array.NullBufferObj->RefCount = 1000;
+
ctx->Array.ArrayBufferObj = ctx->Array.NullBufferObj;
ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj;