diff options
-rw-r--r-- | src/mapi/glapi/gen/gl_genexec.py | 20 | ||||
-rw-r--r-- | src/mesa/main/api_exec.h | 4 | ||||
-rw-r--r-- | src/mesa/main/context.c | 7 |
3 files changed, 15 insertions, 16 deletions
diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py index 593d1955b1c..7952ace280f 100644 --- a/src/mapi/glapi/gen/gl_genexec.py +++ b/src/mapi/glapi/gen/gl_genexec.py @@ -22,7 +22,7 @@ # IN THE SOFTWARE. # This script generates the file api_exec.c, which contains -# _mesa_create_exec_table(). It is responsible for populating all +# _mesa_initialize_exec_table(). It is responsible for populating all # entries in the "exec" dispatch table that aren't dynamic. import collections @@ -112,29 +112,25 @@ header = """/** /** - * Initialize a dispatch table with pointers to Mesa's immediate-mode - * commands. + * Initialize a context's exec table with pointers to Mesa's supported + * GL functions. * - * Pointers to glBegin()/glEnd() object commands and a few others - * are provided via the GLvertexformat interface. + * This function depends on ctx->Version. * * \param ctx GL context to which \c exec belongs. - * \param exec dispatch table. */ -struct _glapi_table * -_mesa_create_exec_table(struct gl_context *ctx) +void +_mesa_initialize_exec_table(struct gl_context *ctx) { struct _glapi_table *exec; - exec = _mesa_alloc_dispatch_table(_gloffset_COUNT); - if (exec == NULL) - return NULL; + exec = ctx->Exec; + assert(exec != NULL); """ footer = """ - return exec; } """ diff --git a/src/mesa/main/api_exec.h b/src/mesa/main/api_exec.h index 7d37ff754be..8292c12de1f 100644 --- a/src/mesa/main/api_exec.h +++ b/src/mesa/main/api_exec.h @@ -33,8 +33,8 @@ struct gl_context; extern struct _glapi_table * _mesa_alloc_dispatch_table(int size); -extern struct _glapi_table * -_mesa_create_exec_table(struct gl_context *ctx); +extern void +_mesa_initialize_exec_table(struct gl_context *ctx); #endif diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index fa552e8180b..df7647dd5ad 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -935,8 +935,11 @@ _mesa_initialize_context(struct gl_context *ctx, return GL_FALSE; } - /* setup the API dispatch tables */ - ctx->Exec = _mesa_create_exec_table(ctx); + /* setup the API dispatch tables with all nop functions */ + ctx->Exec = _mesa_alloc_dispatch_table(_gloffset_COUNT); + + /* setup the API exec functions */ + _mesa_initialize_exec_table(ctx); if (!ctx->Exec) { _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); |