xserver/GL/glx g_disptab_EXT.c, 1.5, 1.6 g_disptab_EXT.h, 1.5, 1.6 g_render.c, 1.7, 1.8 g_renderswap.c, 1.6, 1.7 g_single.c, 1.4, 1.5 g_singleswap.c, 1.4, 1.5 glxcmds.c, 1.12, 1.13 glxcmdsswap.c, 1.6, 1.7 glxscreens.c, 1.16, 1.17 glxserver.h, 1.6, 1.7 render2.c, 1.4, 1.5 render2swap.c, 1.4, 1.5 renderpix.c, 1.3, 1.4 renderpixswap.c, 1.3, 1.4 rensizetab.c, 1.5, 1.6 single2.c, 1.5, 1.6 single2swap.c, 1.4, 1.5 singlepix.c, 1.3, 1.4 singlepixswap.c, 1.4, 1.5 singlesize.c, 1.8, 1.9 xfont.c, 1.3, 1.4

David Reveman <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Tue, 7 Jun 2005 08:25:05 -0700 (PDT)
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: davidr

Update of /cvs/xserver/xserver/GL/glx
In directory gabe:/tmp/cvs-serv26190/GL/glx

Modified Files:
	g_disptab_EXT.c g_disptab_EXT.h g_render.c g_renderswap.c 
	g_single.c g_singleswap.c glxcmds.c glxcmdsswap.c glxscreens.c 
	glxserver.h render2.c render2swap.c renderpix.c 
	renderpixswap.c rensizetab.c single2.c single2swap.c 
	singlepix.c singlepixswap.c singlesize.c xfont.c 
Log Message:
Have all GL calls in the GLX code go through a procedure table and add support for GLX_MESA_render_texture

Index: g_disptab_EXT.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/g_disptab_EXT.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- g_disptab_EXT.c	19 Jan 2004 05:34:52 -0000	1.5
+++ g_disptab_EXT.c	7 Jun 2005 15:25:02 -0000	1.6
@@ -2209,6 +2209,9 @@
 	__glXDisp_DeleteTexturesEXT, /* 12 */
 	__glXDisp_GenTexturesEXT, /* 13 */
 	__glXDisp_IsTextureEXT, /* 14 */
+	__glXDisp_BindTexImageMESA, /* 15 */
+	__glXDisp_ReleaseTexImageMESA, /* 16 */
+	__glXDisp_QueryDrawableMESA /* 17 */
 };
 
 
@@ -4389,5 +4392,8 @@
 	__glXDispSwap_DeleteTexturesEXT, /* 12 */
 	__glXDispSwap_GenTexturesEXT, /* 13 */
 	__glXDispSwap_IsTextureEXT, /* 14 */
+	__glXDispSwap_BindTexImageMESA, /* 15 */
+	__glXDispSwap_ReleaseTexImageMESA, /* 16 */
+	__glXDispSwap_QueryDrawableMESA /* 17 */
 };
 

Index: g_disptab_EXT.h
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/g_disptab_EXT.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- g_disptab_EXT.h	19 Jan 2004 05:34:52 -0000	1.5
+++ g_disptab_EXT.h	7 Jun 2005 15:25:02 -0000	1.6
@@ -142,10 +142,17 @@
 extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
 extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
 
