aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-01-17 16:58:49 -0800
committerEric Anholt <[email protected]>2013-01-21 21:26:48 -0800
commit7820e2dd8dac0978b3f4f94cc3aa0144eb19032b (patch)
tree97f5fee08ace549a4a58372870dcca68fb6492cb /src/mesa/main
parentbe4b1664fbc98b0b1d66bb91850ecada52b36b91 (diff)
mesa: Delay display list save dispatch setup until Exec is set up.
This will let us copy from the Exec dispatch to deal with our commands that don't get compiled into display lists. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c5
-rw-r--r--src/mesa/main/dlist.c12
-rw-r--r--src/mesa/main/dlist.h2
3 files changed, 8 insertions, 11 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 1c917e75a49..5e9e539b27f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -938,6 +938,9 @@ _mesa_initialize_dispatch_tables(struct gl_context *ctx)
{
/* Do the code-generated setup of the exec table in api_exec.c. */
_mesa_initialize_exec_table(ctx);
+
+ if (ctx->Save)
+ _mesa_initialize_save_table(ctx);
}
/**
@@ -1044,7 +1047,7 @@ _mesa_initialize_context(struct gl_context *ctx,
switch (ctx->API) {
case API_OPENGL_COMPAT:
ctx->BeginEnd = create_beginend_table(ctx);
- ctx->Save = _mesa_create_save_table(ctx);
+ ctx->Save = _mesa_alloc_dispatch_table();
if (!ctx->BeginEnd || !ctx->Save)
goto fail;
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 7eb2cb2011d..06c44b9b013 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -9566,14 +9566,10 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode,
* initialized from _mesa_init_api_defaults and from the active vtxfmt
* struct.
*/
-struct _glapi_table *
-_mesa_create_save_table(const struct gl_context *ctx)
+void
+_mesa_initialize_save_table(const struct gl_context *ctx)
{
- struct _glapi_table *table;
-
- table = _mesa_alloc_dispatch_table();
- if (table == NULL)
- return NULL;
+ struct _glapi_table *table = ctx->Save;
_mesa_loopback_init_api_table(ctx, table);
@@ -10233,8 +10229,6 @@ _mesa_create_save_table(const struct gl_context *ctx)
/* GL_NV_primitive_restart */
SET_PrimitiveRestartIndex(table, _mesa_PrimitiveRestartIndex);
-
- return table;
}
diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h
index 9d4fc6899a4..e049476c1be 100644
--- a/src/mesa/main/dlist.h
+++ b/src/mesa/main/dlist.h
@@ -74,7 +74,7 @@ extern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dl
extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt );
-extern struct _glapi_table *_mesa_create_save_table(const struct gl_context *);
+extern void _mesa_initialize_save_table(const struct gl_context *);
extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
const GLvertexformat *vfmt);