summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2012-11-16 10:27:13 -0800
committerJordan Justen <[email protected]>2012-12-16 15:30:27 -0800
commitd44014953835e9180eeb54a7969470396d7f3fd0 (patch)
treed4dfec92f530f834f2d02fdb0870b02396669516 /src/mapi/glapi
parentfa5078c255b5b57514ae854ecd6264379641c924 (diff)
mesa: separate exec allocation from initialization
In glapi/gl_genexec.py: * Remove _mesa_alloc_dispatch_table call In glapi/gl_genexec.py and api_exec.h: * Rename _mesa_create_exec_table to _mesa_initialize_exec_table In context.c: * Call _mesa_alloc_dispatch_table instead of _mesa_create_exec_table * Call _mesa_initialize_exec_table (this is temporary) Once all drivers have been modified to call _mesa_initialize_exec_table, then the call to _mesa_initialize_context can be removed from context.c. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mapi/glapi')
-rw-r--r--src/mapi/glapi/gen/gl_genexec.py20
1 files changed, 8 insertions, 12 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;
}
"""