From 4ee0a53de870192d57c02baffa106b10bae6e0bf Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Mon, 23 Feb 2004 20:35:22 +0000 Subject: Import most of XFree86 4.4RC3. This import excludes files which have the new license. If we want to, later we can import 4.4RC3 again and pick up the files that have the new license, but for now the vendor branch is "pure." --- GL/glx/g_disptab.c | 14 ++- GL/glx/g_disptab.h | 4 +- GL/glx/g_disptab_EXT.c | 130 ++++++++++++++++++------- GL/glx/g_disptab_EXT.h | 42 +++++++- GL/glx/g_render.c | 174 ++++++++++++++++++++++++++++++++- GL/glx/g_renderswap.c | 18 +++- GL/glx/glxcmds.c | 14 ++- GL/glx/glxcmdsswap.c | 17 +++- GL/glx/glxext.c | 5 +- GL/glx/glxext.h | 5 +- GL/glx/glxscreens.c | 11 ++- GL/glx/glxserver.h | 3 +- GL/glx/impsize.h | 5 +- GL/glx/render2.c | 17 +++- GL/glx/render2swap.c | 5 +- GL/glx/rensize.c | 10 +- GL/glx/rensizetab.c | 30 +++--- GL/glx/single2.c | 38 +++++++- GL/glx/single2swap.c | 55 +---------- GL/glx/singlesize.c | 257 ++++++++++++++++++++++++++++++++++++++++++++----- 20 files changed, 704 insertions(+), 150 deletions(-) (limited to 'GL') diff --git a/GL/glx/g_disptab.c b/GL/glx/g_disptab.c index da05fe290..47988a595 100644 --- a/GL/glx/g_disptab.c +++ b/GL/glx/g_disptab.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.c,v 1.4 2003/09/28 20:15:41 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.c,v 1.6 2004/02/12 02:25:00 torrey Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ /* ** License Applicability. Except to the extent portions of this file are @@ -425,8 +425,12 @@ __GLXdispatchRenderProcPtr __glXRenderTable[] = { __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, - __glXNoSuchRenderOpcode, + __glXDisp_SampleCoverageARB, +#ifndef MISSING_GL_EXTS __glXDisp_WindowPos3fARB /* 230 */ +#else + __glXNoSuchRenderOpcode +#endif }; __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = { @@ -822,6 +826,10 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = { __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, - __glXNoSuchRenderOpcode, + __glXDispSwap_SampleCoverageARB, +#ifndef MISSING_GL_EXTS __glXDispSwap_WindowPos3fARB /* 230 */ +#else + __glXNoSuchRenderOpcode +#endif }; diff --git a/GL/glx/g_disptab.h b/GL/glx/g_disptab.h index ceeab5482..e311d98c3 100644 --- a/GL/glx/g_disptab.h +++ b/GL/glx/g_disptab.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.h,v 1.4 2003/09/28 20:15:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.h,v 1.5 2004/01/28 18:11:50 alanh Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ #ifndef _GLX_g_disptab_h_ #define _GLX_g_disptab_h_ @@ -325,6 +325,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*); @@ -621,6 +622,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 diff --git a/GL/glx/g_disptab_EXT.c b/GL/glx/g_disptab_EXT.c index 2d8caec92..472a2d443 100644 --- a/GL/glx/g_disptab_EXT.c +++ b/GL/glx/g_disptab_EXT.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.c,v 1.4 2003/09/28 20:15:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.c,v 1.6 2004/02/12 02:25:00 torrey Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ /* ** License Applicability. Except to the extent portions of this file are @@ -45,8 +45,13 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __ __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, +#ifndef MISSING_GL_EXTS __glXDisp_PointParameterfARB, /* 2065 */ __glXDisp_PointParameterfvARB, /* 2066 */ +#else + __glXNoSuchRenderOpcode, + __glXNoSuchRenderOpcode, +#endif __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, @@ -2104,22 +2109,36 @@ __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, +#ifndef MISSING_GL_EXTS + __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 */ +#else + __glXNoSuchRenderOpcode, /* 4124 */ + __glXNoSuchRenderOpcode, /* 4125 */ + __glXNoSuchRenderOpcode, /* 4126 */ + __glXNoSuchRenderOpcode, /* 4127 */ + __glXNoSuchRenderOpcode, /* 4128 */ + __glXNoSuchRenderOpcode, /* 4129 */ + __glXNoSuchRenderOpcode, /* 4130 */ + __glXNoSuchRenderOpcode, /* 4131 */ + __glXNoSuchRenderOpcode, /* 4132 */ + __glXNoSuchRenderOpcode, /* 4133 */ + __glXNoSuchRenderOpcode, /* 4134 */ +#endif + __glXNoSuchRenderOpcode, /* 4135 */ + __glXNoSuchRenderOpcode, /* 4136 */ + __glXNoSuchRenderOpcode, /* 4137 */ + __glXNoSuchRenderOpcode, /* 4138 */ + __glXNoSuchRenderOpcode, /* 4139 */ __glXNoSuchRenderOpcode, /* 4140 */ __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, @@ -2200,7 +2219,20 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __ __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, /* 4219 */ +#ifndef MISSING_GL_EXTS __glXDisp_ActiveStencilFaceEXT, /* 4220 */ +# ifndef __DARWIN__ + __glXDisp_PointParameteri, /* 4221 */ + __glXDisp_PointParameteriv, /* 4222 */ +# else + __glXDisp_PointParameteriNV, /* 4221 */ + __glXDisp_PointParameterivNV, /* 4222 */ +# endif +#else + __glXNoSuchRenderOpcode, + __glXNoSuchRenderOpcode, + __glXNoSuchRenderOpcode, +#endif }; __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = { __glXDisp_AreTexturesResidentEXT, /* 11 */ @@ -2223,8 +2255,13 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, +#ifndef MISSING_GL_EXTS __glXDispSwap_PointParameterfARB, /* 2065 */ __glXDispSwap_PointParameterfvARB, /* 2066 */ +#else + __glXNoSuchRenderOpcode, + __glXNoSuchRenderOpcode, +#endif __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, @@ -4282,22 +4319,36 @@ __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, +#ifndef MISSING_GL_EXTS + __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 */ +#else + __glXNoSuchRenderOpcode, /* 4124 */ + __glXNoSuchRenderOpcode, /* 4125 */ + __glXNoSuchRenderOpcode, /* 4126 */ + __glXNoSuchRenderOpcode, /* 4127 */ + __glXNoSuchRenderOpcode, /* 4128 */ + __glXNoSuchRenderOpcode, /* 4129 */ + __glXNoSuchRenderOpcode, /* 4130 */ + __glXNoSuchRenderOpcode, /* 4131 */ + __glXNoSuchRenderOpcode, /* 4132 */ + __glXNoSuchRenderOpcode, /* 4133 */ + __glXNoSuchRenderOpcode, /* 4134 */ +#endif + __glXNoSuchRenderOpcode, /* 4135 */ + __glXNoSuchRenderOpcode, /* 4136 */ + __glXNoSuchRenderOpcode, /* 4137 */ + __glXNoSuchRenderOpcode, /* 4138 */ + __glXNoSuchRenderOpcode, /* 4139 */ __glXNoSuchRenderOpcode, /* 4140 */ __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, @@ -4378,7 +4429,20 @@ __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, __glXNoSuchRenderOpcode, /* 4219 */ +#ifndef MISSING_GL_EXTS __glXDispSwap_ActiveStencilFaceEXT, /* 4220 */ +# ifndef __DARWIN__ + __glXDispSwap_PointParameteri, /* 4221 */ + __glXDispSwap_PointParameteriv, /* 4222 */ +# else + __glXDispSwap_PointParameteriNV, /* 4221 */ + __glXDispSwap_PointParameterivNV, /* 4222 */ +# endif +#else + __glXNoSuchRenderOpcode, + __glXNoSuchRenderOpcode, + __glXNoSuchRenderOpcode, +#endif }; __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1] = { __glXDispSwap_AreTexturesResidentEXT, /* 11 */ diff --git a/GL/glx/g_disptab_EXT.h b/GL/glx/g_disptab_EXT.h index d5b67745c..3aca9347f 100644 --- a/GL/glx/g_disptab_EXT.h +++ b/GL/glx/g_disptab_EXT.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.h,v 1.4 2003/09/28 20:15:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.h,v 1.6 2004/02/12 02:25:01 torrey Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ #ifndef _GLX_g_disptab_EXT_h_ #define _GLX_g_disptab_EXT_h_ @@ -69,6 +69,44 @@ 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 *); + +#ifdef __DARWIN__ +extern void __glXDisp_PointParameteriNV(GLbyte *); +extern void __glXDisp_PointParameterivNV(GLbyte *); +extern void __glXDispSwap_PointParameteriNV(GLbyte *); +extern void __glXDispSwap_PointParameterivNV(GLbyte *); +#else +extern void __glXDisp_PointParameteri(GLbyte *); +extern void __glXDisp_PointParameteriv(GLbyte *); +extern void __glXDispSwap_PointParameteri(GLbyte *); +extern void __glXDispSwap_PointParameteriv(GLbyte *); +#endif + extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*); extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*); @@ -112,7 +150,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) diff --git a/GL/glx/g_render.c b/GL/glx/g_render.c index 5e142138e..88834bf39 100644 --- a/GL/glx/g_render.c +++ b/GL/glx/g_render.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_render.c,v 1.6 2003/10/28 22:50:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/g_render.c,v 1.9 2004/02/12 02:25:01 torrey Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ /* ** License Applicability. Except to the extent portions of this file are @@ -59,6 +59,157 @@ 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) ); \ + } + +#ifndef MISSING_GL_EXTS +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 ) +#endif /* !MISSING_GL_EXTS */ + void __glXDisp_Color3bv(GLbyte *pc) { glColor3bv( @@ -2079,6 +2230,8 @@ void __glXDisp_MultiTexCoord4svARB(GLbyte *pc) * Extensions */ +#ifndef MISSING_GL_EXTS + void __glXDisp_PointParameterfARB(GLbyte *pc) { glPointParameterfARB( @@ -2096,6 +2249,15 @@ void __glXDisp_PointParameterfvARB(GLbyte *pc) ); } +#ifdef __DARWIN__ +#define __glPointParameterivNV_size __glPointParameteriv_size +dispatch_template_enum1_1s(PointParameteriNV, GLint) +dispatch_template_enum1_Vv(PointParameterivNV, GLint) +#else +dispatch_template_enum1_1s(PointParameteri, GLint) +dispatch_template_enum1_Vv(PointParameteriv, GLint) +#endif + void __glXDisp_ActiveStencilFaceEXT(GLbyte *pc) { glActiveStencilFaceEXT( @@ -2111,3 +2273,13 @@ void __glXDisp_WindowPos3fARB(GLbyte *pc) *(GLfloat *)(pc + 8) ); } + +#endif /* !MISSING_GL_EXTS */ + +void __glXDisp_SampleCoverageARB(GLbyte *pc) +{ + glSampleCoverageARB( + *(GLfloat *)(pc + 0), + *(GLboolean *)(pc + 4) + ); +} diff --git a/GL/glx/g_renderswap.c b/GL/glx/g_renderswap.c index a03db7599..ac4cb0b73 100644 --- a/GL/glx/g_renderswap.c +++ b/GL/glx/g_renderswap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_renderswap.c,v 1.7 2003/10/28 22:50:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/g_renderswap.c,v 1.9 2004/02/12 02:25:01 torrey Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -3313,6 +3313,8 @@ void __glXDispSwap_MultiTexCoord4svARB(GLbyte *pc) * Extensions */ +#ifndef MISSING_GL_EXTS + void __glXDispSwap_PointParameterfARB(GLbyte *pc) { __GLX_DECLARE_SWAP_VARIABLES; @@ -3366,3 +3368,17 @@ void __glXDispSwap_WindowPos3fARB(GLbyte *pc) *(GLfloat *)(pc + 8) ); } + +#endif /* !MISSING_GL_EXTS */ + +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) + ); +} diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 12e961ee6..57c064d19 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.11 2003/10/28 22:50:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.13 2004/02/12 02:25:01 torrey Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -1554,6 +1554,18 @@ int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc) req = (xGLXVendorPrivateReq *) pc; vendorcode = req->vendorCode; +#ifndef __DARWIN__ + switch( vendorcode ) { + case X_GLvop_SampleMaskSGIS: + glSampleMaskSGIS(*(GLfloat *)(pc + 4), + *(GLboolean *)(pc + 8)); + return Success; + case X_GLvop_SamplePatternSGIS: + glSamplePatternSGIS( *(GLenum *)(pc + 4)); + return Success; + } +#endif + if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) && (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) { (*__glXVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT]) diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c index 5237ecad0..0126b4699 100644 --- a/GL/glx/glxcmdsswap.c +++ b/GL/glx/glxcmdsswap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxcmdsswap.c,v 1.9 2003/10/28 22:50:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/glxcmdsswap.c,v 1.11 2004/02/12 02:25:01 torrey Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -791,6 +791,21 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc) vendorcode = req->vendorCode; +#ifndef __DARWIN__ + switch( vendorcode ) { + case X_GLvop_SampleMaskSGIS: + __GLX_SWAP_FLOAT(pc + 4); + __GLX_SWAP_INT(pc + 8); + glSampleMaskSGIS(*(GLfloat *)(pc + 4), + *(GLboolean *)(pc + 8)); + return Success; + case X_GLvop_SamplePatternSGIS: + __GLX_SWAP_INT(pc + 4); + glSamplePatternSGIS( *(GLenum *)(pc + 4)); + return Success; + } +#endif + if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) && (vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) { (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req); diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c index 716950953..ac08c3df9 100644 --- a/GL/glx/glxext.c +++ b/GL/glx/glxext.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $ +/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.10 2004/01/28 22:36:05 alanh Exp $ ** The contents of this file are subject to the GLX Public License Version 1.0 ** (the "License"). You may not use this file except in compliance with the ** License. You may obtain a copy of the License at Silicon Graphics, Inc., @@ -31,6 +31,9 @@ extern __GLXextensionInfo __glDDXExtensionInfo; +void GlxWrapInitVisuals(miInitVisualsProcPtr *); +void GlxSetVisualConfigs(int nconfigs, + __GLXvisualConfig *configs, void **privates); __GLXextensionInfo *__glXExt = &__glDDXExtensionInfo; diff --git a/GL/glx/glxext.h b/GL/glx/glxext.h index 4ec16d28d..fb0d21b85 100644 --- a/GL/glx/glxext.h +++ b/GL/glx/glxext.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.h,v 1.7 2003/11/17 22:20:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/glxext.h,v 1.8 2004/02/09 23:46:31 alanh Exp $ */ #ifndef _glxext_h_ #define _glxext_h_ @@ -80,6 +80,9 @@ extern void GlxExtensionInit(void); extern Bool __glXCoreType(void); +extern const char GLServerVersion[]; +extern int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap); + extern int GlxInitVisuals( VisualPtr * visualp, DepthPtr * depthp, diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c index c141d3cea..1a64b0e19 100644 --- a/GL/glx/glxscreens.c +++ b/GL/glx/glxscreens.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.12 2003/09/28 20:15:43 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.15 2004/02/12 02:25:01 torrey Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -46,11 +46,13 @@ #include "glxserver.h" #include "glxutil.h" +const char GLServerVersion[] = "1.2"; static const char GLServerExtensions[] = "GL_ARB_depth_texture " "GL_ARB_imaging " "GL_ARB_multitexture " "GL_ARB_point_parameters " + "GL_ARB_point_sprite " "GL_ARB_shadow " "GL_ARB_shadow_ambient " "GL_ARB_texture_border_clamp " @@ -108,6 +110,7 @@ static const char GLServerExtensions[] = "GL_MESA_pack_invert " "GL_MESA_ycbcr_texture " "GL_NV_blend_square " + "GL_NV_point_sprite " "GL_NV_texgen_reflection " "GL_NV_texture_rectangle " "GL_SGIS_generate_mipmap " @@ -125,11 +128,15 @@ static const char GLServerExtensions[] = */ static char GLXServerVendorName[] = "SGI"; static char GLXServerVersion[] = "1.2"; -static char GLXServerExtensions[] = +static char GLXServerExtensions[] = + "GLX_ARB_multisample " "GLX_EXT_visual_info " "GLX_EXT_visual_rating " "GLX_EXT_import_context " "GLX_SGI_make_current_read " +#ifndef __DARWIN__ + "GLX_SGIS_multisample " +#endif ; /* diff --git a/GL/glx/glxserver.h b/GL/glx/glxserver.h index a800f0d73..9446aefcc 100644 --- a/GL/glx/glxserver.h +++ b/GL/glx/glxserver.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.5 2003/09/28 20:15:43 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.6 2004/01/28 18:11:50 alanh Exp $ */ #ifndef _GLX_server_h_ #define _GLX_server_h_ @@ -280,5 +280,6 @@ extern int __glXColorTableParameterfvSize(GLenum pname); extern int __glXColorTableParameterivSize(GLenum pname); extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap); +extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap); #endif /* !__GLX_server_h__ */ diff --git a/GL/glx/impsize.h b/GL/glx/impsize.h index c923441c2..322ee18c8 100644 --- a/GL/glx/impsize.h +++ b/GL/glx/impsize.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/impsize.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/impsize.h,v 1.5 2004/01/28 18:11:50 alanh Exp $ */ #ifndef _impsize_h_ #define _impsize_h_ @@ -67,6 +67,7 @@ extern int __glTexParameterfv_size(GLenum e); extern int __glTexParameteriv_size(GLenum e); extern int __glEvalComputeK(GLenum target); -extern int __glPointParameterfvARB_size(GLenum pname); +extern int __glPointParameterfvARB_size(GLenum e); +extern int __glPointParameteriv_size(GLenum e); #endif /* _impsize_h_ */ diff --git a/GL/glx/render2.c b/GL/glx/render2.c index 7189f9710..56453ceff 100644 --- a/GL/glx/render2.c +++ b/GL/glx/render2.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.6 2003/10/28 22:50:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.9 2004/02/12 02:25:01 torrey Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -234,6 +234,16 @@ void __glXDisp_DrawArrays(GLbyte *pc) glEnableClientState(GL_EDGE_FLAG_ARRAY); glEdgeFlagPointer(stride, (const GLboolean *)pc); break; +#ifndef MISSING_GL_EXTS + case GL_SECONDARY_COLOR_ARRAY: + glEnableClientState(GL_SECONDARY_COLOR_ARRAY); + glSecondaryColorPointer(numVals, datatype, stride, pc); + break; + case GL_FOG_COORDINATE_ARRAY: + glEnableClientState(GL_FOG_COORDINATE_ARRAY); + glFogCoordPointer(datatype, stride, pc); + break; +#endif default: break; } @@ -250,10 +260,11 @@ void __glXDisp_DrawArrays(GLbyte *pc) glDisableClientState(GL_INDEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_EDGE_FLAG_ARRAY); + glDisableClientState(GL_SECONDARY_COLOR_ARRAY); + glDisableClientState(GL_FOG_COORDINATE_ARRAY); } void __glXDisp_DrawArraysEXT(GLbyte *pc) { -#ifdef XXX_STUB -#endif /*XXX_STUB*/ + __glXDisp_DrawArrays(pc); } diff --git a/GL/glx/render2swap.c b/GL/glx/render2swap.c index e873d88aa..b272c6ba9 100644 --- a/GL/glx/render2swap.c +++ b/GL/glx/render2swap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.7 2004/02/03 23:04:08 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -386,6 +386,5 @@ void __glXDispSwap_DrawArrays(GLbyte *pc) void __glXDispSwap_DrawArraysEXT(GLbyte *pc) { -#ifdef XXX_STUB -#endif /*XXX_STUB*/ + __glXDispSwap_DrawArrays(pc); } diff --git a/GL/glx/rensize.c b/GL/glx/rensize.c index 0a3e537f8..e73135db3 100644 --- a/GL/glx/rensize.c +++ b/GL/glx/rensize.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/rensize.c,v 1.6 2003/09/28 20:15:43 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/rensize.c,v 1.7 2004/01/28 18:11:53 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -551,12 +551,14 @@ int __glXDrawArraysSize( GLbyte *pc, Bool swap ) case GL_COLOR_ARRAY: case GL_TEXTURE_COORD_ARRAY: break; + case GL_SECONDARY_COLOR_ARRAY: case GL_NORMAL_ARRAY: if (numVals != 3) { /* bad size */ return -1; } break; + case GL_FOG_COORDINATE_ARRAY: case GL_INDEX_ARRAY: if (numVals != 1) { /* bad size */ @@ -918,3 +920,9 @@ int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap ) } return 4 * __glPointParameterfvARB_size( pname ); } + +int __glXPointParameterivReqSize(GLbyte *pc, Bool swap ) +{ + /* no difference between fv and iv versions */ + return __glXPointParameterfvARBReqSize(pc, swap); +} diff --git a/GL/glx/rensizetab.c b/GL/glx/rensizetab.c index c787366fa..04ffff6bc 100644 --- a/GL/glx/rensizetab.c +++ b/GL/glx/rensizetab.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/rensizetab.c,v 1.4 2003/09/28 20:15:43 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/rensizetab.c,v 1.6 2004/02/03 23:04:08 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -231,9 +231,9 @@ __GLXrenderSizeData __glXRenderSizeTable[__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN /* Translatef */ { 16, 0 }, /* Viewport */ { 20, 0 }, /* PolygonOffset */ { 12, 0 }, - /* no such opcode */ { 0, 0 }, + /* DrawArrays */ { 16, __glXDrawArraysSize }, /* Indexubv */ { 8, 0 }, - /* ColorSubTable */ { 44, __glXColorSubTableReqSize }, + /* ColorSubTable */ { 44, __glXColorSubTableReqSize }, /* CopyColorSubTable */ { 24, 0 }, /* ActiveTextureARB */ { 8, 0 }, /* MultiTexCoord1dvARB */ { 16, 0 }, @@ -2342,17 +2342,17 @@ __GLXrenderSizeData __glXRenderSizeTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX /* CopyTexSubImage1D */ { 28, 0 }, /* CopyTexSubImage2D */ { 36, 0 }, /* CopyTexSubImage3D 4123 */ { 40, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, - /* no such opcode */ { 0, 0 }, + /* FogCoordfv 4124 */ { 8, 0 }, + /* FogCoorddv 4125 */ { 12, 0 }, + /* SecondaryColor3bv 4126 */ { 8, 0 }, + /* SecondaryColor3sv 4127 */ { 12, 0 }, + /* SecondaryColor3iv 4128 */ { 16, 0 }, + /* SecondaryColor3fv 4129 */ { 16, 0 }, + /* SecondaryColor3dv 4130 */ { 28, 0 }, + /* SecondaryColor3ubv 4131 */ { 8, 0 }, + /* SecondaryColor3usv 4132 */ { 12, 0 }, + /* SecondaryColor3uiv 4133 */ { 16, 0 }, + /* BlendFuncSeparate 4134 */ { 20, 0 }, /* no such opcode */ { 0, 0 }, /* no such opcode */ { 0, 0 }, /* no such opcode */ { 0, 0 }, @@ -2439,4 +2439,6 @@ __GLXrenderSizeData __glXRenderSizeTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __GLX /* no such opcode */ { 0, 0 }, /* no such opcode */ { 0, 0 }, /* ActiveStencilFaceEXT 4220 */ { 8, 0 }, + /* PointParameteri 4221 */ { 12, 0 }, + /* PointParameteriv 4222 */ { 8, __glXPointParameterivReqSize }, }; diff --git a/GL/glx/single2.c b/GL/glx/single2.c index 286f63d70..3120ae171 100644 --- a/GL/glx/single2.c +++ b/GL/glx/single2.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/single2.c,v 1.6 2001/06/06 19:00:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/single2.c,v 1.9 2004/02/11 09:18:15 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -296,16 +296,25 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) return combo_string; } -int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc) +int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) { ClientPtr client; __GLXcontext *cx; GLenum name; const char *string; + __GLX_DECLARE_SWAP_VARIABLES; int error; char *buf = NULL, *buf1 = NULL; GLint length = 0; + /* If the client has the opposite byte order, swap the contextTag and + * the name. + */ + if ( need_swap ) { + __GLX_SWAP_INT(pc + 4); + __GLX_SWAP_INT(pc + __GLX_SINGLE_HDR_SIZE); + } + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -331,12 +340,32 @@ int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc) } string = buf; } + else if ( name == GL_VERSION ) { + if ( atof( string ) > atof( GLServerVersion ) ) { + buf = __glXMalloc( __glXStrlen( string ) + + __glXStrlen( GLServerVersion ) + + 3 ); + if ( buf == NULL ) { + string = GLServerVersion; + } + else { + __glXSprintf( buf, "%s (%s)", GLServerVersion, string ); + string = buf; + } + } + } if (string) { length = __glXStrlen((const char *) string) + 1; } __GLX_BEGIN_REPLY(length); __GLX_PUT_SIZE(length); + + if ( need_swap ) { + __GLX_SWAP_REPLY_SIZE(); + __GLX_SWAP_REPLY_HEADER(); + } + __GLX_SEND_HEADER(); WriteToClient(client, length, (char *) string); if (buf != NULL) { @@ -345,6 +374,11 @@ int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc) return Success; } +int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc) +{ + return DoGetString(cl, pc, GL_FALSE); +} + int __glXDisp_GetClipPlane(__GLXclientState *cl, GLbyte *pc) { __GLXcontext *cx; diff --git a/GL/glx/single2swap.c b/GL/glx/single2swap.c index 96db415f9..5b76b91e0 100644 --- a/GL/glx/single2swap.c +++ b/GL/glx/single2swap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/single2swap.c,v 1.7 2002/01/14 22:47:08 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/single2swap.c,v 1.8 2004/02/09 23:46:31 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -262,58 +262,7 @@ int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_GetString(__GLXclientState *cl, GLbyte *pc) { - ClientPtr client; - __GLXcontext *cx; - GLenum name; - const char *string; - __GLX_DECLARE_SWAP_VARIABLES; - int error; - char *buf = NULL, *buf1 = NULL; - GLint length = 0; - - __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; - } - - pc += __GLX_SINGLE_HDR_SIZE; - __GLX_SWAP_INT(pc + 0); - name = *(GLenum *)(pc + 0); - string = (const char *)glGetString(name); - client = cl->client; - - /* - ** Restrict extensions to those that are supported by both the - ** implementation and the connection. That is, return the - ** intersection of client, server, and core extension strings. - */ - if (name == GL_EXTENSIONS) { - buf1 = __glXcombine_strings(string, - cl->GLClientextensions); - buf = __glXcombine_strings(buf1, - cx->pGlxScreen->GLextensions); - if (buf1 != NULL) { - __glXFree(buf1); - } - string = buf; - } - if (string) { - length = __glXStrlen((const char *) string) + 1; - } - - __GLX_BEGIN_REPLY(length); - __GLX_PUT_SIZE(length); - - __GLX_SWAP_REPLY_SIZE(); - __GLX_SWAP_REPLY_HEADER(); - __GLX_SEND_HEADER(); - WriteToClient(client, length, (char *) string); - if (buf != NULL) { - __glXFree(buf); - } - - return Success; + return DoGetString(cl, pc, GL_TRUE); } int __glXDispSwap_GetClipPlane(__GLXclientState *cl, GLbyte *pc) diff --git a/GL/glx/singlesize.c b/GL/glx/singlesize.c index efb13ee94..3f3054871 100644 --- a/GL/glx/singlesize.c +++ b/GL/glx/singlesize.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.c,v 1.6 2003/11/06 18:37:56 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.c,v 1.8 2004/02/09 19:51:32 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -50,32 +50,48 @@ GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h) return __glXImage3DSize( format, type, w, h, 1, 0, 0, 0, 0, 4 ); } +/** + * Determine the number of data elements that go with the specified \c pname + * to a \c glGetTexEnvfv or \c glGetTexEnviv call. + * + * \todo + * Replace this function with a call to \c __glTexEnvfv_size. Make that there + * aren't any values of \c pname that are valid for one but not the other. + */ GLint __glGetTexEnvfv_size(GLenum pname) { switch (pname) { case GL_TEXTURE_ENV_MODE: + case GL_TEXTURE_LOD_BIAS: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + + /* GL_ARB_point_sprite / GL_NV_point_sprite */ + case GL_COORD_REPLACE_NV: + + /* GL_NV_texture_env_combine4 */ + case GL_SOURCE3_RGB_NV: + case GL_SOURCE3_ALPHA_NV: + case GL_OPERAND3_RGB_NV: + case GL_OPERAND3_ALPHA_NV: return 1; + case GL_TEXTURE_ENV_COLOR: return 4; - case GL_TEXTURE_LOD_BIAS_EXT: - return 1; - case GL_COMBINE_RGB_ARB: - case GL_COMBINE_ALPHA_ARB: - case GL_SOURCE0_RGB_ARB: - case GL_SOURCE1_RGB_ARB: - case GL_SOURCE2_RGB_ARB: - case GL_SOURCE0_ALPHA_ARB: - case GL_SOURCE1_ALPHA_ARB: - case GL_SOURCE2_ALPHA_ARB: - case GL_OPERAND0_RGB_ARB: - case GL_OPERAND1_RGB_ARB: - case GL_OPERAND2_RGB_ARB: - case GL_OPERAND0_ALPHA_ARB: - case GL_OPERAND1_ALPHA_ARB: - case GL_OPERAND2_ALPHA_ARB: - case GL_RGB_SCALE_ARB: - case GL_ALPHA_SCALE: - return 1; default: return -1; } @@ -140,6 +156,15 @@ GLint __glGetTexParameterfv_size(GLenum pname) case GL_TEXTURE_COMPARE_MODE: case GL_TEXTURE_COMPARE_FUNC: + /* GL_SGIS_generate_mipmap / GL 1.4 */ + case GL_GENERATE_MIPMAP: + + /* GL_ARB_depth_texture / GL 1.4 */ + case GL_DEPTH_TEXTURE_MODE: + + /* GL_EXT_texture_lod_bias / GL 1.4 */ + case GL_TEXTURE_LOD_BIAS: + /* GL_SGIX_shadow_ambient / GL_ARB_shadow_ambient */ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: @@ -151,6 +176,9 @@ GLint __glGetTexParameterfv_size(GLenum pname) case GL_TEXTURE_MAX_CLAMP_S_SGIX: case GL_TEXTURE_MAX_CLAMP_T_SGIX: case GL_TEXTURE_MAX_CLAMP_R_SGIX: + + /* GL_EXT_texture_filter_anisotropic */ + case GL_TEXTURE_MAX_ANISOTROPY_EXT: return 1; default: @@ -834,10 +862,6 @@ GLint __glGet_size(GLenum sq) case GL_MAX_CONVOLUTION_WIDTH: case GL_MAX_CONVOLUTION_HEIGHT: return 1; - case GL_TEXTURE_CUBE_MAP_ARB: - case GL_TEXTURE_BINDING_CUBE_MAP_ARB: - case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: - return 1; case GL_OCCLUSION_TEST_RESULT_HP: case GL_OCCLUSION_TEST_HP: return 1; @@ -847,6 +871,183 @@ GLint __glGet_size(GLenum sq) return 1; case GL_RASTER_POSITION_UNCLIPPED_IBM: return 1; + + /* GL_ARB_texture_cube_map / GL 1.3 */ + case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_BINDING_CUBE_MAP: + case GL_MAX_CUBE_MAP_TEXTURE_SIZE: + + /* GL_ARB_multisample / GL 1.3 */ + case GL_MULTISAMPLE: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_ALPHA_TO_ONE: + case GL_SAMPLE_COVERAGE: + case GL_SAMPLE_BUFFERS: + case GL_SAMPLES: + case GL_SAMPLE_COVERAGE_VALUE: + case GL_SAMPLE_COVERAGE_INVERT: + + /* GL_ARB_texture_comrpession / GL 1.3 */ + case GL_TEXTURE_COMPRESSION_HINT: + case GL_NUM_COMPRESSED_TEXTURE_FORMATS: + + /* GL_EXT_blend_func_separate / GL 1.4 */ + case GL_BLEND_DST_RGB: + case GL_BLEND_SRC_RGB: + case GL_BLEND_DST_ALPHA: + case GL_BLEND_SRC_ALPHA: + + /* GL_EXT_fog_coord / GL 1.4 */ + case GL_CURRENT_FOG_COORDINATE: + case GL_FOG_COORDINATE_ARRAY_TYPE: + case GL_FOG_COORDINATE_ARRAY_STRIDE: + case GL_FOG_COORDINATE_ARRAY: + case GL_FOG_COORDINATE_SOURCE: + + /* GL_EXT_secondary_color / GL 1.4 */ + case GL_COLOR_SUM: + case GL_SECONDARY_COLOR_ARRAY_SIZE: + case GL_SECONDARY_COLOR_ARRAY_TYPE: + case GL_SECONDARY_COLOR_ARRAY_STRIDE: + case GL_SECONDARY_COLOR_ARRAY: + + /* GL_EXT_texture_lod_bias / GL 1.4 */ + case GL_MAX_TEXTURE_LOD_BIAS: + + /* GL_ARB_point_sprite */ + case GL_POINT_SPRITE_NV: + + /* GL_ARB_vertex_blend */ + case GL_MAX_VERTEX_UNITS_ARB: + case GL_ACTIVE_VERTEX_UNITS_ARB: + case GL_WEIGHT_SUM_UNITY_ARB: + case GL_VERTEX_BLEND_ARB: + case GL_CURRENT_WEIGHT_ARB: + case GL_WEIGHT_ARRAY_ARB: + case GL_WEIGHT_ARRAY_TYPE_ARB: + case GL_WEIGHT_ARRAY_STRIDE_ARB: + case GL_WEIGHT_ARRAY_SIZE_ARB: + + /* GL_ARB_matrix_palette */ + case GL_MATRIX_PALETTE_ARB: + case GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB: + case GL_MAX_PALETTE_MATRICES_ARB: + case GL_CURRENT_PALETTE_MATRIX_ARB: + case GL_CURRENT_MATRIX_INDEX_ARB: + case GL_MATRIX_INDEX_ARRAY_ARB: + case GL_MATRIX_INDEX_ARRAY_SIZE_ARB: + case GL_MATRIX_INDEX_ARRAY_TYPE_ARB: + case GL_MATRIX_INDEX_ARRAY_STRIDE_ARB: + + /* GL_EXT_clip_volume_hint */ + case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: + + /* GL_EXT_stencil_two_size */ + case GL_STENCIL_TEST_TWO_SIDE_EXT: + case GL_ACTIVE_STENCIL_FACE_EXT: + + /* GL_EXT_vertex_weighting */ + case GL_VERTEX_WEIGHTING_EXT: + case GL_MODELVIEW0_EXT: + case GL_MODELVIEW1_EXT: + case GL_CURRENT_VERTEX_WEIGHT_EXT: + case GL_VERTEX_WEIGHT_ARRAY_EXT: + case GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT: + case GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT: + case GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT: + /* case GL_MODELVIEW0_STACK_DEPTH_EXT: */ /* alias */ + case GL_MODELVIEW1_STACK_DEPTH_EXT: + + /* GL_ATI_vertex_streams */ + case GL_MAX_VERTEX_STREAMS_ATI: + + /* GL_NV_depth_clamp */ + case GL_DEPTH_CLAMP_NV: + + /* GL_NV_fog_distance */ + case GL_FOG_DISTANCE_MODE_NV: + + /* GL_NV_light_max_exponent */ + case GL_MAX_SHININESS_NV: + case GL_MAX_SPOT_EXPONENT_NV: + + /* GL_NV_multisample_filter_hint */ + case GL_MULTISAMPLE_FILTER_HINT_NV: + + /* GL_NV_point_sprite */ + /* case GL_POINT_SPRITE_NV: */ /* alias */ + case GL_POINT_SPRITE_R_MODE_NV: + + /* GL_NV_register_combiners */ + case GL_REGISTER_COMBINERS_NV: + case GL_NUM_GENERAL_COMBINERS_NV: + case GL_COLOR_SUM_CLAMP_NV: + case GL_MAX_GENERAL_COMBINERS_NV: + + /* GL_NV_register_combiners2 */ + case GL_PER_STAGE_CONSTANTS_NV: + + /* GL_NV_texture_rectangle */ + case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_BINDING_RECTANGLE_NV: + case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: + return 1; + + /* GL_EXT_secondary_color / GL 1.4 */ + case GL_CURRENT_SECONDARY_COLOR: + + /* GL_NV_register_combiners */ + case GL_CONSTANT_COLOR0_NV: + case GL_CONSTANT_COLOR1_NV: + return 4; + + /* GL_ARB_vertex_blend */ + /* case GL_MODELVIEW0_ARB: */ /* alias */ + /* case GL_MODELVIEW1_ARB: */ /* alias */ + case GL_MODELVIEW2_ARB: + case GL_MODELVIEW3_ARB: + case GL_MODELVIEW4_ARB: + case GL_MODELVIEW5_ARB: + case GL_MODELVIEW6_ARB: + case GL_MODELVIEW7_ARB: + case GL_MODELVIEW8_ARB: + case GL_MODELVIEW9_ARB: + case GL_MODELVIEW10_ARB: + case GL_MODELVIEW11_ARB: + case GL_MODELVIEW12_ARB: + case GL_MODELVIEW13_ARB: + case GL_MODELVIEW14_ARB: + case GL_MODELVIEW15_ARB: + case GL_MODELVIEW16_ARB: + case GL_MODELVIEW17_ARB: + case GL_MODELVIEW18_ARB: + case GL_MODELVIEW19_ARB: + case GL_MODELVIEW20_ARB: + case GL_MODELVIEW21_ARB: + case GL_MODELVIEW22_ARB: + case GL_MODELVIEW23_ARB: + case GL_MODELVIEW24_ARB: + case GL_MODELVIEW25_ARB: + case GL_MODELVIEW26_ARB: + case GL_MODELVIEW27_ARB: + case GL_MODELVIEW28_ARB: + case GL_MODELVIEW29_ARB: + case GL_MODELVIEW30_ARB: + case GL_MODELVIEW31_ARB: + + /* GL_EXT_vertex_weighting */ + /* case GL_MODELVIEW0_MATRIX_EXT: */ /* alias */ + case GL_MODELVIEW1_MATRIX_EXT: + return 32; + + /* GL_ARB_texture_comrpession / GL 1.3 */ + case GL_COMPRESSED_TEXTURE_FORMATS: { + GLint temp; + + glGetIntegerv( GL_NUM_COMPRESSED_TEXTURE_FORMATS, & temp ); + return temp; + } + default: return -1; } @@ -886,7 +1087,15 @@ GLint __glGetTexLevelParameterfv_size(GLenum pname) case GL_TEXTURE_ALPHA_SIZE: case GL_TEXTURE_LUMINANCE_SIZE: case GL_TEXTURE_INTENSITY_SIZE: + + /* GL_ARB_texture_compression / GL 1.3 */ + case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: + case GL_TEXTURE_COMPRESSED: + + /* GL_ARB_depth_texture / GL 1.4 */ + case GL_TEXTURE_DEPTH_SIZE: return 1; + default: return -1; } -- cgit v1.2.3