aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-20 14:23:37 +0000
committermarha <marha@users.sourceforge.net>2011-02-20 14:23:37 +0000
commit684eb992146cad24b690073f33b909f47150b841 (patch)
tree7bc62d6f06c5e8a8114b56fa78485cb7ec08f26b /mesalib/src/mesa/vbo
parent53810445215dc45ae303bc89feb6e0aaf04aa6fa (diff)
parent8a191c08ddda2e66fa26f148d6c21959bb08f923 (diff)
downloadvcxsrv-684eb992146cad24b690073f33b909f47150b841.tar.gz
vcxsrv-684eb992146cad24b690073f33b909f47150b841.tar.bz2
vcxsrv-684eb992146cad24b690073f33b909f47150b841.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/vbo')
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_array.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c
index 4304985aa..65a0642f1 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_array.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_array.c
@@ -39,6 +39,26 @@
/**
+ * All vertex buffers should be in an unmapped state when we're about
+ * to draw. This debug function checks that.
+ */
+static void
+check_buffers_are_unmapped(const struct gl_client_array **inputs)
+{
+#ifdef DEBUG
+ GLuint i;
+
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ if (inputs[i]) {
+ struct gl_buffer_object *obj = inputs[i]->BufferObj;
+ assert(!_mesa_bufferobj_mapped(obj));
+ }
+ }
+#endif
+}
+
+
+/**
* 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
@@ -581,6 +601,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
if (primCount > 0) {
/* draw one or two prims */
+ check_buffers_are_unmapped(exec->array.inputs);
vbo->draw_prims(ctx, exec->array.inputs, prim, primCount, NULL,
GL_TRUE, start, start + count - 1);
}
@@ -590,6 +611,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
prim[0].start = start;
prim[0].count = count;
+ check_buffers_are_unmapped(exec->array.inputs);
vbo->draw_prims(ctx, exec->array.inputs, prim, 1, NULL,
GL_TRUE, start, start + count - 1);
}
@@ -795,6 +817,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
* for the latter case elsewhere.
*/
+ check_buffers_are_unmapped(exec->array.inputs);
vbo->draw_prims( ctx, exec->array.inputs, prim, 1, &ib,
index_bounds_valid, start, end );
}
@@ -1111,6 +1134,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
prim[i].basevertex = 0;
}
+ check_buffers_are_unmapped(exec->array.inputs);
vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib,
GL_FALSE, ~0, ~0);
} else {
@@ -1135,6 +1159,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
else
prim[0].basevertex = 0;
+ check_buffers_are_unmapped(exec->array.inputs);
vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib,
GL_FALSE, ~0, ~0);
}