Mesa (master): vbo: added vbo_check_buffers_are_unmapped() debug function

Brian Paul brianp at kemper.freedesktop.org
Tue Feb 22 21:41:46 UTC 2011


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

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Feb 22 14:31:15 2011 -0700

vbo: added vbo_check_buffers_are_unmapped() debug function

---

 src/mesa/vbo/vbo.h            |    2 ++
 src/mesa/vbo/vbo_exec_array.c |   17 +++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 37940ef..6834f3b 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -130,6 +130,8 @@ void vbo_use_buffer_objects(struct gl_context *ctx);
 
 void vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func);
 
+void vbo_check_buffers_are_unmapped(struct gl_context *ctx);
+
 
 void GLAPIENTRY
 _es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 25de140..457343a 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -59,6 +59,23 @@ check_buffers_are_unmapped(const struct gl_client_array **inputs)
 
 
 /**
+ * A debug function that may be called from other parts of Mesa as
+ * needed during debugging.
+ */
+void
+vbo_check_buffers_are_unmapped(struct gl_context *ctx)
+{
+   struct vbo_context *vbo = vbo_context(ctx);
+   struct vbo_exec_context *exec = &vbo->exec;
+   /* check the current vertex arrays */
+   check_buffers_are_unmapped(exec->array.inputs);
+   /* check the current glBegin/glVertex/glEnd-style VBO */
+   assert(!_mesa_bufferobj_mapped(exec->vtx.bufferobj));
+}
+
+
+
+/**
  * Compute min and max elements by scanning the index buffer for
  * glDraw[Range]Elements() calls.
  * If primitive restart is enabled, we need to ignore restart




More information about the mesa-commit mailing list