Mesa (7.8-gles): mesa: Only initialize save dispatch table for OpenGL

Kristian Høgsberg krh at kemper.freedesktop.org
Tue May 4 01:33:00 UTC 2010


Module: Mesa
Branch: 7.8-gles
Commit: 0bb23b4b6fe7849aa7bfec523ce37af3bf47807a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0bb23b4b6fe7849aa7bfec523ce37af3bf47807a

Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Mon May  3 21:12:46 2010 -0400

mesa: Only initialize save dispatch table for OpenGL

---

 src/mesa/main/context.c    |   22 ++++++++++------------
 src/mesa/vbo/vbo_context.c |    6 ++++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 91999d5..b1cd8d4 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -888,18 +888,6 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
    }
 #endif
    ctx->CurrentDispatch = ctx->Exec;
-
-#if FEATURE_dlist
-   ctx->Save = _mesa_create_save_table();
-   if (!ctx->Save) {
-      _mesa_release_shared_state(ctx, ctx->Shared);
-      free(ctx->Exec);
-      return GL_FALSE;
-   }
-
-   _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
-#endif
-
    /* Neutral tnl module stuff */
    _mesa_init_exec_vtxfmt( ctx ); 
    ctx->TnlModule.Current = NULL;
@@ -917,6 +905,16 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
 
    switch (ctx->API) {
    case API_OPENGL:
+#if FEATURE_dlist
+      ctx->Save = _mesa_create_save_table();
+      if (!ctx->Save) {
+	 _mesa_release_shared_state(ctx, ctx->Shared);
+	 free(ctx->Exec);
+	 return GL_FALSE;
+      }
+
+      _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+#endif
       break;
    case API_OPENGLES:
       /**
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index e3be39a..13148fc 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -199,7 +199,8 @@ GLboolean _vbo_CreateContext( GLcontext *ctx )
     */
    vbo_exec_init( ctx );
 #if FEATURE_dlist
-   vbo_save_init( ctx );
+   if (ctx->API == API_OPENGL)
+      vbo_save_init( ctx );
 #endif
 
    _math_init_eval();
@@ -233,7 +234,8 @@ void _vbo_DestroyContext( GLcontext *ctx )
 
       vbo_exec_destroy(ctx);
 #if FEATURE_dlist
-      vbo_save_destroy(ctx);
+      if (ctx->API == API_OPENGL)
+         vbo_save_destroy(ctx);
 #endif
       FREE(vbo);
       ctx->swtnl_im = NULL;




More information about the mesa-commit mailing list