glx: Don't use glapitable.h at all

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>
This commit is contained in:
Ian Romanick
2012-07-31 16:58:41 -07:00
parent f5dffb7e36
commit 99fee476a1
4 changed files with 14 additions and 7 deletions

View File

@@ -51,7 +51,6 @@
#include <stdint.h> #include <stdint.h>
#endif #endif
#include "GL/glxproto.h" #include "GL/glxproto.h"
#include "glapi/glapitable.h"
#include "glxconfig.h" #include "glxconfig.h"
#include "glxhash.h" #include "glxhash.h"
#if defined( PTHREADS ) #if defined( PTHREADS )

View File

@@ -35,7 +35,6 @@
#include "glxextensions.h" #include "glxextensions.h"
#include "indirect.h" #include "indirect.h"
#include "indirect_vertex_array.h" #include "indirect_vertex_array.h"
#include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#ifdef USE_XCB #ifdef USE_XCB
#include <xcb/xcb.h> #include <xcb/xcb.h>
@@ -943,7 +942,11 @@ glAreTexturesResidentEXT(GLsizei n, const GLuint * textures,
struct glx_context *const gc = __glXGetCurrentContext(); struct glx_context *const gc = __glXGetCurrentContext();
if (gc->isDirect) { 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 { else {
struct glx_context *const gc = __glXGetCurrentContext(); struct glx_context *const gc = __glXGetCurrentContext();

View File

@@ -30,7 +30,6 @@
#include "packsingle.h" #include "packsingle.h"
#include "indirect.h" #include "indirect.h"
#include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"
#include <GL/glxproto.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 defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
if (gc->isDirect) { if (gc->isDirect) {
GET_DISPATCH()->GetSeparableFilter(target, format, type, const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH();
row, column, span); PFNGLGETSEPARABLEFILTEREXTPROC p =
(PFNGLGETSEPARABLEFILTEREXTPROC) table[359];
p(target, format, type, row, column, span);
return; return;
} }
else else

View File

@@ -423,7 +423,10 @@ __indirect_get_proc_address(const char *name)
print '' print ''
print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)' print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)'
print ' if (gc->isDirect) {' 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 ' } else'
print '#endif' print '#endif'
print ' {' print ' {'