glx: Don't use glapitable.h at all
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 31 Jul 2012 23:58:41 +0000 (16:58 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 8 Aug 2012 17:06:26 +0000 (10:06 -0700)
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  Avoiding the use of glapitable.h avoids the lies.  The only
entries used in this code are entries that are ABI.  For these, the ABI
offset can be used directly.

Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to
get the pretty names for these offsets.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/glxclient.h
src/glx/single2.c
src/glx/singlepix.c
src/mapi/glapi/gen/glX_proto_send.py

index f8ae450f09c95979e906f19fe718016022c0f59b..91577a81c2d8f24742f12dc3db7b3ad23c2fbf95 100644 (file)
@@ -51,7 +51,6 @@
 #include <stdint.h>
 #endif
 #include "GL/glxproto.h"
-#include "glapi/glapitable.h"
 #include "glxconfig.h"
 #include "glxhash.h"
 #if defined( PTHREADS )
index 259c4fec1ff023546702e9efda8d797aa501e195..d422d9dcf1a841f21d4d2ef2075ff226e385d932 100644 (file)
@@ -35,7 +35,6 @@
 #include "glxextensions.h"
 #include "indirect.h"
 #include "indirect_vertex_array.h"
-#include "glapitable.h"
 #include "glapi.h"
 #ifdef USE_XCB
 #include <xcb/xcb.h>
@@ -943,7 +942,11 @@ glAreTexturesResidentEXT(GLsizei n, const GLuint * textures,
    struct glx_context *const gc = __glXGetCurrentContext();
 
    if (gc->isDirect) {
-      return GET_DISPATCH()->AreTexturesResident(n, textures, residences);
+      const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH();
+      PFNGLARETEXTURESRESIDENTEXTPROC p =
+         (PFNGLARETEXTURESRESIDENTEXTPROC) table[332];
+
+      return p(n, textures, residences);
    }
    else {
       struct glx_context *const gc = __glXGetCurrentContext();
index d8a71664d0509b112057679adbb1db7f0227f785..3c06f8d2150c7a48d6638c63b8e57753a75a18a4 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "packsingle.h"
 #include "indirect.h"
-#include "glapitable.h"
 #include "glapi.h"
 #include "glthread.h"
 #include <GL/glxproto.h>
@@ -117,8 +116,11 @@ void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
    if (gc->isDirect) {
-      GET_DISPATCH()->GetSeparableFilter(target, format, type,
-                                         row, column, span);
+      const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH();
+      PFNGLGETSEPARABLEFILTEREXTPROC p =
+         (PFNGLGETSEPARABLEFILTEREXTPROC) table[359];
+
+      p(target, format, type, row, column, span);
       return;
    }
    else
index b90b16744289b675d7968bb3c54898fc37e1951a..ca3a790560590c1b30220ac2ae7095f6f4cd7111 100644 (file)
@@ -423,7 +423,10 @@ __indirect_get_proc_address(const char *name)
                                print ''
                                print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)'
                                print '    if (gc->isDirect) {'
-                               print '    %sGET_DISPATCH()->%s(%s);' % (ret_string, func.name, func.get_called_parameter_string())
+                               print '        const _glapi_proc *const table = GET_DISPATCH();'
+                               print '        PFNGL%sPROC p =' % (name.upper())
+                               print '            (PFNGL%sPROC) table[%d];' % (name.upper(), func.offset)
+                               print '    %sp(%s);' % (ret_string, func.get_called_parameter_string())
                                print '    } else'
                                print '#endif'
                                print '    {'