summaryrefslogtreecommitdiff
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
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 2545718343..97893b721d 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;