Module: Mesa
Branch: master
Commit: d7ea9ddf5824556e47decac7ba200f37cf1e552f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d7ea9ddf5824556e47decac7ba200f37cf1e552f

Author: Brian Paul <[email protected]>
Date:   Wed Jun 10 13:44:35 2009 -0600

mesa: use _mesa_reference_buffer_object() in a few places

---

 src/mesa/vbo/vbo_context.c    |    3 ++-
 src/mesa/vbo/vbo_rebase.c     |    4 +++-
 src/mesa/vbo/vbo_split_copy.c |    7 +++++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index 90025f6..75c32e0 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -153,7 +153,8 @@ static void init_mat_currval(GLcontext *ctx)
       cl->Stride = 0;
       cl->StrideB = 0;
       cl->Enabled = 1;
-      cl->BufferObj = ctx->Shared->NullBufferObj;
+      _mesa_reference_buffer_object(ctx, &cl->BufferObj,
+                                    ctx->Shared->NullBufferObj);
    }
 }
 
diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c
index ea87ded..2fcaba2 100644
--- a/src/mesa/vbo/vbo_rebase.c
+++ b/src/mesa/vbo/vbo_rebase.c
@@ -49,6 +49,7 @@
 #include "main/glheader.h"
 #include "main/imports.h"
 #include "main/mtypes.h"
+#include "main/bufferobj.h"
 
 #include "vbo.h"
 
@@ -161,7 +162,8 @@ void vbo_rebase_prims( GLcontext *ctx,
                                 GL_ELEMENT_ARRAY_BUFFER,
                                 ib->obj);
 
-      tmp_ib.obj = ctx->Shared->NullBufferObj;
+      _mesa_reference_buffer_object(ctx, &tmp_ib.obj,
+                                    ctx->Shared->NullBufferObj);
       tmp_ib.ptr = tmp_indices;
       tmp_ib.count = ib->count;
       tmp_ib.type = ib->type;
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index dcb14c8..2725cc8 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -30,6 +30,7 @@
  */
 
 #include "main/glheader.h"
+#include "main/bufferobj.h"
 #include "main/imports.h"
 #include "main/image.h"
 #include "main/macros.h"
@@ -517,7 +518,8 @@ replay_init( struct copy_context *copy )
       dst->Ptr = copy->dstbuf + offset;
       dst->Enabled = GL_TRUE;
       dst->Normalized = src->Normalized; 
-      dst->BufferObj = ctx->Shared->NullBufferObj;
+      _mesa_reference_buffer_object(ctx, &dst->BufferObj,
+                                    ctx->Shared->NullBufferObj);
       dst->_MaxElement = copy->dstbuf_size; /* may be less! */
 
       offset += copy->varying[i].size;
@@ -537,7 +539,8 @@ replay_init( struct copy_context *copy )
     */
    copy->dstib.count = 0;      /* duplicates dstelt_nr */
    copy->dstib.type = GL_UNSIGNED_INT;
-   copy->dstib.obj = ctx->Shared->NullBufferObj;
+   _mesa_reference_buffer_object(ctx, &copy->dstib.obj,
+                                 ctx->Shared->NullBufferObj);
    copy->dstib.ptr = copy->dstelt;
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to