Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonas Ådahl
xserver
Commits
2e1868b5
Commit
2e1868b5
authored
Jun 16, 2004
by
Eric Anholt
Browse files
DRI trunk-20040613 import
parent
f45c46c6
Changes
32
Hide whitespace changes
Inline
Side-by-side
GL/glx/g_disptab.c
View file @
2e1868b5
...
...
@@ -54,18 +54,18 @@ __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXQueryExtensionsString
,
__glXQueryServerString
,
__glXClientInfo
,
__
glXNoSuchSingleOpcode
,
/*
glXGetFBConfigs
*/
__
glXNoSuchSingleOpcode
,
/*
glXCreatePixmap
*/
__glX
NoSuchSingleOpcode
,
/* glXDestroyPixmap */
__
glXNoSuchSingleOpcode
,
/*
glXCreateNewContext
*/
__glXGetFBConfigs
,
__glXCreatePixmap
,
__glX
DestroyGLXPixmap
,
/* 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
,
__glX
NoSuchRenderOpcode
,
__glX
Disp_SampleCoverageARB
,
__glXDisp_WindowPos3fARB
/* 230 */
};
...
...
@@ -451,18 +451,18 @@ __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXSwapQueryExtensionsString
,
__glXSwapQueryServerString
,
__glXSwapClientInfo
,
__glX
NoSuchSingleOpcode
,
/* glX
GetFBConfigs
*/
__glX
NoSuchSingleOpcode
,
/* glX
CreatePixmap
*/
__glX
NoSuchSingleOpcode
,
/* glXDestroyPixmap */
__glX
NoSuchSingleOpcode
,
/* glX
CreateNewContext
*/
__glX
Swap
GetFBConfigs
,
__glX
Swap
CreatePixmap
,
__glX
SwapDestroyGLXPixmap
,
/* glXDestroyPixmap */
__glX
Swap
CreateNewContext
,
__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
,
__glX
NoSuchRenderOpcode
,
__glX
DispSwap_SampleCoverageARB
,
__glXDispSwap_WindowPos3fARB
/* 230 */
};
GL/glx/g_disptab.h
View file @
2e1868b5
...
...
@@ -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
...
...
GL/glx/g_disptab_EXT.c
View file @
2e1868b5
...
...
@@ -2104,22 +2104,22 @@ __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_MAX_RENDER_OPCODE_EXT - __
__glXDisp_CopyTexSubImage1D
,
/* 4121 */
__glXDisp_CopyTexSubImage2D
,
/* 4122 */
__glXDisp_CopyTexSubImage3D
,
/* 4123 */
__glX
NoSuchRenderOpcode
,
/* 4124 */
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
/* 4130 */
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glX
Disp_FogCoordfv
,
/* 4124 */
__glX
Disp_FogCoorddv
,
/* 4125 */
__glX
Disp_SecondaryColor3bv
,
/* 4126 */
__glX
Disp_SecondaryColor3sv
,
/* 4127 */
__glX
Disp_SecondaryColor3iv
,
/* 4128 */
__glX
Disp_SecondaryColor3fv
,
/* 4129 */
__glX
Disp_SecondaryColor3dv
,
/* 4130 */
__glX
Disp_SecondaryColor3ubv
,
/* 4131 */
__glX
Disp_SecondaryColor3usv
,
/* 4132 */
__glX
Disp_SecondaryColor3uiv
,
/* 4133 */
__glX
Disp_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 */
__glX
NoSuchRenderOpcode
,
/* 4124 */
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
/* 4130 */
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glX
NoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glXNoSuchRenderOpcode
,
__glX
DispSwap_FogCoordfv
,
/* 4124 */
__glX
DispSwap_FogCoorddv
,
/* 4125 */
__glX
DispSwap_SecondaryColor3bv
,
/* 4126 */
__glX
DispSwap_SecondaryColor3sv
,
/* 4127 */
__glX
DispSwap_SecondaryColor3iv
,
/* 4128 */
__glX
DispSwap_SecondaryColor3fv
,
/* 4129 */
__glX
DispSwap_SecondaryColor3dv
,
/* 4130 */
__glX
DispSwap_SecondaryColor3ubv
,
/* 4131 */
__glX
DispSwap_SecondaryColor3usv
,
/* 4132 */
__glX
DispSwap_SecondaryColor3uiv
,
/* 4133 */
__glX
Disp_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 */
...
...
GL/glx/g_disptab_EXT.h
View file @
2e1868b5
...
...
@@ -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 422
0
#define __GLX_MAX_RENDER_OPCODE_EXT 422
2
#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)
...
...
GL/glx/g_render.c
View file @
2e1868b5
...
...
@@ -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
)
);
}
GL/glx/g_renderswap.c
View file @
2e1868b5
...
...
@@ -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
)
);
}
GL/glx/glxcmds.c
View file @
2e1868b5
...
...
@@ -47,6 +47,7 @@
#include
"glxutil.h"
#include
"glxext.h"
#include
"GL/glx_ansic.h"
#include
"glcontextmodes.h"
/************************************************************************/
...
...
@@ -68,29 +69,32 @@ static __GLimports imports = {
NULL
};
static
int
DoMakeCurrent
(
__GLXclientState
*
cl
,
GLXDrawable
drawId
,
GLXDrawable
readId
,
GLXContextID
contextId
,
GLXContextTag
tag
);
static
int
__glXGetFBConfigsSGIX
(
__GLXclientState
*
cl
,
GLbyte
*
pc
);
static
int
__glXCreateContextWithConfigSGIX
(
__GLXclientState
*
cl
,
GLbyte
*
pc
);
static
int
__glXCreateGLXPixmapWithConfigSGIX
(
__GLXclientState
*
cl
,
GLbyte
*
pc
);
static
int
__glXMakeCurrentReadSGI
(
__GLXclientState
*
cl
,
GLbyte
*
pc
);
/************************************************************************/
/*
** Create a GL context with the given properties.
*/
int
__glXCreateContext
(
__GLXclientState
*
cl
,
GLbyte
*
pc
)
/**
* Create a GL context with the given properties. This routine is used
* to implement \c glXCreateContext, \c glXCreateNewContext, and
* \c glXCreateContextWithConfigSGIX. This works becuase of the hack way
* that GLXFBConfigs are implemented. Basically, the FBConfigID is the
* same as the VisualID.
*/
int
DoCreateContext
(
__GLXclientState
*
cl
,
GLXContextID
gcId
,
GLXContextID
shareList
,
VisualID
visual
,
GLuint
screen
,
GLboolean
isDirect
)
{
ClientPtr
client
=
cl
->
client
;
xGLXCreateContextReq
*
req
=
(
xGLXCreateContextReq
*
)
pc
;
VisualPtr
pVisual
;
ScreenPtr
pScreen
;
__GLXcontext
*
glxc
,
*
shareglxc
;
__GL
XvisualConfig
*
pGlxVisual
;
__GL
contextModes
*
modes
;
__GLXscreenInfo
*
pGlxScreen
;
__GLinterface
*
shareGC
;
GLXContextID
gcId
=
req
->
context
;
GLXContextID
shareList
=
req
->
shareList
;
VisualID
visual
=
req
->
visual
;
GLuint
screen
=
req
->
screen
;
GLboolean
isDirect
=
req
->
isDirect
;
GLint
i
;
/*
...
...
@@ -123,13 +127,9 @@ int __glXCreateContext(__GLXclientState *cl, GLbyte *pc)
** subset of Visuals that are supported by this implementation of the
** OpenGL.
*/
pGlxVisual
=
pGlxScreen
->
pGlxVisual
;
for
(
i
=
0
;
i
<
pGlxScreen
->
numVisuals
;
i
++
,
pGlxVisual
++
)
{
if
(
pGlxVisual
->
vid
==
visual
)
{
break
;
}
}
if
(
i
==
pGlxScreen
->
numVisuals
)
{
modes
=
_gl_context_modes_find_visual
(
pGlxScreen
->
modes
,
visual
);
if
(
modes
==
NULL
)
{
/*
** Visual not support on this screen by this OpenGL implementation.
*/
...
...
@@ -192,22 +192,15 @@ int __glXCreateContext(__GLXclientState *cl, GLbyte *pc)
glxc
->
pScreen
=
pScreen
;
glxc
->
pGlxScreen
=
pGlxScreen
;
glxc
->
pVisual
=
pVisual
;
glxc
->
pGlxVisual
=
pGlxVisual
;
glxc
->
modes
=
modes
;
if
(
!
isDirect
)
{
__GLcontextModes
*
modes
;
/*
** first build __GLcontextModes from __GLXvisualConfig
*/
modes
=
(
__GLcontextModes
*
)
__glXMalloc
(
sizeof
(
__GLcontextModes
));
glxc
->
modes
=
modes
;
__glXFormatGLModes
(
modes
,
pGlxVisual
);
/*
** Allocate a GL context
*/
imports
.
other
=
(
void
*
)
glxc
;
glxc
->
gc
=
(
*
pGlxScreen
->
createContext
)(
&
imports
,
modes
,
shareGC
);
glxc
->
gc
=
(
*
pGlxScreen
->
createContext
)(
&
imports
,
glxc
->
modes
,
shareGC
);
if
(
!
glxc
->
gc
)
{
__glXFree
(
glxc
);
client
->
errorValue
=
gcId
;
...
...
@@ -245,6 +238,31 @@ int __glXCreateContext(__GLXclientState *cl, GLbyte *pc)
return
Success
;
}
int
__glXCreateContext
(
__GLXclientState
*
cl
,
GLbyte
*
pc
)
{
xGLXCreateContextReq
*
req
=
(
xGLXCreateContextReq
*
)
pc
;
return
DoCreateContext
(
cl
,
req
->
context
,
req
->
shareList
,
req
->
visual
,
req
->
screen
,
req
->
isDirect
);
}
int
__glXCreateNewContext
(
__GLXclientState
*
cl
,
GLbyte
*
pc
)
{
xGLXCreateNewContextReq
*
req
=
(
xGLXCreateNewContextReq
*
)
pc
;
return
DoCreateContext
(
cl
,
req
->
context
,
req
->
shareList
,
req
->
fbconfig
,
req
->
screen
,
req
->
isDirect
);
}
int
__glXCreateContextWithConfigSGIX
(
__GLXclientState
*
cl
,
GLbyte
*
pc
)
{
xGLXCreateContextWithConfigSGIXReq
*
req
=
(
xGLXCreateContextWithConfigSGIXReq
*
)
pc
;
return
DoCreateContext
(
cl
,
req
->
context
,
req
->
shareList
,
req
->
fbconfig
,
req
->
screen
,
req
->
isDirect
);
}
/*
** Destroy a GL context as an X resource.
*/
...
...
@@ -370,24 +388,24 @@ int __glXMakeCurrent(__GLXclientState *cl, GLbyte *pc)
{
xGLXMakeCurrentReq
*
req
=
(
xGLXMakeCurrentReq
*
)
pc
;
return
DoMakeCurrent
(
cl
,
req
->
drawable
,
req
->
drawable
,
req
->
context
,
req
->
oldContextTag
);
return
DoMakeCurrent
(
cl
,
req
->
drawable
,
req
->
drawable
,
req
->
context
,
req
->
oldContextTag
);
}
int
__glXMakeContextCurrent
(
__GLXclientState
*
cl
,
GLbyte
*
pc
)
{
xGLXMakeContextCurrentReq
*
req
=
(
xGLXMakeContextCurrentReq
*
)
pc
;
return
DoMakeCurrent
(
cl
,
req
->
drawable
,
req
->
readdrawable
,
req
->
context
,
req
->
oldContextTag
);
return
DoMakeCurrent
(
cl
,
req
->
drawable
,
req
->
readdrawable
,
req
->
context
,
req
->
oldContextTag
);
}
int
__glXMakeCurrentReadSGI
(
__GLXclientState
*
cl
,
GLbyte
*
pc
)
{
xGLXMakeCurrentReadSGIReq
*
req
=
(
xGLXMakeCurrentReadSGIReq
*
)
pc
;
return
DoMakeCurrent
(
cl
,
req
->
drawable
,
req
->
readable
,
req
->
context
,
req
->
oldContextTag
);
return
DoMakeCurrent
(
cl
,
req
->
drawable
,
req
->
readable
,
req
->
context
,
req
->
oldContextTag
);
}
...
...
@@ -449,7 +467,7 @@ static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
** Check if pixmap and context are similar.
*/
if
(
drawPixmap
->
pScreen
!=
glxc
->
pScreen
||
drawPixmap
->
pGlxV
isual
!=
glxc
->
pGlxV
isual
)
{
drawPixmap
->
modes
->
v
isual
ID
!=
glxc
->
modes
->
v
isual
ID
)
{
client
->
errorValue
=
drawId
;
return
BadMatch
;
}
...
...
@@ -471,9 +489,9 @@ static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
}
static
int
DoMakeCurrent
(
__GLXclientState
*
cl
,
GLXDrawable
drawId
,
GLXDrawable
readId
,
GLXContextID
contextId
,
GLXContextTag
tag
)
int
DoMakeCurrent
(
__GLXclientState
*
cl
,
GLXDrawable
drawId
,
GLXDrawable
readId
,
GLXContextID
contextId
,
GLXContextTag
tag
)
{
ClientPtr
client
=
cl
->
client
;
DrawablePtr
pDraw
;
...
...
@@ -879,18 +897,19 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)