Mesa (master): vbo: comments
Brian Paul
brianp at kemper.freedesktop.org
Mon Feb 21 22:16:20 UTC 2011
Module: Mesa
Branch: master
Commit: f0c8e7c32766cb78756de24a9ca5e8c28017a682
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0c8e7c32766cb78756de24a9ca5e8c28017a682
Author: Brian Paul <brianp at vmware.com>
Date: Mon Feb 21 15:11:44 2011 -0700
vbo: comments
---
src/mesa/vbo/vbo_exec_draw.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 38c8651..dda008b 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -253,6 +253,9 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
}
+/**
+ * Unmap the VBO. This is called before drawing.
+ */
static void
vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
{
@@ -285,6 +288,9 @@ vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
}
+/**
+ * Map the vertex buffer to begin storing glVertex, glColor, etc data.
+ */
void
vbo_exec_vtx_map( struct vbo_exec_context *exec )
{
@@ -306,6 +312,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
if (VBO_VERT_BUFFER_SIZE > exec->vtx.buffer_used + 1024 &&
ctx->Driver.MapBufferRange) {
+ /* The VBO exists and there's room for more */
exec->vtx.buffer_map =
(GLfloat *)ctx->Driver.MapBufferRange(ctx,
target,
@@ -318,6 +325,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
}
if (!exec->vtx.buffer_map) {
+ /* Need to allocate a new VBO */
exec->vtx.buffer_used = 0;
ctx->Driver.BufferData(ctx, target,
More information about the mesa-commit
mailing list