summaryrefslogtreecommitdiff
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-03-03 10:41:57 +0000
committerKeith Whitwell <keithw@vmware.com>2009-03-03 10:41:57 +0000
commitc64a2b708944ec671b1104067245500fcfc6ed94 (patch)
tree6c7a0d642264502993c1be2bc9d3da7e288615fc /src/mesa/vbo
parent050ce17799cbe652962f898942ae6551d31f21a2 (diff)
mesa: Add BeginVertices driver call
Provides notification to the VBO modules prior to the first immediate call. Pairs with FlushVertices()
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_exec.c1
-rw-r--r--src/mesa/vbo/vbo_exec.h2
-rw-r--r--src/mesa/vbo/vbo_exec_api.c10
3 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 635f239acc..e168a89ea5 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -57,6 +57,7 @@ void vbo_exec_init( GLcontext *ctx )
ctx->Driver.NeedFlush = 0;
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+ ctx->Driver.BeginVertices = vbo_exec_BeginVertices;
ctx->Driver.FlushVertices = vbo_exec_FlushVertices;
vbo_exec_invalidate_state( ctx, ~0 );
diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index ddbcbe1181..3ce36657bd 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -140,6 +140,8 @@ struct vbo_exec_context
void vbo_exec_init( GLcontext *ctx );
void vbo_exec_destroy( GLcontext *ctx );
void vbo_exec_invalidate_state( GLcontext *ctx, GLuint new_state );
+
+void vbo_exec_BeginVertices( GLcontext *ctx );
void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags );
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 23f4f8331e..093e3d2167 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -748,6 +748,12 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
}
}
+void vbo_exec_BeginVertices( GLcontext *ctx )
+{
+ struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
+ if (0) _mesa_printf("%s\n", __FUNCTION__);
+// vbo_exec_vtx_map( exec );
+}
void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
{
@@ -765,6 +771,10 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
reset_attrfv( exec );
}
+ /* Need to do this to ensure BeginVertices gets called again:
+ */
+ _mesa_restore_exec_vtxfmt( ctx );
+
exec->ctx->Driver.NeedFlush = 0;
}