summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 84bcdd63bf3..f9874396658 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -833,6 +833,17 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
exec->vtx.prim[i].base_instance = 0;
ctx->Driver.CurrentExecPrimitive = mode;
+
+ ctx->Exec = ctx->BeginEnd;
+ /* We may have been called from a display list, in which case we should
+ * leave dlist.c's dispatch table in place.
+ */
+ if (ctx->CurrentDispatch == ctx->OutsideBeginEnd) {
+ ctx->CurrentDispatch = ctx->BeginEnd;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+ } else {
+ assert(ctx->CurrentDispatch == ctx->Save);
+ }
}
@@ -849,6 +860,12 @@ static void GLAPIENTRY vbo_exec_End( void )
return;
}
+ ctx->Exec = ctx->OutsideBeginEnd;
+ if (ctx->CurrentDispatch == ctx->BeginEnd) {
+ ctx->CurrentDispatch = ctx->OutsideBeginEnd;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+ }
+
if (exec->vtx.prim_count > 0) {
/* close off current primitive */
int idx = exec->vtx.vert_count;