[Mesa-dev] [PATCH 13/26] Revert "mesa: make _mesa_alloc_dispatch_table() static"

Marek Olšák maraeo at gmail.com
Wed Feb 8 18:03:27 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

This reverts commit 4009d22b61e76850b1b725f4e491da05c2406fa4.

glthread needs it.
---
 src/mesa/main/api_exec.h |  4 ++++
 src/mesa/main/context.c  | 10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/api_exec.h b/src/mesa/main/api_exec.h
index 655cb32..f55f56b 100644
--- a/src/mesa/main/api_exec.h
+++ b/src/mesa/main/api_exec.h
@@ -23,22 +23,26 @@
  */
 
 
 #ifndef API_EXEC_H
 #define API_EXEC_H
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct _glapi_table;
 struct gl_context;
 
+extern struct _glapi_table *
+_mesa_alloc_dispatch_table(void);
+
 extern void
 _mesa_initialize_exec_table(struct gl_context *ctx);
 
 extern void
 _mesa_initialize_dispatch_tables(struct gl_context *ctx);
 
 extern struct _glapi_table *
 _mesa_new_nop_table(unsigned numEntries);
 
 #ifdef __cplusplus
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index c00cced..fabb63f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -990,22 +990,22 @@ _mesa_new_nop_table(unsigned numEntries)
 #endif
    return table;
 }
 
 
 /**
  * Allocate and initialize a new dispatch table.  The table will be
  * populated with pointers to "no-op" functions.  In turn, the no-op
  * functions will call nop_handler() above.
  */
-static struct _glapi_table *
-alloc_dispatch_table(void)
+struct _glapi_table *
+_mesa_alloc_dispatch_table(void)
 {
    /* Find the larger of Mesa's dispatch table and libGL's dispatch table.
     * In practice, this'll be the same for stand-alone Mesa.  But for DRI
     * Mesa we do this to accommodate different versions of libGL and various
     * DRI drivers.
     */
    int numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT);
 
    struct _glapi_table *table = _mesa_new_nop_table(numEntries);
 
@@ -1063,21 +1063,21 @@ alloc_dispatch_table(void)
  *
  * The table entries for specifying vertex attributes are set up by
  * install_vtxfmt() and _mesa_loopback_init_api_table(), and End() and dlists
  * are set by install_vtxfmt() as well.
  */
 static struct _glapi_table *
 create_beginend_table(const struct gl_context *ctx)
 {
    struct _glapi_table *table;
 
-   table = alloc_dispatch_table();
+   table = _mesa_alloc_dispatch_table();
    if (!table)
       return NULL;
 
    /* Fill in functions which return a value, since they should return some
     * specific value even if they emit a GL_INVALID_OPERATION error from them
     * being called within glBegin()/glEnd().
     */
 #define COPY_DISPATCH(func) SET_##func(table, GET_##func(ctx->Exec))
 
    COPY_DISPATCH(GenLists);
@@ -1200,21 +1200,21 @@ _mesa_initialize_context(struct gl_context *ctx,
       if (!shared)
          return GL_FALSE;
    }
 
    _mesa_reference_shared_state(ctx, &ctx->Shared, shared);
 
    if (!init_attrib_groups( ctx ))
       goto fail;
 
    /* setup the API dispatch tables with all nop functions */
-   ctx->OutsideBeginEnd = alloc_dispatch_table();
+   ctx->OutsideBeginEnd = _mesa_alloc_dispatch_table();
    if (!ctx->OutsideBeginEnd)
       goto fail;
    ctx->Exec = ctx->OutsideBeginEnd;
    ctx->CurrentClientDispatch = ctx->CurrentServerDispatch = ctx->OutsideBeginEnd;
 
    ctx->FragmentProgram._MaintainTexEnvProgram
       = (getenv("MESA_TEX_PROG") != NULL);
 
    ctx->VertexProgram._MaintainTnlProgram
       = (getenv("MESA_TNL_PROG") != NULL);
@@ -1229,21 +1229,21 @@ _mesa_initialize_context(struct gl_context *ctx,
     * _mesa_choose_tex_format().
     */
    memset(&ctx->TextureFormatSupported, GL_TRUE,
           sizeof(ctx->TextureFormatSupported));
 
    ctx->Cache = disk_cache_create();
 
    switch (ctx->API) {
    case API_OPENGL_COMPAT:
       ctx->BeginEnd = create_beginend_table(ctx);
-      ctx->Save = alloc_dispatch_table();
+      ctx->Save = _mesa_alloc_dispatch_table();
       if (!ctx->BeginEnd || !ctx->Save)
          goto fail;
 
       /* fall-through */
    case API_OPENGL_CORE:
       break;
    case API_OPENGLES:
       /**
        * GL_OES_texture_cube_map says
        * "Initially all texture generation modes are set to REFLECTION_MAP_OES"
-- 
2.7.4



More information about the mesa-dev mailing list