Commit 2e1868b5 authored by Eric Anholt's avatar Eric Anholt

DRI trunk-20040613 import

parent f45c46c6
......@@ -54,18 +54,18 @@ __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXQueryExtensionsString,
__glXQueryServerString,
__glXClientInfo,
__glXNoSuchSingleOpcode, /* glXGetFBConfigs */
__glXNoSuchSingleOpcode, /* glXCreatePixmap */
__glXNoSuchSingleOpcode, /* glXDestroyPixmap */
__glXNoSuchSingleOpcode, /* glXCreateNewContext */
__glXGetFBConfigs,
__glXCreatePixmap,
__glXDestroyGLXPixmap, /* glXDestroyPixmap */
__glXCreateNewContext,
__glXNoSuchSingleOpcode, /* glXQueryContext */
__glXMakeContextCurrent,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXCreateWindow */
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
......@@ -425,7 +425,7 @@ __GLXdispatchRenderProcPtr __glXRenderTable[] = {
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXDisp_SampleCoverageARB,
__glXDisp_WindowPos3fARB /* 230 */
};
......@@ -451,18 +451,18 @@ __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXSwapQueryExtensionsString,
__glXSwapQueryServerString,
__glXSwapClientInfo,
__glXNoSuchSingleOpcode, /* glXGetFBConfigs */
__glXNoSuchSingleOpcode, /* glXCreatePixmap */
__glXNoSuchSingleOpcode, /* glXDestroyPixmap */
__glXNoSuchSingleOpcode, /* glXCreateNewContext */
__glXSwapGetFBConfigs,
__glXSwapCreatePixmap,
__glXSwapDestroyGLXPixmap, /* glXDestroyPixmap */
__glXSwapCreateNewContext,
__glXNoSuchSingleOpcode, /* glXQueryContext */
__glXSwapMakeContextCurrent,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXCreateWindow */
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
......@@ -822,6 +822,6 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = {
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXDispSwap_SampleCoverageARB,
__glXDispSwap_WindowPos3fARB /* 230 */
};
......@@ -52,6 +52,9 @@ extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXClientInfo(__GLXclientState*, GLbyte*);
extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXCreatePixmap(__GLXclientState*, GLbyte*);
extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
......@@ -325,6 +328,7 @@ extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
extern void __glXDisp_SampleCoverageARB(GLbyte *);
extern void __glXDisp_WindowPos3fARB(GLbyte *);
extern int __glXSwapRender(__GLXclientState*, GLbyte*);
......@@ -348,6 +352,9 @@ extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXSwapCreatePixmap(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
......@@ -621,6 +628,7 @@ extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
extern void __glXDispSwap_SampleCoverageARB(GLbyte *);
extern void __glXDispSwap_WindowPos3fARB(GLbyte *);
#define __GLX_MIN_GLXCMD_OPCODE 1
......
......@@ -2104,22 +2104,22 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __
__glXDisp_CopyTexSubImage1D, /* 4121 */
__glXDisp_CopyTexSubImage2D, /* 4122 */
__glXDisp_CopyTexSubImage3D, /* 4123 */
__glXNoSuchRenderOpcode, /* 4124 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode, /* 4130 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXDisp_FogCoordfv, /* 4124 */
__glXDisp_FogCoorddv, /* 4125 */
__glXDisp_SecondaryColor3bv, /* 4126 */
__glXDisp_SecondaryColor3sv, /* 4127 */
__glXDisp_SecondaryColor3iv, /* 4128 */
__glXDisp_SecondaryColor3fv, /* 4129 */
__glXDisp_SecondaryColor3dv, /* 4130 */
__glXDisp_SecondaryColor3ubv, /* 4131 */
__glXDisp_SecondaryColor3usv, /* 4132 */
__glXDisp_SecondaryColor3uiv, /* 4133 */
__glXDisp_BlendFuncSeparate, /* 4134 */
__glXNoSuchRenderOpcode, /* 4135 */
__glXNoSuchRenderOpcode, /* 4136 */
__glXNoSuchRenderOpcode, /* 4137 */
__glXNoSuchRenderOpcode, /* 4138 */
__glXNoSuchRenderOpcode, /* 4139 */
__glXNoSuchRenderOpcode, /* 4140 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
......@@ -2201,6 +2201,8 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode, /* 4219 */
__glXDisp_ActiveStencilFaceEXT, /* 4220 */
__glXDisp_PointParameteri, /* 4221 */
__glXDisp_PointParameteriv, /* 4222 */
};
__GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
__glXDisp_AreTexturesResidentEXT, /* 11 */
......@@ -4282,22 +4284,22 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT
__glXDispSwap_CopyTexSubImage1D, /* 4121 */
__glXDispSwap_CopyTexSubImage2D, /* 4122 */
__glXDispSwap_CopyTexSubImage3D, /* 4123 */
__glXNoSuchRenderOpcode, /* 4124 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode, /* 4130 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
__glXDispSwap_FogCoordfv, /* 4124 */
__glXDispSwap_FogCoorddv, /* 4125 */
__glXDispSwap_SecondaryColor3bv, /* 4126 */
__glXDispSwap_SecondaryColor3sv, /* 4127 */
__glXDispSwap_SecondaryColor3iv, /* 4128 */
__glXDispSwap_SecondaryColor3fv, /* 4129 */
__glXDispSwap_SecondaryColor3dv, /* 4130 */
__glXDispSwap_SecondaryColor3ubv, /* 4131 */
__glXDispSwap_SecondaryColor3usv, /* 4132 */
__glXDispSwap_SecondaryColor3uiv, /* 4133 */
__glXDisp_BlendFuncSeparate, /* 4134 */
__glXNoSuchRenderOpcode, /* 4135 */
__glXNoSuchRenderOpcode, /* 4136 */
__glXNoSuchRenderOpcode, /* 4137 */
__glXNoSuchRenderOpcode, /* 4138 */
__glXNoSuchRenderOpcode, /* 4139 */
__glXNoSuchRenderOpcode, /* 4140 */
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode,
......@@ -4379,6 +4381,8 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT
__glXNoSuchRenderOpcode,
__glXNoSuchRenderOpcode, /* 4219 */
__glXDispSwap_ActiveStencilFaceEXT, /* 4220 */
__glXDispSwap_PointParameteri, /* 4221 */
__glXDispSwap_PointParameteriv, /* 4222 */
};
__GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = {
__glXDispSwap_AreTexturesResidentEXT, /* 11 */
......
......@@ -69,6 +69,37 @@ extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
extern void __glXDisp_PointParameterfARB(GLbyte*);
extern void __glXDisp_PointParameterfvARB(GLbyte*);
extern void __glXDisp_FogCoordfv(GLbyte *);
extern void __glXDisp_FogCoorddv(GLbyte *);
extern void __glXDispSwap_FogCoordfv(GLbyte *);
extern void __glXDispSwap_FogCoorddv(GLbyte *);
extern void __glXDisp_SecondaryColor3bv(GLbyte *);
extern void __glXDisp_SecondaryColor3sv(GLbyte *);
extern void __glXDisp_SecondaryColor3iv(GLbyte *);
extern void __glXDisp_SecondaryColor3ubv(GLbyte *);
extern void __glXDisp_SecondaryColor3usv(GLbyte *);
extern void __glXDisp_SecondaryColor3uiv(GLbyte *);
extern void __glXDisp_SecondaryColor3fv(GLbyte *);
extern void __glXDisp_SecondaryColor3dv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3bv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3sv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3iv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3ubv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3usv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3uiv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3fv(GLbyte *);
extern void __glXDispSwap_SecondaryColor3dv(GLbyte *);
extern void __glXDisp_BlendFuncSeparate(GLbyte *);
extern void __glXDispSwap_BlendFuncSeparate(GLbyte *);
extern void __glXDisp_PointParameteri(GLbyte *);
extern void __glXDisp_PointParameteriv(GLbyte *);
extern void __glXDispSwap_PointParameteri(GLbyte *);
extern void __glXDispSwap_PointParameteriv(GLbyte *);
extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*);
extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
......@@ -112,7 +143,7 @@ extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
#define __GLX_MIN_RENDER_OPCODE_EXT 2053
#define __GLX_MAX_RENDER_OPCODE_EXT 4220
#define __GLX_MAX_RENDER_OPCODE_EXT 4222
#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
#define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
......
......@@ -59,6 +59,155 @@ void __glXDisp_Begin(GLbyte *pc)
);
}
#define __GLX_SWAP_GLbyte(ptr)
#define __GLX_SWAP_GLshort(ptr) __GLX_SWAP_SHORT(ptr)
#define __GLX_SWAP_GLint(ptr) __GLX_SWAP_INT(ptr)
#define __GLX_SWAP_GLubyte(ptr)
#define __GLX_SWAP_GLushort(ptr) __GLX_SWAP_SHORT(ptr)
#define __GLX_SWAP_GLuint(ptr) __GLX_SWAP_INT(ptr)
#define __GLX_SWAP_GLdouble(ptr) __GLX_SWAP_DOUBLE(ptr)
#define __GLX_SWAP_GLfloat(ptr) __GLX_SWAP_FLOAT(ptr)
#define __GLX_SWAP_GLbyte_ARRAY(ptr,count) (void) swapEnd; (void) swapPC; (void) sw;
#define __GLX_SWAP_GLshort_ARRAY(ptr,count) __GLX_SWAP_SHORT_ARRAY(ptr,count)
#define __GLX_SWAP_GLint_ARRAY(ptr,count) __GLX_SWAP_INT_ARRAY(ptr,count)
#define __GLX_SWAP_GLenum_ARRAY(ptr,count) __GLX_SWAP_INT_ARRAY(ptr,count)
#define __GLX_SWAP_GLubyte_ARRAY(ptr,count) (void) swapEnd; (void) swapPC; (void) sw;
#define __GLX_SWAP_GLushort_ARRAY(ptr,count) __GLX_SWAP_SHORT_ARRAY(ptr,count)
#define __GLX_SWAP_GLuint_ARRAY(ptr,count) __GLX_SWAP_INT_ARRAY(ptr,count)
#define __GLX_SWAP_GLdouble_ARRAY(ptr,count) __GLX_SWAP_DOUBLE_ARRAY(ptr,count)
#define __GLX_SWAP_GLfloat_ARRAY(ptr,count) __GLX_SWAP_FLOAT_ARRAY(ptr,count)
#ifdef __GLX_ALIGN64
/* If type is not GLdouble, the compiler should optimize this away.
*/
# define GLX_DO_ALIGN_MAGIC(count, type) \
do { \
if ( (sizeof(type) == 8) && ((unsigned long)(pc) & 7)) \
{ \
__GLX_MEM_COPY(pc-4, pc, (count * sizeof( type ) )); \
pc -= 4; \
} \
} while( 0 )
#else
# define GLX_DO_ALIGN_MAGIC(count, type)
#endif
#define dispatch_template_1( name, type ) \
void __glXDisp_ ## name ( GLbyte * pc ) \
{ \
GLX_DO_ALIGN_MAGIC( 1, type ); \
gl ## name ( (type *) pc ); \
} \
void __glXDispSwap_ ## name ( GLbyte * pc ) \
{ \
__GLX_DECLARE_SWAP_VARIABLES; \
GLX_DO_ALIGN_MAGIC( 1, type ); \
__GLX_SWAP_ ## type ( pc ); \
gl ## name ( (type *) pc ); \
}
#define dispatch_template_3( name, type ) \
void __glXDisp_ ## name ( GLbyte * pc ) \
{ \
GLX_DO_ALIGN_MAGIC( 3, type ); \
gl ## name ( (type *) pc ); \
} \
void __glXDispSwap_ ## name ( GLbyte * pc ) \
{ \
__GLX_DECLARE_SWAP_VARIABLES; \
__GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
GLX_DO_ALIGN_MAGIC( 3, type ); \
__GLX_SWAP_ ## type ## _ARRAY(pc, 3); \
gl ## name ( (type *) pc ); \
}
#define dispatch_template_4( name, type ) \
void __glXDisp_ ## name ( GLbyte * pc ) \
{ \
GLX_DO_ALIGN_MAGIC( 4, type ); \
gl ## name ( (type *) pc ); \
} \
void __glXDispSwap_ ## name ( GLbyte * pc ) \
{ \
__GLX_DECLARE_SWAP_VARIABLES; \
__GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
GLX_DO_ALIGN_MAGIC( 4, type ); \
__GLX_SWAP_ ## type ## _ARRAY(pc, 4); \
gl ## name ( (type *) pc ); \
}
#define dispatch_template_4s( name, type ) \
void __glXDisp_ ## name ( GLbyte * pc ) \
{ \
GLX_DO_ALIGN_MAGIC( 4, type ); \
gl ## name ( ((type *) pc)[0], ((type *) pc)[1], \
((type *) pc)[2], ((type *) pc)[3] ); \
} \
void __glXDispSwap_ ## name ( GLbyte * pc ) \
{ \
__GLX_DECLARE_SWAP_VARIABLES; \
__GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
GLX_DO_ALIGN_MAGIC( 4, type ); \
__GLX_SWAP_ ## type ## _ARRAY(pc, 4); \
gl ## name ( ((type *) pc)[0], ((type *) pc)[1], \
((type *) pc)[2], ((type *) pc)[3] ); \
}
/**
* \bug All of the enum1 templates need to be updated to handle the case where
* \c type is \c GLdouble. When the type is a double, the data comes before
* the enum. This is also the reason the invocation of the
* \c GLX_DO_ALIGN_MAGIC macro was removed.
*/
#define dispatch_template_enum1_1s( name, type ) \
void __glXDisp_ ## name ( GLbyte * pc ) \
{ \
gl ## name ( *(GLenum *) (pc + 0), \
*(type *) (pc + 4) ); \
} \
void __glXDispSwap_ ## name ( GLbyte * pc ) \
{ \
__GLX_DECLARE_SWAP_VARIABLES; \
__GLX_SWAP_INT (pc + 0); \
__GLX_SWAP_ ## type (pc + 4); \
gl ## name ( *(GLenum *) (pc + 0), \
*(type *) (pc + 4) ); \
}
#define dispatch_template_enum1_Vv( name, type ) \
void __glXDisp_ ## name ( GLbyte * pc ) \
{ \
gl ## name ( *(GLenum *) (pc + 0), \
(type *) (pc + 4) ); \
} \
void __glXDispSwap_ ## name ( GLbyte * pc ) \
{ \
GLenum pname; GLint compsize; \
__GLX_DECLARE_SWAP_VARIABLES; \
__GLX_DECLARE_SWAP_ARRAY_VARIABLES; \
__GLX_SWAP_INT(pc + 0); \
pname = *(GLenum *)(pc + 0); \
compsize = __gl ## name ## _size(pname); \
if (compsize < 0) compsize = 0; \
__GLX_SWAP_ ## type ## _ARRAY(pc + 4, compsize); \
gl ## name ( *(GLenum *) (pc + 0), \
(type *) (pc + 4) ); \
}
dispatch_template_1( FogCoordfv, GLfloat )
dispatch_template_1( FogCoorddv, GLdouble )
dispatch_template_3( SecondaryColor3bv, GLbyte )
dispatch_template_3( SecondaryColor3sv, GLshort )
dispatch_template_3( SecondaryColor3iv, GLint )
dispatch_template_3( SecondaryColor3ubv, GLubyte )
dispatch_template_3( SecondaryColor3usv, GLushort )
dispatch_template_3( SecondaryColor3uiv, GLuint )
dispatch_template_3( SecondaryColor3fv, GLfloat )
dispatch_template_3( SecondaryColor3dv, GLdouble )
dispatch_template_4s( BlendFuncSeparate, GLenum )
void __glXDisp_Color3bv(GLbyte *pc)
{
glColor3bv(
......@@ -2097,6 +2246,9 @@ void __glXDisp_PointParameterfvARB(GLbyte *pc)
);
}
dispatch_template_enum1_1s(PointParameteri, GLint)
dispatch_template_enum1_Vv(PointParameteriv, GLint)
void __glXDisp_ActiveStencilFaceEXT(GLbyte *pc)
{
glActiveStencilFaceEXT(
......@@ -2112,3 +2264,11 @@ void __glXDisp_WindowPos3fARB(GLbyte *pc)
*(GLfloat *)(pc + 8)
);
}
void __glXDisp_SampleCoverageARB(GLbyte *pc)
{
glSampleCoverageARB(
*(GLfloat *)(pc + 0),
*(GLboolean *)(pc + 4)
);
}
......@@ -3364,3 +3364,15 @@ void __glXDispSwap_WindowPos3fARB(GLbyte *pc)
*(GLfloat *)(pc + 8)
);
}
void __glXDispSwap_SampleCoverageARB(GLbyte *pc)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_FLOAT(pc + 0);
__GLX_SWAP_INT(pc + 4);
glSampleCoverageARB(
*(GLfloat *)(pc + 0),
*(GLboolean *)(pc + 4)
);
}
This diff is collapsed.
......@@ -47,6 +47,11 @@
#include "glxext.h"
#include "GL/glx_ansic.h"
static int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
/************************************************************************/
/*
......@@ -67,7 +72,41 @@ int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->shareList);
return __glXCreateContext(cl, pc);
return DoCreateContext( cl, req->context, req->shareList, req->visual,
req->screen, req->isDirect );
}
int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->renderType);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
req->screen, req->isDirect );
}
int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextWithConfigSGIXReq *req =
(xGLXCreateContextWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->renderType);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
req->screen, req->isDirect );
}
int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
......@@ -91,7 +130,8 @@ int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeCurrent(cl, pc);
return DoMakeCurrent( cl, req->drawable, req->drawable,
req->context, req->oldContextTag );
}
int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
......@@ -105,7 +145,8 @@ int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeContextCurrent(cl, pc);
return DoMakeCurrent( cl, req->drawable, req->readdrawable,
req->context, req->oldContextTag );
}
int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
......@@ -119,7 +160,8 @@ int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeCurrentReadSGI(cl, pc);
return DoMakeCurrent( cl, req->drawable, req->readable,
req->context, req->oldContextTag );
}
int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
......@@ -182,90 +224,29 @@ int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
xGLXGetVisualConfigsReply reply;
__GLXscreenInfo *pGlxScreen;
__GLXvisualConfig *pGlxVisual;
CARD32 buf[__GLX_TOTAL_CONFIG];
unsigned int screen;
int i, p;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(&req->screen);
screen = req->screen;
if (screen > screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
}
pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numUsableVisuals;
reply.numProps = __GLX_TOTAL_CONFIG;
reply.length = (pGlxScreen->numUsableVisuals * __GLX_SIZE_CARD32 *
__GLX_TOTAL_CONFIG) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.numVisuals);
__GLX_SWAP_INT(&reply.numProps);
WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
for (i=0; i < pGlxScreen->numVisuals; i++) {
pGlxVisual = &pGlxScreen->pGlxVisual[i];
if (pGlxVisual->vid == 0) {
/* not a usable visual */
continue;
}
p = 0;
buf[p++] = pGlxVisual->vid;
buf[p++] = pGlxVisual->class;
buf[p++] = pGlxVisual->rgba;
buf[p++] = pGlxVisual->redSize;
buf[p++] = pGlxVisual->greenSize;
buf[p++] = pGlxVisual->blueSize;
buf[p++] = pGlxVisual->alphaSize;
buf[p++] = pGlxVisual->accumRedSize;
buf[p++] = pGlxVisual->accumGreenSize;
buf[p++] = pGlxVisual->accumBlueSize;
buf[p++] = pGlxVisual->accumAlphaSize;
buf[p++] = pGlxVisual->doubleBuffer;
buf[p++] = pGlxVisual->stereo;
buf[p++] = pGlxVisual->bufferSize;
buf[p++] = pGlxVisual->depthSize;
buf[p++] = pGlxVisual->stencilSize;
buf[p++] = pGlxVisual->auxBuffers;
buf[p++] = pGlxVisual->level;
/*
** Add token/value pairs for extensions.
*/
buf[p++] = GLX_VISUAL_CAVEAT_EXT;
buf[p++] = pGlxVisual->visualRating;
buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
buf[p++] = pGlxVisual->transparentPixel;
buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
buf[p++] = pGlxVisual->transparentRed;
buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
buf[p++] = pGlxVisual->transparentGreen;
buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
buf[p++] = pGlxVisual->transparentBlue;
buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
buf[p++] = pGlxVisual->transparentAlpha;
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
buf[p++] = pGlxVisual->transparentIndex;
__GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
(char *)buf);
}
return Success;
return DoGetVisualConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
......@@ -279,7 +260,39 @@ int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return __glXCreateGLXPixmap(cl, pc);
return DoCreateGLXPixmap( cl, req->visual, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
......@@ -357,7 +370,7 @@ int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
return __glXClientInfo(cl, pc);
}