diff options
author | Kristian Høgsberg <[email protected]> | 2010-04-22 20:26:51 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-04-27 19:27:49 -0400 |
commit | ea0c7e71638a4a72a4eae962e6cc471bd33a5605 (patch) | |
tree | 5229269112efc701323ffe1ed500d22583bea63b /src/mesa/main/context.c | |
parent | 1741ddb747ca0be284315adb4b6fe67ddf292d03 (diff) |
mesa: Move api_exec_es*.c into mesa/main
This requires renaming a few functions to have unique names so that
they can all live within the same driver.
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 8d71cefdcf3..0963e75f35e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -394,7 +394,25 @@ one_time_init( GLcontext *ctx ) _mesa_get_cpu_features(); - _mesa_init_remap_table(); + switch (ctx->API) { +#if FEATURE_GL + case API_OPENGL: + _mesa_init_remap_table(); + break; +#endif +#if FEATURE_ES1 + case API_OPENGLES: + _mesa_init_remap_table_es1(); + break; +#endif +#if FEATURE_ES2 + case API_OPENGLES2: + _mesa_init_remap_table_es2(); + break; +#endif + default: + break; + } _mesa_init_sqrt_table(); @@ -812,9 +830,6 @@ _mesa_initialize_context_for_api(GLcontext *ctx, assert(driverFunctions->NewTextureObject); assert(driverFunctions->FreeTexImageData); - /* misc one-time initializations */ - one_time_init(ctx); - ctx->API = api; ctx->Visual = *visual; ctx->DrawBuffer = NULL; @@ -822,6 +837,9 @@ _mesa_initialize_context_for_api(GLcontext *ctx, ctx->WinSysDrawBuffer = NULL; ctx->WinSysReadBuffer = NULL; + /* misc one-time initializations */ + one_time_init(ctx); + /* Plug in driver functions and context pointer here. * This is important because when we call alloc_shared_state() below * we'll call ctx->Driver.NewTextureObject() to create the default @@ -853,7 +871,27 @@ _mesa_initialize_context_for_api(GLcontext *ctx, #if FEATURE_dispatch /* setup the API dispatch tables */ - ctx->Exec = _mesa_create_exec_table(); + switch (ctx->API) { +#if FEATURE_GL + case API_OPENGL: + ctx->Exec = _mesa_create_exec_table(); + break; +#endif +#if FEATURE_ES1 + case API_OPENGLES: + ctx->Exec = _mesa_create_exec_table_es1(); + break; +#endif +#if FEATURE_ES2 + case API_OPENGLES2: + ctx->Exec = _mesa_create_exec_table_es2(); + break; +#endif + default: + _mesa_problem(ctx, "unknown or unsupported API"); + break; + } + if (!ctx->Exec) { _mesa_release_shared_state(ctx, ctx->Shared); return GL_FALSE; |