+extern int __glXDisp_BindTexImageMESA(__GLXclientState*, GLbyte*);
+extern int __glXDisp_ReleaseTexImageMESA(__GLXclientState*, GLbyte*);
+extern int __glXDisp_QueryDrawableMESA(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_BindTexImageMESA(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_ReleaseTexImageMESA(__GLXclientState*, GLbyte*);
+extern int __glXDispSwap_QueryDrawableMESA(__GLXclientState*, GLbyte*);
+
 #define __GLX_MIN_RENDER_OPCODE_EXT 2053
 #define __GLX_MAX_RENDER_OPCODE_EXT 4222
 #define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
-#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
+#define __GLX_MAX_VENDPRIV_OPCODE_EXT 17
 #define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
 #define __GLX_RENDER_TABLE_SIZE_EXT (__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1)
 extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];

Index: g_render.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/g_render.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- g_render.c	19 Jan 2004 21:54:06 -0000	1.7
+++ g_render.c	7 Jun 2005 15:25:02 -0000	1.8
@@ -40,21 +40,21 @@
 
 void __glXDisp_CallList(GLbyte *pc)
 {
-	glCallList( 
+	(*__glRenderTable->CallList)( 
 		*(GLuint   *)(pc + 0)
 	);
 }
 
 void __glXDisp_ListBase(GLbyte *pc)
 {
[...2060 lines suppressed...]
 		*(GLenum *)(pc + 0)
 	);
 }
 
 void __glXDisp_WindowPos3fARB(GLbyte *pc)
 {
-	glWindowPos3fARB(
+	(*__glRenderTableEXT->WindowPos3fMESA)(
 		*(GLfloat *)(pc + 0),
 		*(GLfloat *)(pc + 4),
 		*(GLfloat *)(pc + 8)
@@ -2264,7 +2264,7 @@
 
 void __glXDisp_SampleCoverageARB(GLbyte *pc)
 {
-	glSampleCoverageARB(
+	(*__glRenderTableEXT->SampleCoverageARB)(
 		*(GLfloat *)(pc + 0),
 		*(GLboolean *)(pc + 4)
 	);

Index: g_renderswap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/g_renderswap.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- g_renderswap.c	4 Oct 2003 00:18:57 -0000	1.6
+++ g_renderswap.c	7 Jun 2005 15:25:02 -0000	1.7
@@ -43,7 +43,7 @@
 
 	__GLX_SWAP_INT(pc + 0);
 
-	glCallList( 
+	(*__glRenderTable->CallList)( 
 		*(GLuint   *)(pc + 0)
 	);
 }
@@ -54,7 +54,7 @@
 
 	__GLX_SWAP_INT(pc + 0);
[...1999 lines suppressed...]
 	);
 }
@@ -3358,7 +3358,7 @@
 	__GLX_SWAP_FLOAT(pc + 0);
 	__GLX_SWAP_FLOAT(pc + 4);
 	__GLX_SWAP_FLOAT(pc + 8);
-	glWindowPos3fARB(
+	(*__glRenderTableEXT->WindowPos3fMESA)(
 		*(GLfloat *)(pc + 0),
 		*(GLfloat *)(pc + 4),
 		*(GLfloat *)(pc + 8)
@@ -3371,7 +3371,7 @@
 	__GLX_SWAP_FLOAT(pc + 0);
 	__GLX_SWAP_INT(pc + 4);
 
-	glSampleCoverageARB(
+	(*__glRenderTableEXT->SampleCoverageARB)(
 		*(GLfloat *)(pc + 0),
 		*(GLboolean *)(pc + 4)
 	);

Index: g_single.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/g_single.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- g_single.c	27 Jan 2002 20:05:26 -0000	1.4
+++ g_single.c	7 Jun 2005 15:25:02 -0000	1.5
@@ -48,7 +48,7 @@
 	}
 	pc += __GLX_SINGLE_HDR_SIZE;
 
-	glNewList( 
+	(*__glRenderTable->NewList)( 
 		*(GLuint   *)(pc + 0),
 		*(GLenum   *)(pc + 4)
 	);
@@ -66,7 +66,7 @@
 		return error;
 	}
 
-	glEndList( 
+	(*__glRenderTable->EndList)( 
 	);
 	return Success;
 }
@@ -82,7 +82,7 @@
 	}
 	pc += __GLX_SINGLE_HDR_SIZE;
 
-	glDeleteLists( 
+	(*__glRenderTable->DeleteLists)( 
 		*(GLuint   *)(pc + 0),
 		*(GLsizei  *)(pc + 4)
 	);
@@ -104,7 +104,7 @@
 	pc += __GLX_SINGLE_HDR_SIZE;
 
 	retval =
-	glGenLists( 
+	(*__glRenderTable->GenLists)( 
 		*(GLsizei  *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -124,7 +124,7 @@
 	}
 	pc += __GLX_SINGLE_HDR_SIZE;
 
-	glPixelStoref( 
+	(*__glRenderTable->PixelStoref)( 
 		*(GLenum   *)(pc + 0),
 		*(GLfloat  *)(pc + 4)
 	);
@@ -143,7 +143,7 @@
 	}
 	pc += __GLX_SINGLE_HDR_SIZE;
 
-	glPixelStorei( 
+	(*__glRenderTable->PixelStorei)( 
 		*(GLenum   *)(pc + 0),
 		*(GLint    *)(pc + 4)
 	);
@@ -172,7 +172,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
 	__glXClearErrorOccured();
-	glGetBooleanv( 
+	(*__glRenderTable->GetBooleanv)( 
 		*(GLenum   *)(pc + 0),
 		(GLboolean *) answer
 	);
@@ -215,7 +215,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
 	__glXClearErrorOccured();
-	glGetDoublev( 
+	(*__glRenderTable->GetDoublev)( 
 		*(GLenum   *)(pc + 0),
 		(GLdouble *) answer
 	);
@@ -250,7 +250,7 @@
 	}
 
 	retval =
-	glGetError( 
+	(*__glRenderTable->GetError)( 
 	);
 	__GLX_PUT_RETVAL(retval);
 	__GLX_BEGIN_REPLY(0);
@@ -279,7 +279,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetFloatv( 
+	(*__glRenderTable->GetFloatv)( 
 		*(GLenum   *)(pc + 0),
 		(GLfloat  *) answer
 	);
@@ -322,7 +322,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetIntegerv( 
+	(*__glRenderTable->GetIntegerv)( 
 		*(GLenum   *)(pc + 0),
 		(GLint    *) answer
 	);
@@ -365,7 +365,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetLightfv( 
+	(*__glRenderTable->GetLightfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -409,7 +409,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetLightiv( 
+	(*__glRenderTable->GetLightiv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -455,7 +455,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
 	__glXClearErrorOccured();
-	glGetMapdv( 
+	(*__glRenderTable->GetMapdv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLdouble *) answer
@@ -501,7 +501,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMapfv( 
+	(*__glRenderTable->GetMapfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -547,7 +547,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMapiv( 
+	(*__glRenderTable->GetMapiv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -591,7 +591,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMaterialfv( 
+	(*__glRenderTable->GetMaterialfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -635,7 +635,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMaterialiv( 
+	(*__glRenderTable->GetMaterialiv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -679,7 +679,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetPixelMapfv( 
+	(*__glRenderTable->GetPixelMapfv)( 
 		*(GLenum   *)(pc + 0),
 		(GLfloat  *) answer
 	);
@@ -722,7 +722,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetPixelMapuiv( 
+	(*__glRenderTable->GetPixelMapuiv)( 
 		*(GLenum   *)(pc + 0),
 		(GLuint   *) answer
 	);
@@ -765,7 +765,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*2,2);
 	__glXClearErrorOccured();
-	glGetPixelMapusv( 
+	(*__glRenderTable->GetPixelMapusv)( 
 		*(GLenum   *)(pc + 0),
 		(GLushort *) answer
 	);
@@ -808,7 +808,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexEnvfv( 
+	(*__glRenderTable->GetTexEnvfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -852,7 +852,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexEnviv( 
+	(*__glRenderTable->GetTexEnviv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -896,7 +896,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
 	__glXClearErrorOccured();
-	glGetTexGendv( 
+	(*__glRenderTable->GetTexGendv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLdouble *) answer
@@ -940,7 +940,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexGenfv( 
+	(*__glRenderTable->GetTexGenfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -984,7 +984,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexGeniv( 
+	(*__glRenderTable->GetTexGeniv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1028,7 +1028,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexParameterfv( 
+	(*__glRenderTable->GetTexParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1072,7 +1072,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexParameteriv( 
+	(*__glRenderTable->GetTexParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1116,7 +1116,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexLevelParameterfv( 
+	(*__glRenderTable->GetTexLevelParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLint    *)(pc + 4),
 		*(GLenum   *)(pc + 8),
@@ -1161,7 +1161,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexLevelParameteriv( 
+	(*__glRenderTable->GetTexLevelParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLint    *)(pc + 4),
 		*(GLenum   *)(pc + 8),
@@ -1199,7 +1199,7 @@
 	pc += __GLX_SINGLE_HDR_SIZE;
 
 	retval =
-	glIsEnabled( 
+	(*__glRenderTable->IsEnabled)( 
 		*(GLenum   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1222,7 +1222,7 @@
 	pc += __GLX_SINGLE_HDR_SIZE;
 
 	retval =
-	glIsList( 
+	(*__glRenderTable->IsList)( 
 		*(GLuint   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1250,7 +1250,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
 	retval =
-	glAreTexturesResident( 
+	(*__glRenderTable->AreTexturesResident)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4),
 		(GLboolean *) answer
@@ -1275,7 +1275,7 @@
 	pc += __GLX_SINGLE_HDR_SIZE;
 	n = *(GLsizei *)(pc + 0);
 
-	glDeleteTextures( 
+	(*__glRenderTable->DeleteTextures)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4)
 	);
@@ -1299,7 +1299,7 @@
 	n = *(GLsizei *)(pc + 0);
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
-	glGenTextures( 
+	(*__glRenderTable->GenTextures)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *) answer
 	);
@@ -1323,7 +1323,7 @@
 	pc += __GLX_SINGLE_HDR_SIZE;
 
 	retval =
-	glIsTexture( 
+	(*__glRenderTable->IsTexture)( 
 		*(GLuint   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1353,7 +1353,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetColorTableParameterfv( 
+	(*__glRenderTable->GetColorTableParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1397,7 +1397,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetColorTableParameteriv( 
+	(*__glRenderTable->GetColorTableParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1441,7 +1441,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetConvolutionParameterfv( 
+	(*__glRenderTable->GetConvolutionParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1485,7 +1485,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetConvolutionParameteriv( 
+	(*__glRenderTable->GetConvolutionParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1529,7 +1529,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetHistogramParameterfv( 
+	(*__glRenderTable->GetHistogramParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1573,7 +1573,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetHistogramParameteriv( 
+	(*__glRenderTable->GetHistogramParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1617,7 +1617,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMinmaxParameterfv( 
+	(*__glRenderTable->GetMinmaxParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1661,7 +1661,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMinmaxParameteriv( 
+	(*__glRenderTable->GetMinmaxParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1703,7 +1703,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
 	retval =
-	glAreTexturesResidentEXT( 
+	(*__glRenderTableEXT->AreTexturesResidentEXT)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4),
 		(GLboolean *) answer
@@ -1728,7 +1728,7 @@
 	pc += __GLX_VENDPRIV_HDR_SIZE;
 	n = *(GLsizei *)(pc + 0);
 
-	glDeleteTexturesEXT( 
+	(*__glRenderTable->DeleteTextures)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4)
 	);
@@ -1752,7 +1752,7 @@
 	n = *(GLsizei *)(pc + 0);
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
-	glGenTexturesEXT( 
+	(*__glRenderTableEXT->GenTexturesEXT)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *) answer
 	);
@@ -1776,7 +1776,7 @@
 	pc += __GLX_VENDPRIV_HDR_SIZE;
 
 	retval =
-	glIsTextureEXT( 
+	(*__glRenderTableEXT->IsTextureEXT)( 
 		*(GLuint   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1785,3 +1785,156 @@
 	return Success;
 }
 
+int __glXDisp_BindTexImageMESA(__GLXclientState *cl, GLbyte *pc)
+{
+	GLboolean retval;
+	__GLXcontext *cx;
+	ClientPtr client = cl->client;
+	int error;
+	GLXDrawable drawId;
+	DrawablePtr pDraw;
+
+	cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+	if (!cx) {
+		return error;
+	}
+	
+	pc += __GLX_VENDPRIV_HDR_SIZE;
+
+	drawId = *((GLXDrawable *) pc);
+	
+	pDraw = (DrawablePtr) LookupDrawable (drawId, client);
+	if (pDraw)
+	{
+	    if (pDraw->type != DRAWABLE_WINDOW)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	}
+	else
+	{
+	    __GLXpixmap *drawPixmap;
+	    
+	    drawPixmap = (__GLXpixmap *) LookupIDByType (drawId,
+							 __glXPixmapRes);
+	    if (!drawPixmap)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	    pDraw = drawPixmap->pDraw;
+	}
+
+	retval = (*__glRenderTableEXT->BindTexImageMESA) (pDraw,
+							  *(int *)(pc + 4));
+	
+	__GLX_PUT_RETVAL(retval);
+	__GLX_BEGIN_REPLY(0);
+	__GLX_SEND_HEADER();
+	return Success;
+}
+
+int __glXDisp_ReleaseTexImageMESA(__GLXclientState *cl, GLbyte *pc)
+{
+	GLboolean retval;
+	__GLXcontext *cx;
+	ClientPtr client = cl->client;
+	int error;
+	GLXDrawable drawId;
+	DrawablePtr pDraw;
+
+	cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+	if (!cx) {
+		return error;
+	}
+	pc += __GLX_VENDPRIV_HDR_SIZE;
+
+	drawId = *((GLXDrawable *) pc);
+	
+	pDraw = (DrawablePtr) LookupDrawable (drawId, client);
+	if (pDraw)
+	{
+	    if (pDraw->type != DRAWABLE_WINDOW)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	}
+	else
+	{
+	    __GLXpixmap *drawPixmap;
+	    
+	    drawPixmap = (__GLXpixmap *) LookupIDByType (drawId,
+							 __glXPixmapRes);
+	    if (!drawPixmap)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	    pDraw = drawPixmap->pDraw;
+	}
+
+	retval = (*__glRenderTableEXT->ReleaseTexImageMESA) (pDraw,
+							     *(int *)(pc + 4));
+	
+	__GLX_PUT_RETVAL(retval);
+	__GLX_BEGIN_REPLY(0);
+	__GLX_SEND_HEADER();
+	return Success;
+}
+
+int __glXDisp_QueryDrawableMESA(__GLXclientState *cl, GLbyte *pc)
+{
+	GLboolean retval;
+	__GLXcontext *cx;
+	ClientPtr client = cl->client;
+	int error;
+	GLint answerBuffer[200];
+	char *answer;
+	GLXDrawable drawId;
+	DrawablePtr pDraw;
+	
+	cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+	if (!cx) {
+		return error;
+	}
+	pc += __GLX_VENDPRIV_HDR_SIZE;
+
+	drawId = *((GLXDrawable *) pc);
+	
+	pDraw = (DrawablePtr) LookupDrawable (drawId, client);
+	if (pDraw)
+	{
+	    if (pDraw->type != DRAWABLE_WINDOW)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	}
+	else
+	{
+	    __GLXpixmap *drawPixmap;
+	    
+	    drawPixmap = (__GLXpixmap *) LookupIDByType (drawId,
+							 __glXPixmapRes);
+	    if (!drawPixmap)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	    pDraw = drawPixmap->pDraw;
+	}
+
+	__GLX_GET_ANSWER_BUFFER(answer,cl,4,4);
+	retval = (*__glRenderTableEXT->QueryDrawableMESA) (pDraw,
+							   *(int *)(pc + 4),
+							   (unsigned int *)
+							   (answer));
+	
+	__GLX_PUT_RETVAL(retval);
+	__GLX_BEGIN_REPLY(4);
+	__GLX_SEND_HEADER();
+	__GLX_SEND_INT_ARRAY(1);
+	return Success;
+}

Index: g_singleswap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/g_singleswap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- g_singleswap.c	27 Jan 2002 20:05:26 -0000	1.4
+++ g_singleswap.c	7 Jun 2005 15:25:02 -0000	1.5
@@ -52,7 +52,7 @@
 	__GLX_SWAP_INT(pc + 0);
 	__GLX_SWAP_INT(pc + 4);
 
-	glNewList( 
+	(*__glRenderTable->NewList)( 
 		*(GLuint   *)(pc + 0),
 		*(GLenum   *)(pc + 4)
 	);
@@ -72,7 +72,7 @@
 		return error;
 	}
 
-	glEndList( 
+	(*__glRenderTable->EndList)( 
 	);
 	return Success;
 }
@@ -92,7 +92,7 @@
 	__GLX_SWAP_INT(pc + 0);
 	__GLX_SWAP_INT(pc + 4);
 
-	glDeleteLists( 
+	(*__glRenderTable->DeleteLists)( 
 		*(GLuint   *)(pc + 0),
 		*(GLsizei  *)(pc + 4)
 	);
@@ -117,7 +117,7 @@
 	__GLX_SWAP_INT(pc + 0);
 
 	retval =
-	glGenLists( 
+	(*__glRenderTable->GenLists)( 
 		*(GLsizei  *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -143,7 +143,7 @@
 	__GLX_SWAP_INT(pc + 0);
 	__GLX_SWAP_FLOAT(pc + 4);
 
-	glPixelStoref( 
+	(*__glRenderTable->PixelStoref)( 
 		*(GLenum   *)(pc + 0),
 		*(GLfloat  *)(pc + 4)
 	);
@@ -166,7 +166,7 @@
 	__GLX_SWAP_INT(pc + 0);
 	__GLX_SWAP_INT(pc + 4);
 
-	glPixelStorei( 
+	(*__glRenderTable->PixelStorei)( 
 		*(GLenum   *)(pc + 0),
 		*(GLint    *)(pc + 4)
 	);
@@ -198,7 +198,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
 	__glXClearErrorOccured();
-	glGetBooleanv( 
+	(*__glRenderTable->GetBooleanv)( 
 		*(GLenum   *)(pc + 0),
 		(GLboolean *) answer
 	);
@@ -250,7 +250,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
 	__glXClearErrorOccured();
-	glGetDoublev( 
+	(*__glRenderTable->GetDoublev)( 
 		*(GLenum   *)(pc + 0),
 		(GLdouble *) answer
 	);
@@ -293,7 +293,7 @@
 	}
 
 	retval =
-	glGetError( 
+	(*__glRenderTable->GetError)( 
 	);
 	__GLX_PUT_RETVAL(retval);
 	__GLX_SWAP_REPLY_RETVAL();
@@ -328,7 +328,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetFloatv( 
+	(*__glRenderTable->GetFloatv)( 
 		*(GLenum   *)(pc + 0),
 		(GLfloat  *) answer
 	);
@@ -381,7 +381,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetIntegerv( 
+	(*__glRenderTable->GetIntegerv)( 
 		*(GLenum   *)(pc + 0),
 		(GLint    *) answer
 	);
@@ -435,7 +435,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetLightfv( 
+	(*__glRenderTable->GetLightfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -490,7 +490,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetLightiv( 
+	(*__glRenderTable->GetLightiv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -547,7 +547,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
 	__glXClearErrorOccured();
-	glGetMapdv( 
+	(*__glRenderTable->GetMapdv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLdouble *) answer
@@ -604,7 +604,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMapfv( 
+	(*__glRenderTable->GetMapfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -661,7 +661,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMapiv( 
+	(*__glRenderTable->GetMapiv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -716,7 +716,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMaterialfv( 
+	(*__glRenderTable->GetMaterialfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -771,7 +771,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMaterialiv( 
+	(*__glRenderTable->GetMaterialiv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -825,7 +825,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetPixelMapfv( 
+	(*__glRenderTable->GetPixelMapfv)( 
 		*(GLenum   *)(pc + 0),
 		(GLfloat  *) answer
 	);
@@ -878,7 +878,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetPixelMapuiv( 
+	(*__glRenderTable->GetPixelMapuiv)( 
 		*(GLenum   *)(pc + 0),
 		(GLuint   *) answer
 	);
@@ -931,7 +931,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*2,2);
 	__glXClearErrorOccured();
-	glGetPixelMapusv( 
+	(*__glRenderTable->GetPixelMapusv)( 
 		*(GLenum   *)(pc + 0),
 		(GLushort *) answer
 	);
@@ -985,7 +985,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexEnvfv( 
+	(*__glRenderTable->GetTexEnvfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1040,7 +1040,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexEnviv( 
+	(*__glRenderTable->GetTexEnviv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1095,7 +1095,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*8,8);
 	__glXClearErrorOccured();
-	glGetTexGendv( 
+	(*__glRenderTable->GetTexGendv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLdouble *) answer
@@ -1150,7 +1150,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexGenfv( 
+	(*__glRenderTable->GetTexGenfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1205,7 +1205,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexGeniv( 
+	(*__glRenderTable->GetTexGeniv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1260,7 +1260,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexParameterfv( 
+	(*__glRenderTable->GetTexParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1315,7 +1315,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexParameteriv( 
+	(*__glRenderTable->GetTexParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1371,7 +1371,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexLevelParameterfv( 
+	(*__glRenderTable->GetTexLevelParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLint    *)(pc + 4),
 		*(GLenum   *)(pc + 8),
@@ -1428,7 +1428,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetTexLevelParameteriv( 
+	(*__glRenderTable->GetTexLevelParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLint    *)(pc + 4),
 		*(GLenum   *)(pc + 8),
@@ -1475,7 +1475,7 @@
 	__GLX_SWAP_INT(pc + 0);
 
 	retval =
-	glIsEnabled( 
+	(*__glRenderTable->IsEnabled)( 
 		*(GLenum   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1503,7 +1503,7 @@
 	__GLX_SWAP_INT(pc + 0);
 
 	retval =
-	glIsList( 
+	(*__glRenderTable->IsList)( 
 		*(GLuint   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1538,7 +1538,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
 	retval =
-	glAreTexturesResident( 
+	(*__glRenderTable->AreTexturesResident)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4),
 		(GLboolean *) answer
@@ -1570,7 +1570,7 @@
 	n = *(GLsizei *)(pc + 0);
 	__GLX_SWAP_INT_ARRAY(pc + 4, n);
 
-	glDeleteTextures( 
+	(*__glRenderTable->DeleteTextures)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4)
 	);
@@ -1598,7 +1598,7 @@
 	n = *(GLsizei *)(pc + 0);
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
-	glGenTextures( 
+	(*__glRenderTable->GenTextures)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *) answer
 	);
@@ -1627,7 +1627,7 @@
 	__GLX_SWAP_INT(pc + 0);
 
 	retval =
-	glIsTexture( 
+	(*__glRenderTable->IsTexture)( 
 		*(GLuint   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -1664,7 +1664,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetColorTableParameterfv( 
+	(*__glRenderTable->GetColorTableParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1719,7 +1719,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetColorTableParameteriv( 
+	(*__glRenderTable->GetColorTableParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1774,7 +1774,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetConvolutionParameterfv( 
+	(*__glRenderTable->GetConvolutionParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1829,7 +1829,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetConvolutionParameteriv( 
+	(*__glRenderTable->GetConvolutionParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1884,7 +1884,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetHistogramParameterfv( 
+	(*__glRenderTable->GetHistogramParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -1939,7 +1939,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetHistogramParameteriv( 
+	(*__glRenderTable->GetHistogramParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -1994,7 +1994,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMinmaxParameterfv( 
+	(*__glRenderTable->GetMinmaxParameterfv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLfloat  *) answer
@@ -2049,7 +2049,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,compsize*4,4);
 	__glXClearErrorOccured();
-	glGetMinmaxParameteriv( 
+	(*__glRenderTable->GetMinmaxParameteriv)( 
 		*(GLenum   *)(pc + 0),
 		*(GLenum   *)(pc + 4),
 		(GLint    *) answer
@@ -2102,7 +2102,7 @@
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n,1);
 	retval =
-	glAreTexturesResidentEXT( 
+	(*__glRenderTableEXT->AreTexturesResidentEXT)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4),
 		(GLboolean *) answer
@@ -2134,7 +2134,7 @@
 	n = *(GLsizei *)(pc + 0);
 	__GLX_SWAP_INT_ARRAY(pc + 4, n);
 
-	glDeleteTexturesEXT( 
+	(*__glRenderTable->DeleteTextures)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *)(pc + 4)
 	);
@@ -2162,7 +2162,7 @@
 	n = *(GLsizei *)(pc + 0);
 
 	__GLX_GET_ANSWER_BUFFER(answer,cl,n*4,4);
-	glGenTexturesEXT( 
+	(*__glRenderTableEXT->GenTexturesEXT)( 
 		*(GLsizei  *)(pc + 0),
 		(GLuint   *) answer
 	);
@@ -2191,7 +2191,7 @@
 	__GLX_SWAP_INT(pc + 0);
 
 	retval =
-	glIsTextureEXT( 
+	(*__glRenderTableEXT->IsTextureEXT)( 
 		*(GLuint   *)(pc + 0)
 	);
 	__GLX_PUT_RETVAL(retval);
@@ -2202,3 +2202,180 @@
 	return Success;
 }
 
+int __glXDispSwap_BindTexImageMESA(__GLXclientState *cl, GLbyte *pc)
+{
+	GLboolean retval;
+	__GLXcontext *cx;
+	ClientPtr client = cl->client;
+	int error;
+	GLXDrawable drawId;
+	DrawablePtr pDraw;
+	__GLX_DECLARE_SWAP_VARIABLES;
+
+	__GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+	cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+	if (!cx) {
+		return error;
+	}
+	pc += __GLX_VENDPRIV_HDR_SIZE;
+	__GLX_SWAP_INT(pc + 0);
+	__GLX_SWAP_INT(pc + 4);
+
+	drawId = *((GLXDrawable *) pc);
+	
+	pDraw = (DrawablePtr) LookupDrawable (drawId, client);
+	if (pDraw)
+	{
+	    if (pDraw->type != DRAWABLE_WINDOW)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	}
+	else
+	{
+	    __GLXpixmap *drawPixmap;
+	    
+	    drawPixmap = (__GLXpixmap *) LookupIDByType (drawId,
+							 __glXPixmapRes);
+	    if (!drawPixmap)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	    pDraw = drawPixmap->pDraw;
+	}
+
+	retval =
+	(*__glRenderTableEXT->BindTexImageMESA)( 
+	    pDraw,
+	    *(int         *)(pc + 4)
+	);
+	__GLX_PUT_RETVAL(retval);
+	__GLX_SWAP_REPLY_RETVAL();
+	__GLX_BEGIN_REPLY(0);
+	__GLX_SWAP_REPLY_HEADER();
+	__GLX_SEND_HEADER();
+	return Success;
+}
+
+int __glXDispSwap_ReleaseTexImageMESA(__GLXclientState *cl, GLbyte *pc)
+{
+	GLboolean retval;
+	__GLXcontext *cx;
+	ClientPtr client = cl->client;
+	int error;
+	GLXDrawable drawId;
+	DrawablePtr pDraw;
+	__GLX_DECLARE_SWAP_VARIABLES;
+
+	__GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+	cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+	if (!cx) {
+		return error;
+	}
+	pc += __GLX_VENDPRIV_HDR_SIZE;
+	__GLX_SWAP_INT(pc + 0);
+	__GLX_SWAP_INT(pc + 4);
+
+	drawId = *((GLXDrawable *) pc);
+	
+	pDraw = (DrawablePtr) LookupDrawable (drawId, client);
+	if (pDraw)
+	{
+	    if (pDraw->type != DRAWABLE_WINDOW)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	}
+	else
+	{
+	    __GLXpixmap *drawPixmap;
+	    
+	    drawPixmap = (__GLXpixmap *) LookupIDByType (drawId,
+							 __glXPixmapRes);
+	    if (!drawPixmap)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	    pDraw = drawPixmap->pDraw;
+	}
+	
+	retval =
+	(*__glRenderTableEXT->ReleaseTexImageMESA)( 
+	    pDraw,
+	    *(int         *)(pc + 4)
+	);
+	__GLX_PUT_RETVAL(retval);
+	__GLX_SWAP_REPLY_RETVAL();
+	__GLX_BEGIN_REPLY(0);
+	__GLX_SWAP_REPLY_HEADER();
+	__GLX_SEND_HEADER();
+	return Success;
+}
+
+int __glXDispSwap_QueryDrawableMESA(__GLXclientState *cl, GLbyte *pc)
+{
+	GLboolean retval;
+	__GLXcontext *cx;
+	ClientPtr client = cl->client;
+	int error;
+	GLboolean answerBuffer[200];
+	char *answer;
+	GLXDrawable drawId;
+	DrawablePtr pDraw;
+	__GLX_DECLARE_SWAP_VARIABLES;
+	__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+	__GLX_SWAP_INT(&((xGLXVendorPrivateReq *)pc)->contextTag);
+	cx = __glXForceCurrent(cl, __GLX_GET_VENDPRIV_CONTEXT_TAG(pc), &error);
+	if (!cx) {
+		return error;
+	}
+	pc += __GLX_VENDPRIV_HDR_SIZE;
+	__GLX_SWAP_INT(pc + 0);
+	__GLX_SWAP_INT(pc + 4);
+
+	drawId = *((GLXDrawable *) pc);
+	
+	pDraw = (DrawablePtr) LookupDrawable (drawId, client);
+	if (pDraw)
+	{
+	    if (pDraw->type != DRAWABLE_WINDOW)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	}
+	else
+	{
+	    __GLXpixmap *drawPixmap;
+	    
+	    drawPixmap = (__GLXpixmap *) LookupIDByType (drawId,
+							 __glXPixmapRes);
+	    if (!drawPixmap)
+	    {
+		client->errorValue = drawId;
+		return __glXBadDrawable;
+	    }
+	    pDraw = drawPixmap->pDraw;
+	}
+	
+	__GLX_GET_ANSWER_BUFFER(answer,cl,4,1);
+	retval =
+	(*__glRenderTableEXT->QueryDrawableMESA)( 
+	    pDraw,
+	    *(int          *)(pc + 4),
+	    (unsigned int *) (answer)
+	);
+	__GLX_SWAP_INT_ARRAY(answer, 1);
+	__GLX_PUT_RETVAL(retval);
+	__GLX_SWAP_REPLY_RETVAL();
+	__GLX_BEGIN_REPLY(4);
+	__GLX_SWAP_REPLY_HEADER();
+	__GLX_SEND_HEADER();
+	__GLX_SEND_INT_ARRAY(1);
+	return Success;
+}

Index: glxcmds.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/glxcmds.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- glxcmds.c	4 Oct 2003 00:18:57 -0000	1.12
+++ glxcmds.c	7 Jun 2005 15:25:02 -0000	1.13
@@ -50,6 +50,9 @@
 
 /************************************************************************/
 
+__glProcTable     *__glRenderTable     = NULL;
+__glProcTableEXT  *__glRenderTableEXT  = NULL;
+
 static __GLimports imports = {
     __glXImpMalloc,
     __glXImpCalloc,
@@ -592,7 +595,7 @@
 	*/
 	if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) {
 	    if (__glXForceCurrent(cl, tag, (int *)&error)) {
-		glFlush();
+		(*__glRenderTable->Flush)();
 		__GLX_NOTE_FLUSHED_CMDS(prevglxc);
 	    } else {
 		return error;
@@ -775,7 +778,7 @@
     if (!__glXForceCurrent(cl, req->contextTag, &error)) {
 	return error;
     }
-    glFinish();
+    (*__glRenderTable->Finish)();
     return Success;
 }
 
@@ -861,7 +864,7 @@
 	    ** Do whatever is needed to make sure that all preceding requests
 	    ** in both streams are completed before the copy is executed.
 	    */
-	    glFinish();
+	    (*__glRenderTable->Finish)();
 	    __GLX_NOTE_FLUSHED_CMDS(tagcx);
 	} else {
 	    return error;
@@ -1134,7 +1137,7 @@
 	    ** Do whatever is needed to make sure that all preceding requests
 	    ** in both streams are completed before the swap is executed.
 	    */
-	    glFinish();
+	    (*__glRenderTable->Finish)();
 	    __GLX_NOTE_FLUSHED_CMDS(glxc);
 	} else {
 	    return error;
@@ -1240,7 +1243,7 @@
     ** routine, __glXSwapRender().  Any changes made here should also be
     ** duplicated there.
     */
-    
+
     req = (xGLXRenderReq *) pc;
     glxc = __glXForceCurrent(cl, req->contextTag, &error);
     if (!glxc) {
@@ -1554,11 +1557,11 @@
 
     switch( vendorcode ) {
     case X_GLvop_SampleMaskSGIS:
-	glSampleMaskSGIS(*(GLfloat *)(pc + 4),
+	(*__glRenderTableEXT->SampleMaskSGIS)(*(GLfloat *)(pc + 4),
 			 *(GLboolean *)(pc + 8));
 	return Success;
     case X_GLvop_SamplePatternSGIS:
-	glSamplePatternSGIS( *(GLenum *)(pc + 4));
+	(*__glRenderTableEXT->SamplePatternSGIS)( *(GLenum *)(pc + 4));
 	return Success;
     }
 

Index: glxcmdsswap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/glxcmdsswap.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- glxcmdsswap.c	4 Oct 2003 00:18:57 -0000	1.6
+++ glxcmdsswap.c	7 Jun 2005 15:25:02 -0000	1.7
@@ -795,12 +795,12 @@
     case X_GLvop_SampleMaskSGIS:
 	__GLX_SWAP_FLOAT(pc + 4);
 	__GLX_SWAP_INT(pc + 8);
-	glSampleMaskSGIS(*(GLfloat *)(pc + 4),
+	(*__glRenderTableEXT->SampleMaskSGIS)(*(GLfloat *)(pc + 4),
 			 *(GLboolean *)(pc + 8));
 	return Success;
     case X_GLvop_SamplePatternSGIS:
 	__GLX_SWAP_INT(pc + 4);
-	glSamplePatternSGIS( *(GLenum *)(pc + 4));
+	(*__glRenderTableEXT->SamplePatternSGIS)( *(GLenum *)(pc + 4));
 	return Success;
     }
 

Index: glxscreens.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/glxscreens.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- glxscreens.c	19 Jan 2004 05:34:52 -0000	1.16
+++ glxscreens.c	7 Jun 2005 15:25:02 -0000	1.17
@@ -119,6 +119,7 @@
 			"GL_SGIX_depth_texture "
 			"GL_SGIX_shadow "
 			"GL_SGIX_shadow_ambient "
+			"GL_ARB_texture_non_power_of_two "
 			;
 
 /*
@@ -134,6 +135,7 @@
 			"GLX_EXT_import_context "
 			"GLX_SGI_make_current_read "
 			"GLX_SGIS_multisample "
+			"GLX_MESA_render_texture "
 			;
 
 /*

Index: glxserver.h
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/glxserver.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- glxserver.h	19 Jan 2004 05:34:52 -0000	1.6
+++ glxserver.h	7 Jun 2005 15:25:02 -0000	1.7
@@ -282,4 +282,450 @@
 extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap);
 extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap);
 
-#endif /* !__GLX_server_h__ */
+typedef struct _glProcTable {
+    void (*NewList) (GLuint list, GLenum mode);
+    void (*EndList) (void);
+    void (*CallList) (GLuint list);
+    void (*CallLists) (GLsizei n, GLenum type, const GLvoid *lists);
+    void (*DeleteLists) (GLuint list, GLsizei range);
+    GLuint (*GenLists) (GLsizei range);
+    void (*ListBase) (GLuint base);
+    void (*Begin) (GLenum mode);
+    void (*Bitmap) (GLsizei width, GLsizei height,
+		    GLfloat xorig, GLfloat yorig,
+		    GLfloat xmove, GLfloat ymove,
+		    const GLubyte *bitmap);
+    void (*Color3bv) (const GLbyte *v);
+    void (*Color3dv) (const GLdouble *v);
+    void (*Color3fv) (const GLfloat *v);
+    void (*Color3iv) (const GLint *v);
+    void (*Color3sv) (const GLshort *v);
+    void (*Color3ubv) (const GLubyte *v);
+    void (*Color3uiv) (const GLuint *v);
+    void (*Color3usv) (const GLushort *v);
+    void (*Color4bv) (const GLbyte *v);
+    void (*Color4dv) (const GLdouble *v);
+    void (*Color4fv) (const GLfloat *v);
+    void (*Color4iv) (const GLint *v);
+    void (*Color4sv) (const GLshort *v);
+    void (*Color4ubv) (const GLubyte *v);
+    void (*Color4uiv) (const GLuint *v);
+    void (*Color4usv) (const GLushort *v);
+    void (*EdgeFlagv) (const GLboolean *flag);
+    void (*End) (void);
+    void (*Indexdv) (const GLdouble *c);
+    void (*Indexfv) (const GLfloat *c);
+    void (*Indexiv) (const GLint *c);
+    void (*Indexsv) (const GLshort *c);
+    void (*Normal3bv) (const GLbyte *v);
+    void (*Normal3dv) (const GLdouble *v);
+    void (*Normal3fv) (const GLfloat *v);
+    void (*Normal3iv) (const GLint *v);
+    void (*Normal3sv) (const GLshort *v);
+    void (*RasterPos2dv) (const GLdouble *v);
+    void (*RasterPos2fv) (const GLfloat *v);
+    void (*RasterPos2iv) (const GLint *v);
+    void (*RasterPos2sv) (const GLshort *v);
+    void (*RasterPos3dv) (const GLdouble *v);
+    void (*RasterPos3fv) (const GLfloat *v);
+    void (*RasterPos3iv) (const GLint *v);
+    void (*RasterPos3sv) (const GLshort *v);
+    void (*RasterPos4dv) (const GLdouble *v);
+    void (*RasterPos4fv) (const GLfloat *v);
+    void (*RasterPos4iv) (const GLint *v);
+    void (*RasterPos4sv) (const GLshort *v);
+    void (*Rectdv) (const GLdouble *v1, const GLdouble *v2);
+    void (*Rectfv) (const GLfloat *v1, const GLfloat *v2);
+    void (*Rectiv) (const GLint *v1, const GLint *v2);
+    void (*Rectsv) (const GLshort *v1, const GLshort *v2);
+    void (*TexCoord1dv) (const GLdouble *v);
+    void (*TexCoord1fv) (const GLfloat *v);
+    void (*TexCoord1iv) (const GLint *v);
+    void (*TexCoord1sv) (const GLshort *v);
+    void (*TexCoord2dv) (const GLdouble *v);
+    void (*TexCoord2fv) (const GLfloat *v);
+    void (*TexCoord2iv) (const GLint *v);
+    void (*TexCoord2sv) (const GLshort *v);
+    void (*TexCoord3dv) (const GLdouble *v);
+    void (*TexCoord3fv) (const GLfloat *v);
+    void (*TexCoord3iv) (const GLint *v);
+    void (*TexCoord3sv) (const GLshort *v);
+    void (*TexCoord4dv) (const GLdouble *v);
+    void (*TexCoord4fv) (const GLfloat *v);
+    void (*TexCoord4iv) (const GLint *v);
+    void (*TexCoord4sv) (const GLshort *v);
+    void (*Vertex2dv) (const GLdouble *v);
+    void (*Vertex2fv) (const GLfloat *v);
+    void (*Vertex2iv) (const GLint *v);
+    void (*Vertex2sv) (const GLshort *v);
+    void (*Vertex3dv) (const GLdouble *v);
+    void (*Vertex3fv) (const GLfloat *v);
+    void (*Vertex3iv) (const GLint *v);
+    void (*Vertex3sv) (const GLshort *v);
+    void (*Vertex4dv) (const GLdouble *v);
+    void (*Vertex4fv) (const GLfloat *v);
+    void (*Vertex4iv) (const GLint *v);
+    void (*Vertex4sv) (const GLshort *v);
+    void (*ClipPlane) (GLenum plane, const GLdouble *equation);
+    void (*ColorMaterial) (GLenum face, GLenum mode);
+    void (*CullFace) (GLenum mode);
+    void (*Fogf) (GLenum pname, GLfloat param);
+    void (*Fogfv) (GLenum pname, const GLfloat *params);
+    void (*Fogi) (GLenum pname, GLint param);
+    void (*Fogiv) (GLenum pname, const GLint *params);
+    void (*FrontFace) (GLenum mode);
+    void (*Hint) (GLenum target, GLenum mode);
+    void (*Lightf) (GLenum light, GLenum pname, GLfloat param);
+    void (*Lightfv) (GLenum light, GLenum pname, const GLfloat *params);
+    void (*Lighti) (GLenum light, GLenum pname, GLint param);
+    void (*Lightiv) (GLenum light, GLenum pname, const GLint *params);
+    void (*LightModelf) (GLenum pname, GLfloat param);
+    void (*LightModelfv) (GLenum pname, const GLfloat *params);
+    void (*LightModeli) (GLenum pname, GLint param);
+    void (*LightModeliv) (GLenum pname, const GLint *params);
+    void (*LineStipple) (GLint factor, GLushort pattern);
+    void (*LineWidth) (GLfloat width);
+    void (*Materialf) (GLenum face, GLenum pname, GLfloat param);
+    void (*Materialfv) (GLenum face, GLenum pname, const GLfloat *params);
+    void (*Materiali) (GLenum face, GLenum pname, GLint param);
+    void (*Materialiv) (GLenum face, GLenum pname, const GLint *params);
+    void (*PointSize) (GLfloat size);
+    void (*PolygonMode) (GLenum face, GLenum mode);
+    void (*PolygonStipple) (const GLubyte *mask);
+    void (*Scissor) (GLint x, GLint y, GLsizei width, GLsizei height);
+    void (*ShadeModel) (GLenum mode);
+    void (*TexParameterf) (GLenum target, GLenum pname, GLfloat param);
+    void (*TexParameterfv) (GLenum target, GLenum pname,
+			    const GLfloat *params);
+    void (*TexParameteri) (GLenum target, GLenum pname, GLint param);
+    void (*TexParameteriv) (GLenum target, GLenum pname, const GLint *params);
+    void (*TexImage1D) (GLenum target, GLint level, GLint internalformat,
+			GLsizei width, GLint border, GLenum format,
+			GLenum type, const GLvoid *pixels);
+    void (*TexImage2D) (GLenum target, GLint level, GLint internalformat,
+			GLsizei width, GLsizei height, GLint border,
+			GLenum format, GLenum type, const GLvoid *pixels);
+    void (*TexEnvf) (GLenum target, GLenum pname, GLfloat param);
+    void (*TexEnvfv) (GLenum target, GLenum pname, const GLfloat *params);
+    void (*TexEnvi) (GLenum target, GLenum pname, GLint param);
+    void (*TexEnviv) (GLenum target, GLenum pname, const GLint *params);
+    void (*TexGend) (GLenum coord, GLenum pname, GLdouble param);
+    void (*TexGendv) (GLenum coord, GLenum pname, const GLdouble *params);
+    void (*TexGenf) (GLenum coord, GLenum pname, GLfloat param);
+    void (*TexGenfv) (GLenum coord, GLenum pname, const GLfloat *params);
+    void (*TexGeni) (GLenum coord, GLenum pname, GLint param);
+    void (*TexGeniv) (GLenum coord, GLenum pname, const GLint *params);
+    void (*FeedbackBuffer) (GLsizei size, GLenum type, GLfloat *buffer);
+    void (*SelectBuffer) (GLsizei size, GLuint *buffer);
+    GLint (*RenderMode) (GLenum mode);
+    void (*InitNames) (void);
+    void (*LoadName) (GLuint name);
+    void (*PassThrough) (GLfloat token);
+    void (*PopName) (void);
+    void (*PushName) (GLuint name);
+    void (*DrawBuffer) (GLenum mode);
+    void (*Clear) (GLbitfield mask);
+    void (*ClearAccum) (GLfloat red, GLfloat green, GLfloat blue,
+			GLfloat alpha);
+    void (*ClearIndex) (GLfloat c);
+    void (*ClearColor) (GLclampf red, GLclampf green, GLclampf blue,
+			GLclampf alpha);
+    void (*ClearStencil) (GLint s);
+    void (*ClearDepth) (GLclampd depth);
+    void (*StencilMask) (GLuint mask);
+    void (*ColorMask) (GLboolean red, GLboolean green, GLboolean blue,
+		       GLboolean alpha);
+    void (*DepthMask) (GLboolean flag);
+    void (*IndexMask) (GLuint mask);
+    void (*Accum) (GLenum op, GLfloat value);
+    void (*Disable) (GLenum cap);
+    void (*Enable) (GLenum cap);
+    void (*Finish) (void);
+    void (*Flush) (void);
+    void (*PopAttrib) (void);
+    void (*PushAttrib) (GLbitfield mask);
+    void (*Map1d) (GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+		   GLint order, const GLdouble *points);
+    void (*Map1f) (GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+		   GLint order, const GLfloat *points);
+    void (*Map2d) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride,
+		   GLint uorder, GLdouble v1, GLdouble v2, GLint vstride,
+		   GLint vorder, const GLdouble *points);
+    void (*Map2f) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
+		   GLint uorder, GLfloat v1, GLfloat v2, GLint vstride,
+		   GLint vorder, const GLfloat *points);
+    void (*MapGrid1d) (GLint un, GLdouble u1, GLdouble u2);
+    void (*MapGrid1f) (GLint un, GLfloat u1, GLfloat u2);
+    void (*MapGrid2d) (GLint un, GLdouble u1, GLdouble u2, GLint vn,
+		       GLdouble v1, GLdouble v2);
+    void (*MapGrid2f) (GLint un, GLfloat u1, GLfloat u2, GLint vn,
+		       GLfloat v1, GLfloat v2);
+    void (*EvalCoord1dv) (const GLdouble *u);
+    void (*EvalCoord1fv) (const GLfloat *u);
+    void (*EvalCoord2dv) (const GLdouble *u);
+    void (*EvalCoord2fv) (const GLfloat *u);
+    void (*EvalMesh1) (GLenum mode, GLint i1, GLint i2);
+    void (*EvalPoint1) (GLint i);
+    void (*EvalMesh2) (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+    void (*EvalPoint2) (GLint i, GLint j);
+    void (*AlphaFunc) (GLenum func, GLclampf ref);
+    void (*BlendFunc) (GLenum sfactor, GLenum dfactor);
+    void (*LogicOp) (GLenum opcode);
+    void (*StencilFunc) (GLenum func, GLint ref, GLuint mask);
+    void (*StencilOp) (GLenum fail, GLenum zfail, GLenum zpass);
+    void (*DepthFunc) (GLenum func);
+    void (*PixelZoom) (GLfloat xfactor, GLfloat yfactor);
+    void (*PixelTransferf) (GLenum pname, GLfloat param);
+    void (*PixelTransferi) (GLenum pname, GLint param);
+    void (*PixelStoref) (GLenum pname, GLfloat param);
+    void (*PixelStorei) (GLenum pname, GLint param);
+    void (*PixelMapfv) (GLenum map, GLsizei mapsize, const GLfloat *values);
+    void (*PixelMapuiv) (GLenum map, GLsizei mapsize, const GLuint *values);
+    void (*PixelMapusv) (GLenum map, GLsizei mapsize, const GLushort *values);
+    void (*ReadBuffer) (GLenum mode);
+    void (*CopyPixels) (GLint x, GLint y, GLsizei width, GLsizei height,
+			GLenum type);
+    void (*ReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height,
+			GLenum format, GLenum type, GLvoid *pixels);
+    void (*DrawPixels) (GLsizei width, GLsizei height, GLenum format,
+			GLenum type, const GLvoid *pixels);
+    void (*GetBooleanv) (GLenum pname, GLboolean *params);
+    void (*GetClipPlane) (GLenum plane, GLdouble *equation);
+    void (*GetDoublev) (GLenum pname, GLdouble *params);
+    GLenum (*GetError) (void);
+    void (*GetFloatv) (GLenum pname, GLfloat *params);
+    void (*GetIntegerv) (GLenum pname, GLint *params);
+    void (*GetLightfv) (GLenum light, GLenum pname, GLfloat *params);
+    void (*GetLightiv) (GLenum light, GLenum pname, GLint *params);
+    void (*GetMapdv) (GLenum target, GLenum query, GLdouble *v);
+    void (*GetMapfv) (GLenum target, GLenum query, GLfloat *v);
+    void (*GetMapiv) (GLenum target, GLenum query, GLint *v);
+    void (*GetMaterialfv) (GLenum face, GLenum pname, GLfloat *params);
+    void (*GetMaterialiv) (GLenum face, GLenum pname, GLint *params);
+    void (*GetPixelMapfv) (GLenum map, GLfloat *values);
+    void (*GetPixelMapuiv) (GLenum map, GLuint *values);
+    void (*GetPixelMapusv) (GLenum map, GLushort *values);
+    void (*GetPolygonStipple) (GLubyte *mask);
+    const GLubyte *(*GetString) (GLenum name);
+    void (*GetTexEnvfv) (GLenum target, GLenum pname, GLfloat *params);
+    void (*GetTexEnviv) (GLenum target, GLenum pname, GLint *params);
+    void (*GetTexGendv) (GLenum coord, GLenum pname, GLdouble *params);
+    void (*GetTexGenfv) (GLenum coord, GLenum pname, GLfloat *params);
+    void (*GetTexGeniv) (GLenum coord, GLenum pname, GLint *params);
+    void (*GetTexImage) (GLenum target, GLint level, GLenum format,
+			 GLenum type, GLvoid *pixels);
+    void (*GetTexParameterfv) (GLenum target, GLenum pname, GLfloat *params);
+    void (*GetTexParameteriv) (GLenum target, GLenum pname, GLint *params);
+    void (*GetTexLevelParameterfv) (GLenum target, GLint level, GLenum pname,
+				    GLfloat *params);
+    void (*GetTexLevelParameteriv) (GLenum target, GLint level, GLenum pname,
+				    GLint *params);
+    GLboolean (*IsEnabled) (GLenum cap);
+    GLboolean (*IsList) (GLuint list);
+    void (*DepthRange) (GLclampd zNear, GLclampd zFar);
+    void (*Frustum) (GLdouble left, GLdouble right, GLdouble bottom,
+		     GLdouble top, GLdouble zNear, GLdouble zFar);
+    void (*LoadIdentity) (void);
+    void (*LoadMatrixf) (const GLfloat *m);
+    void (*LoadMatrixd) (const GLdouble *m);
+    void (*MatrixMode) (GLenum mode);
+    void (*MultMatrixf) (const GLfloat *m);
+    void (*MultMatrixd) (const GLdouble *m);
+    void (*Ortho) (GLdouble left, GLdouble right, GLdouble bottom,
+		   GLdouble top, GLdouble zNear, GLdouble zFar);
+    void (*PopMatrix) (void);
+    void (*PushMatrix) (void);
+    void (*Rotated) (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+    void (*Rotatef) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+    void (*Scaled) (GLdouble x, GLdouble y, GLdouble z);
+    void (*Scalef) (GLfloat x, GLfloat y, GLfloat z);
+    void (*Translated) (GLdouble x, GLdouble y, GLdouble z);
+    void (*Translatef) (GLfloat x, GLfloat y, GLfloat z);
+    void (*Viewport) (GLint x, GLint y, GLsizei width, GLsizei height);
+    void (*ArrayElement) (GLint i);
+    void (*BindTexture) (GLenum target, GLuint texture);
+    void (*ColorPointer) (GLint size, GLenum type, GLsizei stride,
+			  const GLvoid *pointer);
+    void (*DisableClientState) (GLenum array);
+    void (*DrawArrays) (GLenum mode, GLint first, GLsizei count);
+    void (*DrawElements) (GLenum mode, GLsizei count, GLenum type,
+			  const GLvoid *indices);
+    void (*EdgeFlagPointer) (GLsizei stride, const GLvoid *pointer);
+    void (*EnableClientState) (GLenum array);
+    void (*IndexPointer) (GLenum type, GLsizei stride, const GLvoid *pointer);
+    void (*Indexubv) (const GLubyte *c);
+    void (*InterleavedArrays) (GLenum format, GLsizei stride,
+			       const GLvoid *pointer);
+    void (*NormalPointer) (GLenum type, GLsizei stride, const GLvoid *pointer);
+    void (*PolygonOffset) (GLfloat factor, GLfloat units);
+    void (*TexCoordPointer) (GLint size, GLenum type, GLsizei stride,
+			     const GLvoid *pointer);
+    void (*VertexPointer) (GLint size, GLenum type, GLsizei stride,
+			   const GLvoid *pointer);
+    GLboolean (*AreTexturesResident) (GLsizei n, const GLuint *textures,
+				      GLboolean *residences);
+    void (*CopyTexImage1D) (GLenum target, GLint level, GLenum internalformat,
+			    GLint x, GLint y, GLsizei width, GLint border);
+    void (*CopyTexImage2D) (GLenum target, GLint level, GLenum internalformat,
+			    GLint x, GLint y, GLsizei width, GLsizei height,
+			    GLint border);
+    void (*CopyTexSubImage1D) (GLenum target, GLint level, GLint xoffset,
+			       GLint x, GLint y, GLsizei width);
+    void (*CopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset,
+			       GLint yoffset, GLint x, GLint y,
+			       GLsizei width, GLsizei height);
+    void (*DeleteTextures) (GLsizei n, const GLuint *textures);
+    void (*GenTextures) (GLsizei n, GLuint *textures);
+    void (*GetPointerv) (GLenum pname, GLvoid ** params);
+    GLboolean (*IsTexture) (GLuint texture);
+    void (*PrioritizeTextures) (GLsizei n, const GLuint *textures,
+				const GLclampf *priorities);
+    void (*TexSubImage1D) (GLenum target, GLint level, GLint xoffset,
+			   GLsizei width, GLenum format, GLenum type,
+			   const GLvoid *pixels);
+    void (*TexSubImage2D) (GLenum target, GLint level, GLint xoffset,
+			   GLint yoffset, GLsizei width, GLsizei height,
+			   GLenum format, GLenum type, const GLvoid *pixels);
+    void (*PopClientAttrib) (void);
+    void (*PushClientAttrib) (GLbitfield mask);
+    void (*BlendColor) (GLclampf red, GLclampf green, GLclampf blue,
+			GLclampf alpha);
+    void (*BlendEquation) (GLenum mode);
+    void (*ColorTable) (GLenum target, GLenum internalformat,
+			GLsizei width, GLenum format, GLenum type,
+			const GLvoid *table);
+    void (*ColorTableParameterfv) (GLenum target, GLenum pname,
+				   const GLfloat *params);
+    void (*ColorTableParameteriv) (GLenum target, GLenum pname,
+				   const GLint *params);
+    void (*CopyColorTable) (GLenum target, GLenum internalformat,
+			    GLint x, GLint y, GLsizei width);
+    void (*GetColorTable) (GLenum target, GLenum format, GLenum type,
+			   GLvoid *table);
+    void (*GetColorTableParameterfv) (GLenum target, GLenum pname,
+				      GLfloat *params);
+    void (*GetColorTableParameteriv) (GLenum target, GLenum pname,
+				      GLint *params);
+    void (*ColorSubTable) (GLenum target, GLsizei start, GLsizei count,
+			   GLenum format, GLenum type, const GLvoid *data);
+    void (*CopyColorSubTable) (GLenum target, GLsizei start, GLint x, GLint y,
+			       GLsizei width);
+    void (*ConvolutionFilter1D) (GLenum target, GLenum internalformat,
+				 GLsizei width, GLenum format, GLenum type,
+				 const GLvoid *image);
+    void (*ConvolutionFilter2D) (GLenum target, GLenum internalformat,
+				 GLsizei width, GLsizei height,
+				 GLenum format, GLenum type,
+				 const GLvoid *image);
+    void (*ConvolutionParameterf) (GLenum target, GLenum pname,
+				   GLfloat params);
+    void (*ConvolutionParameterfv) (GLenum target, GLenum pname,
+				    const GLfloat *params);
+    void (*ConvolutionParameteri) (GLenum target, GLenum pname, GLint params);
+    void (*ConvolutionParameteriv) (GLenum target, GLenum pname,
+				    const GLint *params);
+    void (*CopyConvolutionFilter1D) (GLenum target, GLenum internalformat,
+				     GLint x, GLint y, GLsizei width);
+    void (*CopyConvolutionFilter2D) (GLenum target, GLenum internalformat,
+				     GLint x, GLint y,
+				     GLsizei width, GLsizei height);
+    void (*GetConvolutionFilter) (GLenum target, GLenum format, GLenum type,
+				  GLvoid *image);
+    void (*GetConvolutionParameterfv) (GLenum target, GLenum pname,
+				       GLfloat *params);
+    void (*GetConvolutionParameteriv) (GLenum target, GLenum pname,
+				       GLint *params);
+    void (*GetSeparableFilter) (GLenum target, GLenum format, GLenum type,
+				GLvoid *row, GLvoid *column, GLvoid *span);
+    void (*SeparableFilter2D) (GLenum target, GLenum internalformat,
+			       GLsizei width, GLsizei height, GLenum format,
+			       GLenum type, const GLvoid *row,
+			       const GLvoid *column);
+    void (*GetHistogram) (GLenum target, GLboolean reset, GLenum format,
+			  GLenum type, GLvoid *values);
+    void (*GetHistogramParameterfv) (GLenum target, GLenum pname,
+				     GLfloat *params);
+    void (*GetHistogramParameteriv) (GLenum target, GLenum pname,
+				     GLint *params);
+    void (*GetMinmax) (GLenum target, GLboolean reset, GLenum format,
+		       GLenum type, GLvoid *values);
+    void (*GetMinmaxParameterfv) (GLenum target, GLenum pname,
+				  GLfloat *params);
+    void (*GetMinmaxParameteriv) (GLenum target, GLenum pname, GLint *params);
+    void (*Histogram) (GLenum target, GLsizei width, GLenum internalformat,
+		       GLboolean sink);
+    void (*Minmax) (GLenum target, GLenum internalformat, GLboolean sink);
+    void (*ResetHistogram) (GLenum target);
+    void (*ResetMinmax) (GLenum target);
+    void (*TexImage3D) (GLenum target, GLint level, GLint internalformat,
+			GLsizei width, GLsizei height, GLsizei depth,
+			GLint border, GLenum format, GLenum type,
+			const GLvoid *pixels);
+    void (*TexSubImage3D) (GLenum target, GLint level,
+			   GLint xoffset, GLint yoffset, GLint zoffset,
+			   GLsizei width, GLsizei height, GLsizei depth,
+			   GLenum format, GLenum type, const GLvoid *pixels);
+    void (*CopyTexSubImage3D) (GLenum target, GLint level,
+			       GLint xoffset, GLint yoffset, GLint zoffset,
+			       GLint x, GLint y,
+			       GLsizei width, GLsizei height);
+} __glProcTable;
+
+typedef struct _glProcTableEXT {
+    void (*ActiveTextureARB) (GLenum texture);
+    void (*ClientActiveTextureARB) (GLenum texture);
+    void (*MultiTexCoord1dvARB) (GLenum target, const GLdouble *v);
+    void (*MultiTexCoord1fvARB) (GLenum target, const GLfloat *v);
+    void (*MultiTexCoord1ivARB) (GLenum target, const GLint *v);
+    void (*MultiTexCoord1svARB) (GLenum target, const GLshort *v);
+    void (*MultiTexCoord2dvARB) (GLenum target, const GLdouble *v);
+    void (*MultiTexCoord2fvARB) (GLenum target, const GLfloat *v);
+    void (*MultiTexCoord2ivARB) (GLenum target, const GLint *v);
+    void (*MultiTexCoord2svARB) (GLenum target, const GLshort *v);
+    void (*MultiTexCoord3dvARB) (GLenum target, const GLdouble *v);
+    void (*MultiTexCoord3fvARB) (GLenum target, const GLfloat *v);
+    void (*MultiTexCoord3ivARB) (GLenum target, const GLint *v);
+    void (*MultiTexCoord3svARB) (GLenum target, const GLshort *v);
+    void (*MultiTexCoord4dvARB) (GLenum target, const GLdouble *v);
+    void (*MultiTexCoord4fvARB) (GLenum target, const GLfloat *v);
+    void (*MultiTexCoord4ivARB) (GLenum target, const GLint *v);
+    void (*MultiTexCoord4svARB) (GLenum target, const GLshort *v);
+    void (*SampleCoverageARB) (GLclampf value, GLboolean invert);
+    GLboolean (*AreTexturesResidentEXT) (GLsizei n, const GLuint *textures,
+					 GLboolean *residences);
+    void (*GenTexturesEXT) (GLsizei n, GLuint *textures);
+    GLboolean (*IsTextureEXT) (GLuint texture);
+    void (*SampleMaskSGIS) (GLclampf value, GLboolean invert);
+    void (*SamplePatternSGIS) (GLenum pattern);
+    void (*PointParameterfEXT) (GLenum pname, GLfloat param);
+    void (*PointParameterfvEXT) (GLenum pname, const GLfloat *params);
+    void (*WindowPos3fMESA) (GLfloat x, GLfloat y, GLfloat z);
+    void (*BlendFuncSeparateEXT) (GLenum sfactorRGB, GLenum dfactorRGB,
+				  GLenum sfactorAlpha, GLenum dfactorAlpha);
+    void (*FogCoordfvEXT) (const GLfloat *coord);
+    void (*FogCoorddvEXT) (const GLdouble *coord);
+    void (*FogCoordPointerEXT) (GLenum type, GLsizei stride,
+				const GLvoid *pointer);
+    void (*SecondaryColor3bvEXT) (const GLbyte *v);
+    void (*SecondaryColor3dvEXT) (const GLdouble *v);
+    void (*SecondaryColor3fvEXT) (const GLfloat *v);
+    void (*SecondaryColor3ivEXT) (const GLint *v);
+    void (*SecondaryColor3svEXT) (const GLshort *v);
+    void (*SecondaryColor3ubvEXT) (const GLubyte *v);
+    void (*SecondaryColor3uivEXT) (const GLuint *v);
+    void (*SecondaryColor3usvEXT) (const GLushort *v);
+    void (*SecondaryColorPointerEXT) (GLint size, GLenum type, GLsizei stride,
+				      const GLvoid *pointer);
+    void (*PointParameteriNV) (GLenum pname, GLint params);
+    void (*PointParameterivNV) (GLenum pname, const GLint *params);
+    void (*ActiveStencilFaceEXT) (GLenum face);
+    int (*BindTexImageMESA) (DrawablePtr pDrawable, int buffer);
+    int (*ReleaseTexImageMESA) (DrawablePtr pDrawable, int buffer);
+    int (*QueryDrawableMESA) (DrawablePtr pDrawable, int attribute,
+			      unsigned int *value);
+} __glProcTableEXT;
+
+extern __glProcTable     *__glRenderTable;
+extern __glProcTableEXT  *__glRenderTableEXT;
+
+#endif

Index: render2.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/render2.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- render2.c	19 Jan 2004 05:34:52 -0000	1.4
+++ render2.c	7 Jun 2005 15:25:02 -0000	1.5
@@ -55,7 +55,7 @@
     points = (GLfloat *)(pc + 16);
     k = __glEvalComputeK(target);
 
-    glMap1f(target, u1, u2, k, order, points);
+    (*__glRenderTable->Map1f)(target, u1, u2, k, order, points);
 }
 
 void __glXDisp_Map2f(GLbyte *pc)
@@ -77,7 +77,7 @@
     ustride = vorder * k;
     vstride = k;
 
-    glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+    (*__glRenderTable->Map2f)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
 }
 
 void __glXDisp_Map1d(GLbyte *pc)
@@ -112,7 +112,7 @@
 #else
     points = (GLdouble*) pc;
 #endif
-    glMap1d(target, u1, u2, k, order, points);
+    (*__glRenderTable->Map1d)(target, u1, u2, k, order, points);
 }
 
 void __glXDisp_Map2d(GLbyte *pc)
@@ -153,7 +153,7 @@
 #else
     points = (GLdouble*) pc;
 #endif
-    glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+    (*__glRenderTable->Map2d)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
 }
 
 void __glXDisp_CallLists(GLbyte *pc)
@@ -163,7 +163,7 @@
 
     type = *(GLenum *)(pc + 4);
     n = *(GLsizei *)(pc + 0);
-    glCallLists(n, type, pc + 8);
+    (*__glRenderTable->CallLists)(n, type, pc + 8);
 }
 
 void __glXDisp_DrawArrays(GLbyte *pc)
@@ -197,36 +197,36 @@
 
 	switch (component) {
 	  case GL_VERTEX_ARRAY:
-	    glEnableClientState(GL_VERTEX_ARRAY);
-	    glVertexPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_VERTEX_ARRAY);
+	    (*__glRenderTable->VertexPointer)(numVals, datatype, stride, pc);
 	    break;
 	  case GL_NORMAL_ARRAY:
-	    glEnableClientState(GL_NORMAL_ARRAY);
-	    glNormalPointer(datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_NORMAL_ARRAY);
+	    (*__glRenderTable->NormalPointer)(datatype, stride, pc);
 	    break;
 	  case GL_COLOR_ARRAY:
-	    glEnableClientState(GL_COLOR_ARRAY);
-	    glColorPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_COLOR_ARRAY);
+	    (*__glRenderTable->ColorPointer)(numVals, datatype, stride, pc);
 	    break;
 	  case GL_INDEX_ARRAY:
-	    glEnableClientState(GL_INDEX_ARRAY);
-	    glIndexPointer(datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_INDEX_ARRAY);
+	    (*__glRenderTable->IndexPointer)(datatype, stride, pc);
 	    break;
 	  case GL_TEXTURE_COORD_ARRAY:
-	    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-	    glTexCoordPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_TEXTURE_COORD_ARRAY);
+	    (*__glRenderTable->TexCoordPointer)(numVals, datatype, stride, pc);
 	    break;
 	  case GL_EDGE_FLAG_ARRAY:
-	    glEnableClientState(GL_EDGE_FLAG_ARRAY);
-	    glEdgeFlagPointer(stride, (const GLboolean *)pc);
+	    (*__glRenderTable->EnableClientState)(GL_EDGE_FLAG_ARRAY);
+	    (*__glRenderTable->EdgeFlagPointer)(stride, (const GLboolean *)pc);
 	    break;
 	  case GL_SECONDARY_COLOR_ARRAY:
-	    glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
-	    glSecondaryColorPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_SECONDARY_COLOR_ARRAY);
+	    (*__glRenderTableEXT->SecondaryColorPointerEXT)(numVals, datatype, stride, pc);
 	    break;
 	  case GL_FOG_COORD_ARRAY:
-	    glEnableClientState(GL_FOG_COORD_ARRAY);
-	    glFogCoordPointer(datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_FOG_COORD_ARRAY);
+	    (*__glRenderTableEXT->FogCoordPointerEXT)(datatype, stride, pc);
 	    break;
 	  default:
 	    break;
@@ -235,17 +235,17 @@
 	pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
     }
 
-    glDrawArrays(primType, 0, numVertexes);
+    (*__glRenderTable->DrawArrays)(primType, 0, numVertexes);
 
     /* turn off anything we might have turned on */
-    glDisableClientState(GL_VERTEX_ARRAY);
-    glDisableClientState(GL_NORMAL_ARRAY);
-    glDisableClientState(GL_COLOR_ARRAY);
-    glDisableClientState(GL_INDEX_ARRAY);
-    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-    glDisableClientState(GL_EDGE_FLAG_ARRAY);
-    glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
-    glDisableClientState(GL_FOG_COORD_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_VERTEX_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_NORMAL_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_COLOR_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_INDEX_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_TEXTURE_COORD_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_EDGE_FLAG_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_SECONDARY_COLOR_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_FOG_COORD_ARRAY);
 }
 
 void __glXDisp_DrawArraysEXT(GLbyte *pc)

Index: render2swap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/render2swap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- render2swap.c	27 Jan 2002 20:05:26 -0000	1.4
+++ render2swap.c	7 Jun 2005 15:25:02 -0000	1.5
@@ -71,7 +71,7 @@
     }
     __GLX_SWAP_FLOAT_ARRAY(points, compsize);
 
-    glMap1f(target, u1, u2, k, order, points);
+    (*__glRenderTable->Map1f)(target, u1, u2, k, order, points);
 }
 
 void __glXDispSwap_Map2f(GLbyte *pc)
@@ -112,7 +112,7 @@
     }
     __GLX_SWAP_FLOAT_ARRAY(points, compsize);
 
-    glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+    (*__glRenderTable->Map2f)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
 }
 
 void __glXDispSwap_Map1d(GLbyte *pc)
@@ -156,7 +156,7 @@
 #else
     points = (GLdouble*) pc;
 #endif
-    glMap1d(target, u1, u2, k, order, points);
+    (*__glRenderTable->Map1d)(target, u1, u2, k, order, points);
 }
 
 void __glXDispSwap_Map2d(GLbyte *pc)
@@ -208,7 +208,7 @@
 #else
     points = (GLdouble*) pc;
 #endif
-    glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+    (*__glRenderTable->Map2d)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
 }
 
 void __glXDispSwap_CallLists(GLbyte *pc)
@@ -243,7 +243,7 @@
 	break;
     }
 
-    glCallLists(n, type, pc+8);
+    (*__glRenderTable->CallLists)(n, type, pc+8);
 }
 
 static void swapArray(GLint numVals, GLenum datatype,
@@ -343,28 +343,28 @@
 
         switch (component) {
           case GL_VERTEX_ARRAY:
-	    glEnableClientState(GL_VERTEX_ARRAY);
-	    glVertexPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_VERTEX_ARRAY);
+	    (*__glRenderTable->VertexPointer)(numVals, datatype, stride, pc);
             break;
           case GL_NORMAL_ARRAY:
-	    glEnableClientState(GL_NORMAL_ARRAY);
-	    glNormalPointer(datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_NORMAL_ARRAY);
+	    (*__glRenderTable->NormalPointer)(datatype, stride, pc);
             break;
           case GL_COLOR_ARRAY:
-	    glEnableClientState(GL_COLOR_ARRAY);
-	    glColorPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_COLOR_ARRAY);
+	    (*__glRenderTable->ColorPointer)(numVals, datatype, stride, pc);
             break;
           case GL_INDEX_ARRAY:
-	    glEnableClientState(GL_INDEX_ARRAY);
-	    glIndexPointer(datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_INDEX_ARRAY);
+	    (*__glRenderTable->IndexPointer)(datatype, stride, pc);
             break;
           case GL_TEXTURE_COORD_ARRAY:
-	    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-	    glTexCoordPointer(numVals, datatype, stride, pc);
+	    (*__glRenderTable->EnableClientState)(GL_TEXTURE_COORD_ARRAY);
+	    (*__glRenderTable->TexCoordPointer)(numVals, datatype, stride, pc);
             break;
           case GL_EDGE_FLAG_ARRAY:
-	    glEnableClientState(GL_EDGE_FLAG_ARRAY);
-	    glEdgeFlagPointer(stride, (const GLboolean *)pc);
+	    (*__glRenderTable->EnableClientState)(GL_EDGE_FLAG_ARRAY);
+	    (*__glRenderTable->EdgeFlagPointer)(stride, (const GLboolean *)pc);
             break;
           default:
             break;
@@ -373,15 +373,15 @@
         pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
     }
 
-    glDrawArrays(primType, 0, numVertexes);
+    (*__glRenderTable->DrawArrays)(primType, 0, numVertexes);
 
     /* turn off anything we might have turned on */
-    glDisableClientState(GL_VERTEX_ARRAY);
-    glDisableClientState(GL_NORMAL_ARRAY);
-    glDisableClientState(GL_COLOR_ARRAY);
-    glDisableClientState(GL_INDEX_ARRAY);
-    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-    glDisableClientState(GL_EDGE_FLAG_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_VERTEX_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_NORMAL_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_COLOR_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_INDEX_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_TEXTURE_COORD_ARRAY);
+    (*__glRenderTable->DisableClientState)(GL_EDGE_FLAG_ARRAY);
 }
 
 void __glXDispSwap_DrawArraysEXT(GLbyte *pc)

Index: renderpix.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/renderpix.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- renderpix.c	9 Apr 2001 21:56:19 -0000	1.3
+++ renderpix.c	7 Jun 2005 15:25:02 -0000	1.4
@@ -44,26 +44,26 @@
 {
     __GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glPolygonStipple((GLubyte *)(hdr+1));
+    (*__glRenderTable->PolygonStipple)((GLubyte *)(hdr+1));
 }
 
 void __glXDisp_Bitmap(GLbyte *pc)
 {
     __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glBitmap((GLsizei) hdr->width,
+    (*__glRenderTable->Bitmap)((GLsizei) hdr->width,
 	     (GLsizei) hdr->height,
 	     (GLfloat) hdr->xorig,
 	     (GLfloat) hdr->yorig,
@@ -76,14 +76,14 @@
 {
     __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexImage1D(hdr->target,
+    (*__glRenderTable->TexImage1D)(hdr->target,
 		 (GLint) hdr->level,
 		 (GLint) hdr->components,
 		 (GLsizei) hdr->width,
@@ -97,14 +97,14 @@
 {
     __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexImage2D(hdr->target,
+    (*__glRenderTable->TexImage2D)(hdr->target,
 		 (GLint) hdr->level,
 		 (GLint) hdr->components,
 		 (GLsizei) hdr->width,
@@ -119,16 +119,16 @@
 {
     __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
+    (*__glRenderTable->TexImage3D)(hdr->target, hdr->level, hdr->internalformat, hdr->width,
 		 hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -137,14 +137,14 @@
 {
     __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glDrawPixels((GLsizei) hdr->width,
+    (*__glRenderTable->DrawPixels)((GLsizei) hdr->width,
 		 (GLsizei) hdr->height,
 		 hdr->format,
 		 hdr->type,
@@ -155,14 +155,14 @@
 {
     __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexSubImage1D(hdr->target,
+    (*__glRenderTable->TexSubImage1D)(hdr->target,
 		    (GLint) hdr->level,
 		    (GLint) hdr->xoffset,
 		    (GLsizei) hdr->width,
@@ -175,14 +175,14 @@
 {
     __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexSubImage2D(hdr->target,
+    (*__glRenderTable->TexSubImage2D)(hdr->target,
 		    (GLint) hdr->level,
 		    (GLint) hdr->xoffset,
 		    (GLint) hdr->yoffset,
@@ -198,16 +198,16 @@
     __GLXdispatchTexSubImage3DHeader *hdr =
 				(__GLXdispatchTexSubImage3DHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
+    (*__glRenderTable->TexSubImage3D)(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
 		       hdr->zoffset, hdr->width, hdr->height, hdr->depth,
 		       hdr->format, hdr->type, (GLvoid *)(hdr+1));
 }
@@ -217,14 +217,14 @@
    __GLXdispatchColorTableHeader *hdr =
 				(__GLXdispatchColorTableHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glColorTable(hdr->target, hdr->internalformat,
+    (*__glRenderTable->ColorTable)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -234,14 +234,14 @@
    __GLXdispatchColorSubTableHeader *hdr =
 				(__GLXdispatchColorSubTableHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
+    (*__glRenderTable->ColorSubTable)(hdr->target, hdr->start, hdr->count, hdr->format,
 		    hdr->type, (GLvoid *)(hdr+1));
 }
 
@@ -250,14 +250,14 @@
    __GLXdispatchConvolutionFilterHeader *hdr =
 				(__GLXdispatchConvolutionFilterHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glConvolutionFilter1D(hdr->target, hdr->internalformat,
+    (*__glRenderTable->ConvolutionFilter1D)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -267,14 +267,14 @@
    __GLXdispatchConvolutionFilterHeader *hdr =
 				 (__GLXdispatchConvolutionFilterHeader *) pc;
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glConvolutionFilter2D(hdr->target, hdr->internalformat,
+    (*__glRenderTable->ConvolutionFilter2D)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->height, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -287,12 +287,12 @@
 
     hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
 
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
     /* XXX check this usage - internal code called
     ** a version without the packing parameters
@@ -301,7 +301,7 @@
 			       hdr->rowLength, hdr->skipRows, hdr->alignment);
     image1len = __GLX_PAD(image1len);
 
-    glSeparableFilter2D(hdr->target, hdr->internalformat,
+    (*__glRenderTable->SeparableFilter2D)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->height, hdr->format, hdr->type,
 		 ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
 }

Index: renderpixswap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/renderpixswap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- renderpixswap.c	9 Apr 2001 21:56:19 -0000	1.3
+++ renderpixswap.c	7 Jun 2005 15:25:02 -0000	1.4
@@ -50,13 +50,13 @@
     __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
     __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
 
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glPolygonStipple((GLubyte *)(hdr+1));
+    (*__glRenderTable->PolygonStipple)((GLubyte *)(hdr+1));
 }
 
 void __glXDispSwap_Bitmap(GLbyte *pc)
@@ -76,13 +76,13 @@
     __GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
     __GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
 
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glBitmap((GLsizei) hdr->width,
+    (*__glRenderTable->Bitmap)((GLsizei) hdr->width,
 	     (GLsizei) hdr->height,
 	     (GLfloat) hdr->xorig,
 	     (GLfloat) hdr->yorig,
@@ -114,14 +114,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexImage1D(hdr->target,
+    (*__glRenderTable->TexImage1D)(hdr->target,
 		 (GLint) hdr->level,
 		 (GLint) hdr->components,
 		 (GLsizei) hdr->width,
@@ -154,14 +154,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexImage2D(hdr->target,
+    (*__glRenderTable->TexImage2D)(hdr->target,
 		 (GLint) hdr->level,
 		 (GLint) hdr->components,
 		 (GLsizei) hdr->width,
@@ -201,16 +201,16 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
+    (*__glRenderTable->TexImage3D)(hdr->target, hdr->level, hdr->internalformat, hdr->width,
 		 hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -234,14 +234,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glDrawPixels((GLsizei) hdr->width,
+    (*__glRenderTable->DrawPixels)((GLsizei) hdr->width,
 		 (GLsizei) hdr->height,
 		 hdr->format,
 		 hdr->type,
@@ -269,14 +269,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexSubImage1D(hdr->target,
+    (*__glRenderTable->TexSubImage1D)(hdr->target,
 		    (GLint) hdr->level,
 		    (GLint) hdr->xoffset,
 		    (GLsizei) hdr->width,
@@ -308,14 +308,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
 
-    glTexSubImage2D(hdr->target,
+    (*__glRenderTable->TexSubImage2D)(hdr->target,
 		    (GLint) hdr->level,
 		    (GLint) hdr->xoffset,
 		    (GLint) hdr->yoffset,
@@ -358,16 +358,16 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
+    (*__glRenderTable->TexSubImage3D)(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
 		       hdr->zoffset, hdr->width, hdr->height, hdr->depth,
 		       hdr->format, hdr->type, (GLvoid *)(hdr+1));
 }
@@ -393,14 +393,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glColorTable(hdr->target, hdr->internalformat,
+    (*__glRenderTable->ColorTable)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -426,14 +426,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
+    (*__glRenderTable->ColorSubTable)(hdr->target, hdr->start, hdr->count, hdr->format,
 		    hdr->type, (GLvoid *)(hdr+1));
 }
 
@@ -458,14 +458,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glConvolutionFilter2D(hdr->target, hdr->internalformat,
+    (*__glRenderTable->ConvolutionFilter2D)(hdr->target, hdr->internalformat,
 		 hdr->width, 1, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -492,14 +492,14 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
-    glConvolutionFilter2D(hdr->target, hdr->internalformat,
+    (*__glRenderTable->ConvolutionFilter2D)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->height, hdr->format, hdr->type,
 		 (GLvoid *)(hdr+1));
 }
@@ -529,12 +529,12 @@
     ** Just invert swapBytes flag; the GL will figure out if it needs to swap
     ** the pixel data.
     */
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, hdr->alignment);
 
     /* XXX check this usage - internal code called
     ** a version without the packing parameters
@@ -544,7 +544,7 @@
     image1len = __GLX_PAD(image1len);
 
 
-    glSeparableFilter2D(hdr->target, hdr->internalformat,
+    (*__glRenderTable->SeparableFilter2D)(hdr->target, hdr->internalformat,
 		 hdr->width, hdr->height, hdr->format, hdr->type,
 		 ((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
 }

Index: rensizetab.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/rensizetab.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rensizetab.c	19 Jan 2004 05:34:52 -0000	1.5
+++ rensizetab.c	7 Jun 2005 15:25:02 -0000	1.6
@@ -231,7 +231,7 @@
 	/* Translatef          */	{  16, 	0                         },
 	/* Viewport            */	{  20, 	0                         },
 	/* PolygonOffset       */	{  12, 	0                         },
-	/* no such opcode      */	{  0, 	0                         },
+	/* DrawArrays          */	{  16, 	__glXDrawArraysSize       },
 	/* Indexubv            */	{  8, 	0                         },
 	/* ColorSubTable       */       {  44,  __glXColorSubTableReqSize         },
 	/* CopyColorSubTable   */       {  24,  0                         },

Index: single2.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/single2.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- single2.c	22 Aug 2001 18:24:46 -0000	1.5
+++ single2.c	7 Jun 2005 15:25:02 -0000	1.6
@@ -67,7 +67,7 @@
 	}
 	cx->feedbackBufSize = size;
     }
-    glFeedbackBuffer(size, type, cx->feedbackBuf);
+    (*__glRenderTable->FeedbackBuffer)(size, type, cx->feedbackBuf);
     __GLX_NOTE_UNFLUSHED_CMDS(cx);
     return Success;
 }
@@ -95,7 +95,7 @@
 	}
 	cx->selectBufSize = size;
     }
-    glSelectBuffer(size, cx->selectBuf);
+    (*__glRenderTable->SelectBuffer)(size, cx->selectBuf);
     __GLX_NOTE_UNFLUSHED_CMDS(cx);
     return Success;
 }
@@ -117,10 +117,10 @@
 
     pc += __GLX_SINGLE_HDR_SIZE;
     newMode = *(GLenum*) pc;
-    retval = glRenderMode(newMode);
+    retval = (*__glRenderTable->RenderMode)(newMode);
 
     /* Check that render mode worked */
-    glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
+    (*__glRenderTable->GetIntegerv)(GL_RENDER_MODE, &newModeCheck);
     if (newModeCheck != newMode) {
 	/* Render mode change failed.  Bail */
 	newMode = newModeCheck;
@@ -208,7 +208,7 @@
 		return error;
 	}
 
-	glFlush();
+	(*__glRenderTable->Flush)();
 	__GLX_NOTE_FLUSHED_CMDS(cx);
 	return Success;
 }
@@ -223,9 +223,9 @@
     if (!cx) {
 	return error;
     }
-
+    
     /* Do a local glFinish */
-    glFinish();
+    (*__glRenderTable->Finish)();
     __GLX_NOTE_FLUSHED_CMDS(cx);
 
     /* Send empty reply packet to indicate finish is finished */
@@ -313,7 +313,7 @@
 
     pc += __GLX_SINGLE_HDR_SIZE;
     name = *(GLenum *)(pc + 0);
-    string = (const char *)glGetString(name);
+    string = (const char *)(*__glRenderTable->GetString)(name);
     client = cl->client;
 
     /*
@@ -359,7 +359,7 @@
     pc += __GLX_SINGLE_HDR_SIZE;
 
     __glXClearErrorOccured();
-    glGetClipPlane(*(GLenum   *)(pc + 0), answer);
+    (*__glRenderTable->GetClipPlane)(*(GLenum   *)(pc + 0), answer);
     if (__glXErrorOccured()) {
 	__GLX_BEGIN_REPLY(0);
 	__GLX_SEND_HEADER();

Index: single2swap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/single2swap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- single2swap.c	27 Jan 2002 20:05:26 -0000	1.4
+++ single2swap.c	7 Jun 2005 15:25:02 -0000	1.5
@@ -71,7 +71,7 @@
 	}
 	cx->feedbackBufSize = size;
     }
-    glFeedbackBuffer(size, type, cx->feedbackBuf);
+    (*__glRenderTable->FeedbackBuffer)(size, type, cx->feedbackBuf);
     __GLX_NOTE_UNFLUSHED_CMDS(cx);
     return Success;
 }
@@ -102,7 +102,7 @@
 	}
 	cx->selectBufSize = size;
     }
-    glSelectBuffer(size, cx->selectBuf);
+    (*__glRenderTable->SelectBuffer)(size, cx->selectBuf);
     __GLX_NOTE_UNFLUSHED_CMDS(cx);
     return Success;
 }
@@ -128,10 +128,10 @@
     pc += __GLX_SINGLE_HDR_SIZE;
     __GLX_SWAP_INT(pc);
     newMode = *(GLenum*) pc;
-    retval = glRenderMode(newMode);
+    retval = (*__glRenderTable->RenderMode)(newMode);
 
     /* Check that render mode worked */
-    glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
+    (*__glRenderTable->GetIntegerv)(GL_RENDER_MODE, &newModeCheck);
     if (newModeCheck != newMode) {
 	/* Render mode change failed.  Bail */
 	newMode = newModeCheck;
@@ -228,7 +228,7 @@
 		return error;
 	}
 
-	glFlush();
+	(*__glRenderTable->Flush)();
 	__GLX_NOTE_FLUSHED_CMDS(cx);
 	return Success;
 }
@@ -247,7 +247,7 @@
     }
 
     /* Do a local glFinish */
-    glFinish();
+    (*__glRenderTable->Finish)();
     __GLX_NOTE_FLUSHED_CMDS(cx);
 
     /* Send empty reply packet to indicate finish is finished */
@@ -280,7 +280,7 @@
     pc += __GLX_SINGLE_HDR_SIZE;
     __GLX_SWAP_INT(pc + 0);
     name = *(GLenum *)(pc + 0);
-    string = (const char *)glGetString(name);
+    string = (const char *)(*__glRenderTable->GetString)(name);
     client = cl->client;
 
     /*
@@ -334,7 +334,7 @@
     __GLX_SWAP_INT(pc + 0);
 
     __glXClearErrorOccured();
-    glGetClipPlane(*(GLenum   *)(pc + 0), answer);
+    (*__glRenderTable->GetClipPlane)(*(GLenum   *)(pc + 0), answer);
     if (__glXErrorOccured()) {
 	__GLX_BEGIN_REPLY(0);
 	__GLX_SWAP_REPLY_HEADER();

Index: singlepix.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/singlepix.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- singlepix.c	9 Apr 2001 21:56:19 -0000	1.3
+++ singlepix.c	7 Jun 2005 15:25:02 -0000	1.4
@@ -68,11 +68,11 @@
     compsize = __glReadPixels_size(format,type,width,height);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
-    glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_LSB_FIRST, lsbFirst);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glReadPixels(
+    (*__glRenderTable->ReadPixels)(
 		 *(GLint    *)(pc + 0),
 		 *(GLint    *)(pc + 4),
 		 *(GLsizei  *)(pc + 8),
@@ -116,10 +116,10 @@
     target = *(GLenum *)(pc + 0);
     swapBytes = *(GLboolean *)(pc + 16);
 
-    glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
-    glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
+    (*__glRenderTable->GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &width);
+    (*__glRenderTable->GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &height);
     if ( target == GL_TEXTURE_3D) {
-	glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
+	(*__glRenderTable->GetTexLevelParameteriv)(target, level, GL_TEXTURE_DEPTH, &depth);
     }
     /*
      * The three queries above might fail if we're in a state where queries
@@ -128,10 +128,10 @@
     compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetTexImage(
+    (*__glRenderTable->GetTexImage)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLint    *)(pc + 4),
 		  *(GLenum   *)(pc + 8),
@@ -170,11 +170,11 @@
     pc += __GLX_SINGLE_HDR_SIZE;
     lsbFirst = *(GLboolean *)(pc + 0);
 
-    glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_PACK_LSB_FIRST, lsbFirst);
     __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
 
     __glXClearErrorOccured();
-    glGetPolygonStipple(
+    (*__glRenderTable->GetPolygonStipple)(
 			(GLubyte  *) answer
 			);
 
@@ -214,8 +214,8 @@
     /* target must be SEPARABLE_2D, however I guess we can let the GL
        barf on this one.... */
 
-    glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
-    glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+    (*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_WIDTH, &width);
+    (*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_HEIGHT, &height);
     /*
      * The two queries above might fail if we're in a state where queries
      * are illegal, but then width and height would still be zero anyway.
@@ -228,10 +228,10 @@
     compsize = __GLX_PAD(compsize);
     compsize2 = __GLX_PAD(compsize2);
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
     __glXClearErrorOccured();
-    glGetSeparableFilter(
+    (*__glRenderTable->GetSeparableFilter)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLenum   *)(pc + 4),
 		  *(GLenum   *)(pc + 8),
@@ -276,11 +276,11 @@
     target = *(GLenum *)(pc + 0);
     swapBytes = *(GLboolean *)(pc + 12);
 
-    glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
+    (*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_WIDTH, &width);
     if (target == GL_CONVOLUTION_1D) {
         height = 1;
     } else {
-	glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+	(*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_HEIGHT, &height);
     }
     /*
      * The two queries above might fail if we're in a state where queries
@@ -289,10 +289,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetConvolutionFilter(
+    (*__glRenderTable->GetConvolutionFilter)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLenum   *)(pc + 4),
 		  *(GLenum   *)(pc + 8),
@@ -336,7 +336,7 @@
     swapBytes = *(GLboolean *)(pc + 12);
     reset = *(GLboolean *)(pc + 13);
 
-    glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
+    (*__glRenderTable->GetHistogramParameteriv)(target, GL_HISTOGRAM_WIDTH, &width);
     /*
      * The one query above might fail if we're in a state where queries
      * are illegal, but then width would still be zero anyway.
@@ -344,10 +344,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetHistogram( target, reset, format, type, answer);
+    (*__glRenderTable->GetHistogram)( target, reset, format, type, answer);
 
     if (__glXErrorOccured()) {
 	__GLX_BEGIN_REPLY(0);
@@ -387,10 +387,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetMinmax( target, reset, format, type, answer);
+    (*__glRenderTable->GetMinmax)( target, reset, format, type, answer);
 
     if (__glXErrorOccured()) {
 	__GLX_BEGIN_REPLY(0);
@@ -426,7 +426,7 @@
     type = *(GLenum *)(pc + 8);
     swapBytes = *(GLboolean *)(pc + 12);
 
-    glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
+    (*__glRenderTable->GetColorTableParameteriv)(target, GL_COLOR_TABLE_WIDTH, &width);
     /*
      * The one query above might fail if we're in a state where queries
      * are illegal, but then width would still be zero anyway.
@@ -434,10 +434,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetColorTable(
+    (*__glRenderTable->GetColorTable)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLenum   *)(pc + 4),
 		  *(GLenum   *)(pc + 8),

Index: singlepixswap.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/singlepixswap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- singlepixswap.c	27 Jan 2002 20:05:26 -0000	1.4
+++ singlepixswap.c	7 Jun 2005 15:25:02 -0000	1.5
@@ -77,11 +77,11 @@
     compsize = __glReadPixels_size(format,type,width,height);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
-    glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_LSB_FIRST, lsbFirst);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glReadPixels(
+    (*__glRenderTable->ReadPixels)(
 		 *(GLint    *)(pc + 0),
 		 *(GLint    *)(pc + 4),
 		 *(GLsizei  *)(pc + 8),
@@ -134,10 +134,10 @@
     target = *(GLenum *)(pc + 0);
     swapBytes = *(GLboolean *)(pc + 16);
 
-    glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
-    glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
+    (*__glRenderTable->GetTexLevelParameteriv)(target, level, GL_TEXTURE_WIDTH, &width);
+    (*__glRenderTable->GetTexLevelParameteriv)(target, level, GL_TEXTURE_HEIGHT, &height);
     if ( target == GL_TEXTURE_3D) {
-	glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
+	(*__glRenderTable->GetTexLevelParameteriv)(target, level, GL_TEXTURE_DEPTH, &depth);
     }
     /*
      * The three queries above might fail if we're in a state where queries
@@ -146,10 +146,10 @@
     compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetTexImage(
+    (*__glRenderTable->GetTexImage)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLint    *)(pc + 4),
 		  *(GLenum   *)(pc + 8),
@@ -194,11 +194,11 @@
     pc += __GLX_SINGLE_HDR_SIZE;
     lsbFirst = *(GLboolean *)(pc + 0);
 
-    glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
+    (*__glRenderTable->PixelStorei)(GL_PACK_LSB_FIRST, lsbFirst);
     __GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
 
     __glXClearErrorOccured();
-    glGetPolygonStipple(
+    (*__glRenderTable->GetPolygonStipple)(
 			(GLubyte  *) answer
 			);
     if (__glXErrorOccured()) {
@@ -244,8 +244,8 @@
     /* target must be SEPARABLE_2D, however I guess we can let the GL
        barf on this one.... */
 
-    glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
-    glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+    (*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_WIDTH, &width);
+    (*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_HEIGHT, &height);
     /*
      * The two queries above might fail if we're in a state where queries
      * are illegal, but then width and height would still be zero anyway.
@@ -258,10 +258,10 @@
     compsize = __GLX_PAD(compsize);
     compsize2 = __GLX_PAD(compsize2);
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1);
     __glXClearErrorOccured();
-    glGetSeparableFilter(
+    (*__glRenderTable->GetSeparableFilter)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLenum   *)(pc + 4),
 		  *(GLenum   *)(pc + 8),
@@ -313,11 +313,11 @@
     target = *(GLenum *)(pc + 0);
     swapBytes = *(GLboolean *)(pc + 12);
 
-    glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
+    (*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_WIDTH, &width);
     if (target == GL_CONVOLUTION_2D) {
         height = 1;
     } else {
-	glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
+	(*__glRenderTable->GetConvolutionParameteriv)(target, GL_CONVOLUTION_HEIGHT, &height);
     }
     /*
      * The two queries above might fail if we're in a state where queries
@@ -326,10 +326,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetConvolutionFilter(
+    (*__glRenderTable->GetConvolutionFilter)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLenum   *)(pc + 4),
 		  *(GLenum   *)(pc + 8),
@@ -380,7 +380,7 @@
     swapBytes = *(GLboolean *)(pc + 12);
     reset = *(GLboolean *)(pc + 13);
 
-    glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
+    (*__glRenderTable->GetHistogramParameteriv)(target, GL_HISTOGRAM_WIDTH, &width);
     /*
      * The one query above might fail if we're in a state where queries
      * are illegal, but then width would still be zero anyway.
@@ -388,10 +388,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetHistogram( target, reset, format, type, answer);
+    (*__glRenderTable->GetHistogram)( target, reset, format, type, answer);
 
     if (__glXErrorOccured()) {
 	__GLX_BEGIN_REPLY(0);
@@ -437,10 +437,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetMinmax( target, reset, format, type, answer);
+    (*__glRenderTable->GetMinmax)( target, reset, format, type, answer);
 
     if (__glXErrorOccured()) {
 	__GLX_BEGIN_REPLY(0);
@@ -481,7 +481,7 @@
     target = *(GLenum *)(pc + 0);
     swapBytes = *(GLboolean *)(pc + 12);
 
-    glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
+    (*__glRenderTable->GetColorTableParameteriv)(target, GL_COLOR_TABLE_WIDTH, &width);
     /*
      * The one query above might fail if we're in a state where queries
      * are illegal, but then width would still be zero anyway.
@@ -489,10 +489,10 @@
     compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
     if (compsize < 0) compsize = 0;
 
-    glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
+    (*__glRenderTable->PixelStorei)(GL_PACK_SWAP_BYTES, !swapBytes);
     __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
     __glXClearErrorOccured();
-    glGetColorTable(
+    (*__glRenderTable->GetColorTable)(
 		  *(GLenum   *)(pc + 0),
 		  *(GLenum   *)(pc + 4),
 		  *(GLenum   *)(pc + 8),

Index: singlesize.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/singlesize.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- singlesize.c	14 Jan 2004 00:11:21 -0000	1.8
+++ singlesize.c	7 Jun 2005 15:25:02 -0000	1.9
@@ -36,6 +36,7 @@
 
 #include <GL/gl.h>
 #include "singlesize.h"
+#include "glxserver.h"
 
 /*
 ** These routines compute the size of variable-size returned parameters.
@@ -275,7 +276,7 @@
 	switch (query) {
 	  case GL_COEFF:
 	    k = EvalComputeK(target);
-	    glGetMapiv(target, GL_ORDER, &order);
+	    (*__glRenderTable->GetMapiv)(target, GL_ORDER, &order);
 	    /*
 	    ** The query above might fail, but then order will be zero anyway.
 	    */
@@ -299,7 +300,7 @@
 	  case GL_COEFF:
 	    k = EvalComputeK(target);
 	    majorMinor[0] = majorMinor[1] = 0;
-	    glGetMapiv(target, GL_ORDER, majorMinor);
+	    (*__glRenderTable->GetMapiv)(target, GL_ORDER, majorMinor);
 	    /*
 	    ** The query above might fail, but then majorMinor will be zeroes
 	    */
@@ -395,7 +396,7 @@
       default:
 	return -1;
     }
-    glGetIntegerv(query, &size);
+    (*__glRenderTable->GetIntegerv)(query, &size);
     return size;
 }
 
@@ -904,7 +905,7 @@
       case GL_FOG_COORD_ARRAY_TYPE:
       case GL_FOG_COORD_ARRAY_STRIDE:
       case GL_FOG_COORD_ARRAY:
-      case GL_FOG_COORD_SOURCE:
+      case GL_FOG_COORD_SRC:
 
       /* GL_EXT_secondary_color / GL 1.4 */
       case GL_COLOR_SUM:
@@ -1086,7 +1087,7 @@
       case GL_COMPRESSED_TEXTURE_FORMATS: {
 	  GLint temp;
 	  
-	  glGetIntegerv( GL_NUM_COMPRESSED_TEXTURE_FORMATS, & temp );
+	  (*__glRenderTable->GetIntegerv)( GL_NUM_COMPRESSED_TEXTURE_FORMATS, & temp );
 	  return temp;
       }
 

Index: xfont.c
===================================================================
RCS file: /cvs/xserver/xserver/GL/glx/xfont.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xfont.c	9 Apr 2001 21:56:19 -0000	1.3
+++ xfont.c	7 Jun 2005 15:25:02 -0000	1.4
@@ -92,7 +92,7 @@
 	pglyph -= widthPadded;
 	p += widthPadded;
     }
-    glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
+    (*__glRenderTable->Bitmap)(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
 	     pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf);
 
     if (allocbuf) {
@@ -116,12 +116,12 @@
     int rv;				/* return value */
     int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
     
-    glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE);
-    glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
-    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-    glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
-    glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
-    glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SWAP_BYTES, FALSE);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ROW_LENGTH, 0);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_ROWS, 0);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_SKIP_PIXELS, 0);
+    (*__glRenderTable->PixelStorei)(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
     for (i=0; i < count; i++) {
 	chs[0] = (first + i) >> 8;	/* high byte is first byte */
 	chs[1] = first + i;
@@ -132,14 +132,14 @@
 	/*
 	** Define a display list containing just a glBitmap() call.
 	*/
-	glNewList(list_base + i, GL_COMPILE);
+	(*__glRenderTable->NewList)(list_base + i, GL_COMPILE);
 	if (nglyphs ) {
 	    rv = __glXMakeBitmapFromGlyph(pFont, pci);
 	    if (rv) {
 		return rv;
 	    }
 	}
-	glEndList();
+	(*__glRenderTable->EndList)();
     }
     return Success;
 }
@@ -162,7 +162,7 @@
 	return error;
     }
 
-    glGetIntegerv(GL_LIST_INDEX, (GLint*) &currentListIndex);
+    (*__glRenderTable->GetIntegerv)(GL_LIST_INDEX, (GLint*) &currentListIndex);
     if (currentListIndex != 0) {
 	/*
 	** A display list is currently being made.  It is an error