mesa: revert some recent VBO buffer object refcounting changes
authorBrian Paul <brianp@vmware.com>
Mon, 15 Jun 2009 16:58:04 +0000 (10:58 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 15 Jun 2009 16:58:04 +0000 (10:58 -0600)
Reverts part of commit d7ea9ddf5824556e47decac7ba200f37cf1e552f.
We were calling _mesa_reference_buffer_object() on some heap-allocated
memory that was uninitialized and could trigger an assertion.
We can actually go back to "looser" ref counting of the Null/default
buffer object in these cases.

src/mesa/vbo/vbo_rebase.c
src/mesa/vbo/vbo_split_copy.c

index 2fcaba236410e207ce61626c3de099e24f956d9c..ea87dede64627566052a5de2c0a0d18ca55a11f3 100644 (file)
@@ -49,7 +49,6 @@
 #include "main/glheader.h"
 #include "main/imports.h"
 #include "main/mtypes.h"
-#include "main/bufferobj.h"
 
 #include "vbo.h"
 
@@ -162,8 +161,7 @@ void vbo_rebase_prims( GLcontext *ctx,
                                 GL_ELEMENT_ARRAY_BUFFER,
                                 ib->obj);
 
-      _mesa_reference_buffer_object(ctx, &tmp_ib.obj,
-                                    ctx->Shared->NullBufferObj);
+      tmp_ib.obj = ctx->Shared->NullBufferObj;
       tmp_ib.ptr = tmp_indices;
       tmp_ib.count = ib->count;
       tmp_ib.type = ib->type;
index 2725cc82b7322aee81e185127d38506db1964a72..dcb14c868b854b7f06929c3539fdc5823e74deee 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 #include "main/glheader.h"
-#include "main/bufferobj.h"
 #include "main/imports.h"
 #include "main/image.h"
 #include "main/macros.h"
@@ -518,8 +517,7 @@ replay_init( struct copy_context *copy )
       dst->Ptr = copy->dstbuf + offset;
       dst->Enabled = GL_TRUE;
       dst->Normalized = src->Normalized; 
-      _mesa_reference_buffer_object(ctx, &dst->BufferObj,
-                                    ctx->Shared->NullBufferObj);
+      dst->BufferObj = ctx->Shared->NullBufferObj;
       dst->_MaxElement = copy->dstbuf_size; /* may be less! */
 
       offset += copy->varying[i].size;
@@ -539,8 +537,7 @@ replay_init( struct copy_context *copy )
     */
    copy->dstib.count = 0;      /* duplicates dstelt_nr */
    copy->dstib.type = GL_UNSIGNED_INT;
-   _mesa_reference_buffer_object(ctx, &copy->dstib.obj,
-                                 ctx->Shared->NullBufferObj);
+   copy->dstib.obj = ctx->Shared->NullBufferObj;
    copy->dstib.ptr = copy->dstelt;
 }