summaryrefslogtreecommitdiff
path: root/GL/glx/render2.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-01-12 00:21:59 +0000
committerIan Romanick <idr@us.ibm.com>2006-01-12 00:21:59 +0000
commit847d83ec3c90c5b298eaf19ba55251b4a30f4155 (patch)
tree92ad2d46a7d304e5c6362a79d571642bbb94d223 /GL/glx/render2.c
parentc56e9a8849ce8dd5c09732ae1860e409e7886690 (diff)
Bug #2996: libglx / libGLcore should use a dispatch table
Port all changes from the (monolithic) accelerated_indirect-0-0-1 branch to the modular trunk. This will break the Darwin and cygwin builds. Other than the changes to symlink-mesa.sh and the various Makefile.am files, to code is identical to what's in the branch. Reviewed by: airlied, krh
Diffstat (limited to 'GL/glx/render2.c')
-rw-r--r--GL/glx/render2.c76
1 files changed, 35 insertions, 41 deletions
diff --git a/GL/glx/render2.c b/GL/glx/render2.c
index 39d0c132a..b126638a1 100644
--- a/GL/glx/render2.c
+++ b/GL/glx/render2.c
@@ -41,8 +41,12 @@
#include <glxserver.h>
#include "unpack.h"
-#include "g_disptab.h"
-#include "g_disptab_EXT.h"
+#include "indirect_size.h"
+#include "indirect_dispatch.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
void __glXDisp_Map1f(GLbyte *pc)
@@ -58,7 +62,7 @@ void __glXDisp_Map1f(GLbyte *pc)
points = (GLfloat *)(pc + 16);
k = __glMap1f_size(target);
- glMap1f(target, u1, u2, k, order, points);
+ CALL_Map1f( GET_DISPATCH(), (target, u1, u2, k, order, points) );
}
void __glXDisp_Map2f(GLbyte *pc)
@@ -80,7 +84,7 @@ void __glXDisp_Map2f(GLbyte *pc)
ustride = vorder * k;
vstride = k;
- glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+ CALL_Map2f( GET_DISPATCH(), (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points) );
}
void __glXDisp_Map1d(GLbyte *pc)
@@ -122,7 +126,7 @@ void __glXDisp_Map1d(GLbyte *pc)
#else
points = (GLdouble*) pc;
#endif
- glMap1d(target, u1, u2, k, order, points);
+ CALL_Map1d( GET_DISPATCH(), (target, u1, u2, k, order, points) );
}
void __glXDisp_Map2d(GLbyte *pc)
@@ -170,17 +174,7 @@ void __glXDisp_Map2d(GLbyte *pc)
#else
points = (GLdouble*) pc;
#endif
- glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-void __glXDisp_CallLists(GLbyte *pc)
-{
- GLenum type;
- GLsizei n;
-
- type = *(GLenum *)(pc + 4);
- n = *(GLsizei *)(pc + 0);
- glCallLists(n, type, pc + 8);
+ CALL_Map2d( GET_DISPATCH(), (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points) );
}
void __glXDisp_DrawArrays(GLbyte *pc)
@@ -214,36 +208,36 @@ void __glXDisp_DrawArrays(GLbyte *pc)
switch (component) {
case GL_VERTEX_ARRAY:
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(numVals, datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_VERTEX_ARRAY) );
+ CALL_VertexPointer( GET_DISPATCH(), (numVals, datatype, stride, pc) );
break;
case GL_NORMAL_ARRAY:
- glEnableClientState(GL_NORMAL_ARRAY);
- glNormalPointer(datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_NORMAL_ARRAY) );
+ CALL_NormalPointer( GET_DISPATCH(), (datatype, stride, pc) );
break;
case GL_COLOR_ARRAY:
- glEnableClientState(GL_COLOR_ARRAY);
- glColorPointer(numVals, datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_COLOR_ARRAY) );
+ CALL_ColorPointer( GET_DISPATCH(), (numVals, datatype, stride, pc) );
break;
case GL_INDEX_ARRAY:
- glEnableClientState(GL_INDEX_ARRAY);
- glIndexPointer(datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_INDEX_ARRAY) );
+ CALL_IndexPointer( GET_DISPATCH(), (datatype, stride, pc) );
break;
case GL_TEXTURE_COORD_ARRAY:
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(numVals, datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_TEXTURE_COORD_ARRAY) );
+ CALL_TexCoordPointer( GET_DISPATCH(), (numVals, datatype, stride, pc) );
break;
case GL_EDGE_FLAG_ARRAY:
- glEnableClientState(GL_EDGE_FLAG_ARRAY);
- glEdgeFlagPointer(stride, (const GLboolean *)pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_EDGE_FLAG_ARRAY) );
+ CALL_EdgeFlagPointer( GET_DISPATCH(), (stride, (const GLboolean *)pc) );
break;
case GL_SECONDARY_COLOR_ARRAY:
- glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
- glSecondaryColorPointer(numVals, datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_SECONDARY_COLOR_ARRAY) );
+ CALL_SecondaryColorPointerEXT( GET_DISPATCH(), (numVals, datatype, stride, pc) );
break;
case GL_FOG_COORD_ARRAY:
- glEnableClientState(GL_FOG_COORD_ARRAY);
- glFogCoordPointer(datatype, stride, pc);
+ CALL_EnableClientState( GET_DISPATCH(), (GL_FOG_COORD_ARRAY) );
+ CALL_FogCoordPointerEXT( GET_DISPATCH(), (datatype, stride, pc) );
break;
default:
break;
@@ -252,17 +246,17 @@ void __glXDisp_DrawArrays(GLbyte *pc)
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
- glDrawArrays(primType, 0, numVertexes);
+ CALL_DrawArrays( GET_DISPATCH(), (primType, 0, numVertexes) );
/* turn off anything we might have turned on */
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_INDEX_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_EDGE_FLAG_ARRAY);
- glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
- glDisableClientState(GL_FOG_COORD_ARRAY);
+ CALL_DisableClientState( GET_DISPATCH(), (GL_VERTEX_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_NORMAL_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_COLOR_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_INDEX_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_TEXTURE_COORD_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_EDGE_FLAG_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_SECONDARY_COLOR_ARRAY) );
+ CALL_DisableClientState( GET_DISPATCH(), (GL_FOG_COORD_ARRAY) );
}
void __glXDisp_DrawArraysEXT(GLbyte *pc)