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 <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
# This script generates the file api_exec.c, which contains
|
# 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.
|
# entries in the "exec" dispatch table that aren't dynamic.
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
@@ -112,29 +112,25 @@ header = """/**
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a dispatch table with pointers to Mesa's immediate-mode
|
* Initialize a context's exec table with pointers to Mesa's supported
|
||||||
* commands.
|
* GL functions.
|
||||||
*
|
*
|
||||||
* Pointers to glBegin()/glEnd() object commands and a few others
|
* This function depends on ctx->Version.
|
||||||
* are provided via the GLvertexformat interface.
|
|
||||||
*
|
*
|
||||||
* \param ctx GL context to which \c exec belongs.
|
* \param ctx GL context to which \c exec belongs.
|
||||||
* \param exec dispatch table.
|
|
||||||
*/
|
*/
|
||||||
struct _glapi_table *
|
void
|
||||||
_mesa_create_exec_table(struct gl_context *ctx)
|
_mesa_initialize_exec_table(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
struct _glapi_table *exec;
|
struct _glapi_table *exec;
|
||||||
|
|
||||||
exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
|
exec = ctx->Exec;
|
||||||
if (exec == NULL)
|
assert(exec != NULL);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
footer = """
|
footer = """
|
||||||
return exec;
|
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@@ -33,8 +33,8 @@ struct gl_context;
|
|||||||
extern struct _glapi_table *
|
extern struct _glapi_table *
|
||||||
_mesa_alloc_dispatch_table(int size);
|
_mesa_alloc_dispatch_table(int size);
|
||||||
|
|
||||||
extern struct _glapi_table *
|
extern void
|
||||||
_mesa_create_exec_table(struct gl_context *ctx);
|
_mesa_initialize_exec_table(struct gl_context *ctx);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -935,8 +935,11 @@ _mesa_initialize_context(struct gl_context *ctx,
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup the API dispatch tables */
|
/* setup the API dispatch tables with all nop functions */
|
||||||
ctx->Exec = _mesa_create_exec_table(ctx);
|
ctx->Exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
|
||||||
|
|
||||||
|
/* setup the API exec functions */
|
||||||
|
_mesa_initialize_exec_table(ctx);
|
||||||
|
|
||||||
if (!ctx->Exec) {
|
if (!ctx->Exec) {
|
||||||
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
|
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
|
||||||
|
Reference in New Issue
Block a user