Convert all calls using _glapi_Dispatch to use the new GL_CALL macro.
authorIan Romanick <idr@us.ibm.com>
Thu, 27 May 2004 00:03:53 +0000 (00:03 +0000)
committerIan Romanick <idr@us.ibm.com>
Thu, 27 May 2004 00:03:53 +0000 (00:03 +0000)
src/mesa/drivers/dri/r200/r200_vtxfmt.c
src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
src/mesa/glapi/glthread.h
src/mesa/main/api_arrayelt.c
src/mesa/main/api_loopback.c
src/mesa/main/api_noop.c
src/mesa/main/dispatch.c
src/mesa/main/vtxfmt_tmp.h
src/mesa/tnl/t_array_api.c
src/mesa/tnl/t_save_api.c

index 25afd3c..ee31361 100644 (file)
@@ -394,17 +394,24 @@ static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller )
 }
 
 
+/**
+ * \todo
+ * An interesting optimization of this function would be to have 3 element
+ * table with the dispatch offsets of the TexCoord?fv functions, use count
+ * to look-up the table, and a specialized version of GL_CALL that used the
+ * offset number instead of the name.
+ */
 static void dispatch_texcoord( GLuint count, GLfloat * f )
 {
    switch( count ) {
    case 3:
-      _glapi_Dispatch->TexCoord3fv( f );
+      GL_CALL(TexCoord3fv)( f );
       break;
    case 2:
-      _glapi_Dispatch->TexCoord2fv( f );
+      GL_CALL(TexCoord2fv)( f );
       break;
    case 1:
-      _glapi_Dispatch->TexCoord1fv( f );
+      GL_CALL(TexCoord1fv)( f );
       break;
    default:
       assert( count == 0 );
@@ -416,13 +423,13 @@ static void dispatch_multitexcoord( GLuint count, GLuint unit, GLfloat * f )
 {
    switch( count ) {
    case 3:
-      _glapi_Dispatch->MultiTexCoord3fvARB( GL_TEXTURE0+unit, f );
+      GL_CALL(MultiTexCoord3fvARB)( GL_TEXTURE0+unit, f );
       break;
    case 2:
-      _glapi_Dispatch->MultiTexCoord2fvARB( GL_TEXTURE0+unit, f );
+      GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE0+unit, f );
       break;
    case 1:
-      _glapi_Dispatch->MultiTexCoord1fvARB( GL_TEXTURE0+unit, f );
+      GL_CALL(MultiTexCoord1fvARB)( GL_TEXTURE0+unit, f );
       break;
    default:
       assert( count == 0 );
@@ -470,7 +477,7 @@ static void VFMT_FALLBACK( const char *caller )
    assert(rmesa->dma.flush == 0);
    rmesa->vb.fell_back = GL_TRUE;
    rmesa->vb.installed = GL_FALSE;
-   _glapi_Dispatch->Begin( prim );
+   GL_CALL(Begin)( prim );
 
    if (rmesa->vb.installed_color_3f_sz == 4)
       alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
@@ -481,25 +488,25 @@ static void VFMT_FALLBACK( const char *caller )
       GLuint offset = 3;
 
       if (ind0 & R200_VTX_N0) {
-        _glapi_Dispatch->Normal3fv( &tmp[i][offset] ); 
+        GL_CALL(Normal3fv)( &tmp[i][offset] ); 
         offset += 3;
       }
 
       if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
-        _glapi_Dispatch->Color4ubv( (GLubyte *)&tmp[i][offset] ); 
+        GL_CALL(Color4ubv)( (GLubyte *)&tmp[i][offset] ); 
         offset++;
       }
       else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
-        _glapi_Dispatch->Color4fv( &tmp[i][offset] ); 
+        GL_CALL(Color4fv)( &tmp[i][offset] ); 
         offset+=4;
       } 
       else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
-        _glapi_Dispatch->Color3fv( &tmp[i][offset] ); 
+        GL_CALL(Color3fv)( &tmp[i][offset] ); 
         offset+=3;
       }
 
       if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) {
-        _glapi_Dispatch->SecondaryColor3ubvEXT( (GLubyte *)&tmp[i][offset] ); 
+        GL_CALL(SecondaryColor3ubvEXT)( (GLubyte *)&tmp[i][offset] ); 
         offset++;
       }
 
@@ -513,39 +520,39 @@ static void VFMT_FALLBACK( const char *caller )
         offset += count;
       }
 
-      _glapi_Dispatch->Vertex3fv( &tmp[i][0] );
+      GL_CALL(Vertex3fv)( &tmp[i][0] );
    }
 
    /* Replay current vertex
     */
    if (ind0 & R200_VTX_N0) 
-       _glapi_Dispatch->Normal3fv( rmesa->vb.normalptr );
+       GL_CALL(Normal3fv)( rmesa->vb.normalptr );
 
    if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) {
-      _glapi_Dispatch->Color4ub( rmesa->vb.colorptr->red,
-                                rmesa->vb.colorptr->green,
-                                rmesa->vb.colorptr->blue,
-                                rmesa->vb.colorptr->alpha );
+      GL_CALL(Color4ub)( rmesa->vb.colorptr->red,
+                        rmesa->vb.colorptr->green,
+                        rmesa->vb.colorptr->blue,
+                        rmesa->vb.colorptr->alpha );
    }
    else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) {
-      _glapi_Dispatch->Color4fv( rmesa->vb.floatcolorptr );
+      GL_CALL(Color4fv)( rmesa->vb.floatcolorptr );
    }
    else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) {
       if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) {
-        _glapi_Dispatch->Color4f( rmesa->vb.floatcolorptr[0],
-                                  rmesa->vb.floatcolorptr[1],
-                                  rmesa->vb.floatcolorptr[2],
-                                  alpha );
+        GL_CALL(Color4f)( rmesa->vb.floatcolorptr[0],
+                          rmesa->vb.floatcolorptr[1],
+                          rmesa->vb.floatcolorptr[2],
+                          alpha );
       }
       else {
-        _glapi_Dispatch->Color3fv( rmesa->vb.floatcolorptr );
+        GL_CALL(Color3fv)( rmesa->vb.floatcolorptr );
       }
    }
 
    if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) 
-      _glapi_Dispatch->SecondaryColor3ubEXT( rmesa->vb.specptr->red, 
-                                            rmesa->vb.specptr->green,
-                                            rmesa->vb.specptr->blue ); 
+       GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red, 
+                                     rmesa->vb.specptr->green,
+                                     rmesa->vb.specptr->blue ); 
 
    count = VTX_TEXn_COUNT( ind1, 0 );
    dispatch_texcoord( count, rmesa->vb.texcoordptr[0] );
@@ -886,7 +893,7 @@ static void r200_Materialfv( GLenum face, GLenum pname,
 
    if (rmesa->vb.prim[0] != GL_POLYGON+1) {
       VFMT_FALLBACK( __FUNCTION__ );
-      _glapi_Dispatch->Materialfv( face, pname, params );
+      GL_CALL(Materialfv)( face, pname, params );
       return;
    }
    _mesa_noop_Materialfv( face, pname, params );
@@ -925,7 +932,7 @@ static void r200_Begin( GLenum mode )
       r200VtxfmtValidate( ctx );
 
    if (!rmesa->vb.installed) {
-      _glapi_Dispatch->Begin( mode );
+      GL_CALL(Begin)( mode );
       return;
    }
 
index 7a0ff51..00a06cc 100644 (file)
@@ -417,7 +417,7 @@ static void VFMT_FALLBACK( const char *caller )
 
       if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
         radeon_color_t *spec = (radeon_color_t *)&tmp[i][offset];
-        _glapi_Dispatch->SecondaryColor3ubEXT( spec->red, spec->green, spec->blue );
+        GL_CALL(SecondaryColor3ubEXT)( spec->red, spec->green, spec->blue );
         offset++;
       }
 
@@ -453,7 +453,7 @@ static void VFMT_FALLBACK( const char *caller )
    }
 
    if (ind & RADEON_CP_VC_FRMT_PKSPEC) 
-      _glapi_Dispatch->SecondaryColor3ubEXT( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue ); 
+       GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue ); 
 
    if (ind & RADEON_CP_VC_FRMT_ST0) 
       glTexCoord2fv( rmesa->vb.texcoordptr[0] );
index 00710c1..4391ed4 100644 (file)
@@ -290,6 +290,9 @@ _glthread_GetTSD(_glthread_TSD *);
 extern void
 _glthread_SetTSD(_glthread_TSD *, void *);
 
+#ifndef GL_CALL
+# define GL_CALL(name) (*(_glapi_Dispatch-> name))
+#endif
 
 
 #endif /* THREADS_H */
index 8e1d17d..a127fe0 100644 (file)
@@ -140,42 +140,42 @@ static array_func NormalFuncs[8] = {
 /* Wrapper functions in case glSecondaryColor*EXT doesn't exist */
 static void GLAPIENTRY SecondaryColor3bvEXT(const GLbyte *c)
 {
-   _glapi_Dispatch->SecondaryColor3bvEXT(c);
+   GL_CALL(SecondaryColor3bvEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3ubvEXT(const GLubyte *c)
 {
-   _glapi_Dispatch->SecondaryColor3ubvEXT(c);
+   GL_CALL(SecondaryColor3ubvEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3svEXT(const GLshort *c)
 {
-   _glapi_Dispatch->SecondaryColor3svEXT(c);
+   GL_CALL(SecondaryColor3svEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3usvEXT(const GLushort *c)
 {
-   _glapi_Dispatch->SecondaryColor3usvEXT(c);
+   GL_CALL(SecondaryColor3usvEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3ivEXT(const GLint *c)
 {
-   _glapi_Dispatch->SecondaryColor3ivEXT(c);
+   GL_CALL(SecondaryColor3ivEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3uivEXT(const GLuint *c)
 {
-   _glapi_Dispatch->SecondaryColor3uivEXT(c);
+   GL_CALL(SecondaryColor3uivEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3fvEXT(const GLfloat *c)
 {
-   _glapi_Dispatch->SecondaryColor3fvEXT(c);
+   GL_CALL(SecondaryColor3fvEXT)(c);
 }
 
 static void GLAPIENTRY SecondaryColor3dvEXT(const GLdouble *c)
 {
-   _glapi_Dispatch->SecondaryColor3dvEXT(c);
+   GL_CALL(SecondaryColor3dvEXT)(c);
 }
 
 static array_func SecondaryColorFuncs[8] = {
@@ -193,12 +193,12 @@ static array_func SecondaryColorFuncs[8] = {
 /* Again, wrapper functions in case glSecondaryColor*EXT doesn't exist */
 static void GLAPIENTRY FogCoordfvEXT(const GLfloat *f)
 {
-   _glapi_Dispatch->FogCoordfvEXT(f);
+   GL_CALL(FogCoordfvEXT)(f);
 }
 
 static void GLAPIENTRY FogCoorddvEXT(const GLdouble *f)
 {
-   _glapi_Dispatch->FogCoorddvEXT(f);
+   GL_CALL(FogCoorddvEXT)(f);
 }
 
 static array_func FogCoordFuncs[8] = {
@@ -219,87 +219,86 @@ static array_func FogCoordFuncs[8] = {
 
 static void GLAPIENTRY VertexAttrib1Nbv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, BYTE_TO_FLOAT(v[0]));
+   GL_CALL(VertexAttrib1fNV)(index, BYTE_TO_FLOAT(v[0]));
 }
 
 static void GLAPIENTRY VertexAttrib1bv(GLuint index, const GLbyte *v)
 {
-      _glapi_Dispatch->VertexAttrib1fNV(index, v[0]);
+   GL_CALL(VertexAttrib1fNV)(index, v[0]);
 }
 
 static void GLAPIENTRY VertexAttrib2Nbv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, BYTE_TO_FLOAT(v[0]),
-                                     BYTE_TO_FLOAT(v[1]));
+   GL_CALL(VertexAttrib2fNV)(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]));
 }
 
 static void GLAPIENTRY VertexAttrib2bv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, v[0], v[1]);
+   GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
 }
 
 static void GLAPIENTRY VertexAttrib3Nbv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, BYTE_TO_FLOAT(v[0]),
-                                     BYTE_TO_FLOAT(v[1]),
-                                     BYTE_TO_FLOAT(v[2]));
+   GL_CALL(VertexAttrib3fNV)(index, BYTE_TO_FLOAT(v[0]),
+                            BYTE_TO_FLOAT(v[1]),
+                            BYTE_TO_FLOAT(v[2]));
 }
 
 static void GLAPIENTRY VertexAttrib3bv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, v[0], v[1], v[2]);
+   GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
 }
 
 static void GLAPIENTRY VertexAttrib4Nbv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, BYTE_TO_FLOAT(v[0]),
-                                     BYTE_TO_FLOAT(v[1]),
-                                     BYTE_TO_FLOAT(v[2]),
-                                     BYTE_TO_FLOAT(v[3]));
+   GL_CALL(VertexAttrib4fNV)(index, BYTE_TO_FLOAT(v[0]),
+                            BYTE_TO_FLOAT(v[1]),
+                            BYTE_TO_FLOAT(v[2]),
+                            BYTE_TO_FLOAT(v[3]));
 }
 
 static void GLAPIENTRY VertexAttrib4bv(GLuint index, const GLbyte *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, v[0], v[1], v[2], v[3]);
+   GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
 }
 
 /* GL_UNSIGNED_BYTE attributes */
 
 static void GLAPIENTRY VertexAttrib1Nubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, UBYTE_TO_FLOAT(v[0]));
+   GL_CALL(VertexAttrib1fNV)(index, UBYTE_TO_FLOAT(v[0]));
 }
 
 static void GLAPIENTRY VertexAttrib1ubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, v[0]);
+   GL_CALL(VertexAttrib1fNV)(index, v[0]);
 }
 
 static void GLAPIENTRY VertexAttrib2Nubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, UBYTE_TO_FLOAT(v[0]),
-                                     UBYTE_TO_FLOAT(v[1]));
+   GL_CALL(VertexAttrib2fNV)(index, UBYTE_TO_FLOAT(v[0]),
+                            UBYTE_TO_FLOAT(v[1]));
 }
 
 static void GLAPIENTRY VertexAttrib2ubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, v[0], v[1]);
+   GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
 }
 
 static void GLAPIENTRY VertexAttrib3Nubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, UBYTE_TO_FLOAT(v[0]),
-                                     UBYTE_TO_FLOAT(v[1]),
-                                     UBYTE_TO_FLOAT(v[2]));
+   GL_CALL(VertexAttrib3fNV)(index, UBYTE_TO_FLOAT(v[0]),
+                            UBYTE_TO_FLOAT(v[1]),
+                            UBYTE_TO_FLOAT(v[2]));
 }
 static void GLAPIENTRY VertexAttrib3ubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, v[0], v[1], v[2]);
+   GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
 }
 
 static void GLAPIENTRY VertexAttrib4Nubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, UBYTE_TO_FLOAT(v[0]),
+   GL_CALL(VertexAttrib4fNV)(index, UBYTE_TO_FLOAT(v[0]),
                                      UBYTE_TO_FLOAT(v[1]),
                                      UBYTE_TO_FLOAT(v[2]),
                                      UBYTE_TO_FLOAT(v[3]));
@@ -307,243 +306,243 @@ static void GLAPIENTRY VertexAttrib4Nubv(GLuint index, const GLubyte *v)
 
 static void GLAPIENTRY VertexAttrib4ubv(GLuint index, const GLubyte *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, v[0], v[1], v[2], v[3]);
+   GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
 }
 
 /* GL_SHORT attributes */
 
 static void GLAPIENTRY VertexAttrib1Nsv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, SHORT_TO_FLOAT(v[0]));
+   GL_CALL(VertexAttrib1fNV)(index, SHORT_TO_FLOAT(v[0]));
 }
 
 static void GLAPIENTRY VertexAttrib1sv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, v[0]);
+   GL_CALL(VertexAttrib1fNV)(index, v[0]);
 }
 
 static void GLAPIENTRY VertexAttrib2Nsv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, SHORT_TO_FLOAT(v[0]),
-                                     SHORT_TO_FLOAT(v[1]));
+   GL_CALL(VertexAttrib2fNV)(index, SHORT_TO_FLOAT(v[0]),
+                            SHORT_TO_FLOAT(v[1]));
 }
 
 static void GLAPIENTRY VertexAttrib2sv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, v[0], v[1]);
+   GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
 }
 
 static void GLAPIENTRY VertexAttrib3Nsv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, SHORT_TO_FLOAT(v[0]),
-                                     SHORT_TO_FLOAT(v[1]),
-                                     SHORT_TO_FLOAT(v[2]));
+   GL_CALL(VertexAttrib3fNV)(index, SHORT_TO_FLOAT(v[0]),
+                            SHORT_TO_FLOAT(v[1]),
+                            SHORT_TO_FLOAT(v[2]));
 }
 
 static void GLAPIENTRY VertexAttrib3sv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, v[0], v[1], v[2]);
+   GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
 }
 
 static void GLAPIENTRY VertexAttrib4Nsv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, SHORT_TO_FLOAT(v[0]),
-                                     SHORT_TO_FLOAT(v[1]),
-                                     SHORT_TO_FLOAT(v[2]),
-                                     SHORT_TO_FLOAT(v[3]));
+   GL_CALL(VertexAttrib4fNV)(index, SHORT_TO_FLOAT(v[0]),
+                            SHORT_TO_FLOAT(v[1]),
+                            SHORT_TO_FLOAT(v[2]),
+                            SHORT_TO_FLOAT(v[3]));
 }
 
 static void GLAPIENTRY VertexAttrib4sv(GLuint index, const GLshort *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, v[0], v[1], v[2], v[3]);
+   GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
 }
 
 /* GL_UNSIGNED_SHORT attributes */
 
 static void GLAPIENTRY VertexAttrib1Nusv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, USHORT_TO_FLOAT(v[0]));
+   GL_CALL(VertexAttrib1fNV)(index, USHORT_TO_FLOAT(v[0]));
 }
 
 static void GLAPIENTRY VertexAttrib1usv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, v[0]);
+   GL_CALL(VertexAttrib1fNV)(index, v[0]);
 }
 
 static void GLAPIENTRY VertexAttrib2Nusv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, USHORT_TO_FLOAT(v[0]),
-                                     USHORT_TO_FLOAT(v[1]));
+   GL_CALL(VertexAttrib2fNV)(index, USHORT_TO_FLOAT(v[0]),
+                            USHORT_TO_FLOAT(v[1]));
 }
 
 static void GLAPIENTRY VertexAttrib2usv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, v[0], v[1]);
+   GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
 }
 
 static void GLAPIENTRY VertexAttrib3Nusv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, USHORT_TO_FLOAT(v[0]),
-                                     USHORT_TO_FLOAT(v[1]),
-                                     USHORT_TO_FLOAT(v[2]));
+   GL_CALL(VertexAttrib3fNV)(index, USHORT_TO_FLOAT(v[0]),
+                            USHORT_TO_FLOAT(v[1]),
+                            USHORT_TO_FLOAT(v[2]));
 }
 
 static void GLAPIENTRY VertexAttrib3usv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, v[0], v[1], v[2]);
+   GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
 }
 
 static void GLAPIENTRY VertexAttrib4Nusv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, USHORT_TO_FLOAT(v[0]),
-                                     USHORT_TO_FLOAT(v[1]),
-                                     USHORT_TO_FLOAT(v[2]),
-                                     USHORT_TO_FLOAT(v[3]));
+   GL_CALL(VertexAttrib4fNV)(index, USHORT_TO_FLOAT(v[0]),
+                            USHORT_TO_FLOAT(v[1]),
+                            USHORT_TO_FLOAT(v[2]),
+                            USHORT_TO_FLOAT(v[3]));
 }
 
 static void GLAPIENTRY VertexAttrib4usv(GLuint index, const GLushort *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, v[0], v[1], v[2], v[3]);
+   GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
 }
 
 /* GL_INT attributes */
 
 static void GLAPIENTRY VertexAttrib1Niv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, INT_TO_FLOAT(v[0]));
+   GL_CALL(VertexAttrib1fNV)(index, INT_TO_FLOAT(v[0]));
 }
 
 static void GLAPIENTRY VertexAttrib1iv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, v[0]);
+   GL_CALL(VertexAttrib1fNV)(index, v[0]);
 }
 
 static void GLAPIENTRY VertexAttrib2Niv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, INT_TO_FLOAT(v[0]),
-                                     INT_TO_FLOAT(v[1]));
+   GL_CALL(VertexAttrib2fNV)(index, INT_TO_FLOAT(v[0]),
+                            INT_TO_FLOAT(v[1]));
 }
 
 static void GLAPIENTRY VertexAttrib2iv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, v[0], v[1]);
+   GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
 }
 
 static void GLAPIENTRY VertexAttrib3Niv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, INT_TO_FLOAT(v[0]),
-                                     INT_TO_FLOAT(v[1]),
-                                     INT_TO_FLOAT(v[2]));
+   GL_CALL(VertexAttrib3fNV)(index, INT_TO_FLOAT(v[0]),
+                            INT_TO_FLOAT(v[1]),
+                            INT_TO_FLOAT(v[2]));
 }
 
 static void GLAPIENTRY VertexAttrib3iv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, v[0], v[1], v[2]);
+   GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
 }
 
 static void GLAPIENTRY VertexAttrib4Niv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, INT_TO_FLOAT(v[0]),
-                                     INT_TO_FLOAT(v[1]),
-                                     INT_TO_FLOAT(v[2]),
-                                     INT_TO_FLOAT(v[3]));
+   GL_CALL(VertexAttrib4fNV)(index, INT_TO_FLOAT(v[0]),
+                            INT_TO_FLOAT(v[1]),
+                            INT_TO_FLOAT(v[2]),
+                            INT_TO_FLOAT(v[3]));
 }
 
 static void GLAPIENTRY VertexAttrib4iv(GLuint index, const GLint *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, v[0], v[1], v[2], v[3]);
+   GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
 }
 
 /* GL_UNSIGNED_INT attributes */
 
 static void GLAPIENTRY VertexAttrib1Nuiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, UINT_TO_FLOAT(v[0]));
+   GL_CALL(VertexAttrib1fNV)(index, UINT_TO_FLOAT(v[0]));
 }
 
 static void GLAPIENTRY VertexAttrib1uiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib1fNV(index, v[0]);
+   GL_CALL(VertexAttrib1fNV)(index, v[0]);
 }
 
 static void GLAPIENTRY VertexAttrib2Nuiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, UINT_TO_FLOAT(v[0]),
-                                     UINT_TO_FLOAT(v[1]));
+   GL_CALL(VertexAttrib2fNV)(index, UINT_TO_FLOAT(v[0]),
+                            UINT_TO_FLOAT(v[1]));
 }
 
 static void GLAPIENTRY VertexAttrib2uiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib2fNV(index, v[0], v[1]);
+   GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]);
 }
 
 static void GLAPIENTRY VertexAttrib3Nuiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, UINT_TO_FLOAT(v[0]),
-                                     UINT_TO_FLOAT(v[1]),
-                                     UINT_TO_FLOAT(v[2]));
+   GL_CALL(VertexAttrib3fNV)(index, UINT_TO_FLOAT(v[0]),
+                            UINT_TO_FLOAT(v[1]),
+                            UINT_TO_FLOAT(v[2]));
 }
 
 static void GLAPIENTRY VertexAttrib3uiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib3fNV(index, v[0], v[1], v[2]);
+   GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]);
 }
 
 static void GLAPIENTRY VertexAttrib4Nuiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, UINT_TO_FLOAT(v[0]),
-                                     UINT_TO_FLOAT(v[1]),
-                                     UINT_TO_FLOAT(v[2]),
-                                     UINT_TO_FLOAT(v[3]));
+   GL_CALL(VertexAttrib4fNV)(index, UINT_TO_FLOAT(v[0]),
+                            UINT_TO_FLOAT(v[1]),
+                            UINT_TO_FLOAT(v[2]),
+                            UINT_TO_FLOAT(v[3]));
 }
 
 static void GLAPIENTRY VertexAttrib4uiv(GLuint index, const GLuint *v)
 {
-   _glapi_Dispatch->VertexAttrib4fNV(index, v[0], v[1], v[2], v[3]);
+   GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]);
 }
 
 /* GL_FLOAT attributes */
 
 static void GLAPIENTRY VertexAttrib1fv(GLuint index, const GLfloat *v)
 {
-   _glapi_Dispatch->VertexAttrib1fvNV(index, v);
+   GL_CALL(VertexAttrib1fvNV)(index, v);
 }
 
 static void GLAPIENTRY VertexAttrib2fv(GLuint index, const GLfloat *v)
 {
-   _glapi_Dispatch->VertexAttrib2fvNV(index, v);
+   GL_CALL(VertexAttrib2fvNV)(index, v);
 }
 
 static void GLAPIENTRY VertexAttrib3fv(GLuint index, const GLfloat *v)
 {
-   _glapi_Dispatch->VertexAttrib3fvNV(index, v);
+   GL_CALL(VertexAttrib3fvNV)(index, v);
 }
 
 static void GLAPIENTRY VertexAttrib4fv(GLuint index, const GLfloat *v)
 {
-   _glapi_Dispatch->VertexAttrib4fvNV(index, v);
+   GL_CALL(VertexAttrib4fvNV)(index, v);
 }
 
 /* GL_DOUBLE attributes */
 
 static void GLAPIENTRY VertexAttrib1dv(GLuint index, const GLdouble *v)
 {
-   _glapi_Dispatch->VertexAttrib1dvNV(index, v);
+   GL_CALL(VertexAttrib1dvNV)(index, v);
 }
 
 static void GLAPIENTRY VertexAttrib2dv(GLuint index, const GLdouble *v)
 {
-   _glapi_Dispatch->VertexAttrib2dvNV(index, v);
+   GL_CALL(VertexAttrib2dvNV)(index, v);
 }
 
 static void GLAPIENTRY VertexAttrib3dv(GLuint index, const GLdouble *v)
 {
-   _glapi_Dispatch->VertexAttrib3dvNV(index, v);
+   GL_CALL(VertexAttrib3dvNV)(index, v);
 }
 
 static void GLAPIENTRY VertexAttrib4dv(GLuint index, const GLdouble *v)
 {
-   _glapi_Dispatch->VertexAttrib4dvNV(index, v);
+   GL_CALL(VertexAttrib4dvNV)(index, v);
 }
 
 
index 55ddb1c..0c21302 100644 (file)
@@ -35,6 +35,7 @@
 #include "macros.h"
 #include "colormac.h"
 #include "api_loopback.h"
+#include "glthread.h"
 
 /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
  * calls to a smaller set of driver-provided formats.  Currently just
  * listed in dd.h.  The easiest way for a driver to do this is to
  * install the supplied software t&l module.
  */
-#define COLORF(r,g,b,a)             _glapi_Dispatch->Color4f(r,g,b,a)
-#define VERTEX2(x,y)               _glapi_Dispatch->Vertex2f(x,y)
-#define VERTEX3(x,y,z)             _glapi_Dispatch->Vertex3f(x,y,z)
-#define VERTEX4(x,y,z,w)            _glapi_Dispatch->Vertex4f(x,y,z,w)
-#define NORMAL(x,y,z)               _glapi_Dispatch->Normal3f(x,y,z)
-#define TEXCOORD1(s)                _glapi_Dispatch->TexCoord1f(s)
-#define TEXCOORD2(s,t)              _glapi_Dispatch->TexCoord2f(s,t)
-#define TEXCOORD3(s,t,u)            _glapi_Dispatch->TexCoord3f(s,t,u)
-#define TEXCOORD4(s,t,u,v)          _glapi_Dispatch->TexCoord4f(s,t,u,v)
-#define INDEX(c)                   _glapi_Dispatch->Indexf(c)
-#define MULTI_TEXCOORD1(z,s)       _glapi_Dispatch->MultiTexCoord1fARB(z,s)
-#define MULTI_TEXCOORD2(z,s,t)     _glapi_Dispatch->MultiTexCoord2fARB(z,s,t)
-#define MULTI_TEXCOORD3(z,s,t,u)    _glapi_Dispatch->MultiTexCoord3fARB(z,s,t,u)
-#define MULTI_TEXCOORD4(z,s,t,u,v)  _glapi_Dispatch->MultiTexCoord4fARB(z,s,t,u,v)
-#define EVALCOORD1(x)               _glapi_Dispatch->EvalCoord1f(x)
-#define EVALCOORD2(x,y)             _glapi_Dispatch->EvalCoord2f(x,y)
-#define MATERIALFV(a,b,c)           _glapi_Dispatch->Materialfv(a,b,c)
-#define RECTF(a,b,c,d)              _glapi_Dispatch->Rectf(a,b,c,d)
+#define COLORF(r,g,b,a)             GL_CALL(Color4f)(r,g,b,a)
+#define VERTEX2(x,y)               GL_CALL(Vertex2f)(x,y)
+#define VERTEX3(x,y,z)             GL_CALL(Vertex3f)(x,y,z)
+#define VERTEX4(x,y,z,w)            GL_CALL(Vertex4f)(x,y,z,w)
+#define NORMAL(x,y,z)               GL_CALL(Normal3f)(x,y,z)
+#define TEXCOORD1(s)                GL_CALL(TexCoord1f)(s)
+#define TEXCOORD2(s,t)              GL_CALL(TexCoord2f)(s,t)
+#define TEXCOORD3(s,t,u)            GL_CALL(TexCoord3f)(s,t,u)
+#define TEXCOORD4(s,t,u,v)          GL_CALL(TexCoord4f)(s,t,u,v)
+#define INDEX(c)                   GL_CALL(Indexf)(c)
+#define MULTI_TEXCOORD1(z,s)       GL_CALL(MultiTexCoord1fARB)(z,s)
+#define MULTI_TEXCOORD2(z,s,t)     GL_CALL(MultiTexCoord2fARB)(z,s,t)
+#define MULTI_TEXCOORD3(z,s,t,u)    GL_CALL(MultiTexCoord3fARB)(z,s,t,u)
+#define MULTI_TEXCOORD4(z,s,t,u,v)  GL_CALL(MultiTexCoord4fARB)(z,s,t,u,v)
+#define EVALCOORD1(x)               GL_CALL(EvalCoord1f)(x)
+#define EVALCOORD2(x,y)             GL_CALL(EvalCoord2f)(x,y)
+#define MATERIALFV(a,b,c)           GL_CALL(Materialfv)(a,b,c)
+#define RECTF(a,b,c,d)              GL_CALL(Rectf)(a,b,c,d)
 
 /* Extension functions must be dereferenced through _glapi_Dispatch as
  * not all libGL.so's will have all the uptodate entrypoints.
  */
-#define ATTRIB1(index,x)        _glapi_Dispatch->VertexAttrib1fNV(index,x)
-#define ATTRIB2(index,x,y)      _glapi_Dispatch->VertexAttrib2fNV(index,x,y)
-#define ATTRIB3(index,x,y,z)    _glapi_Dispatch->VertexAttrib3fNV(index,x,y,z)
-#define ATTRIB4(index,x,y,z,w)  _glapi_Dispatch->VertexAttrib4fNV(index,x,y,z,w)
-#define FOGCOORDF(x)            _glapi_Dispatch->FogCoordfEXT(x)
-#define SECONDARYCOLORF(a,b,c)  _glapi_Dispatch->SecondaryColor3fEXT(a,b,c)
+#define ATTRIB1(index,x)        GL_CALL(VertexAttrib1fNV)(index,x)
+#define ATTRIB2(index,x,y)      GL_CALL(VertexAttrib2fNV)(index,x,y)
+#define ATTRIB3(index,x,y,z)    GL_CALL(VertexAttrib3fNV)(index,x,y,z)
+#define ATTRIB4(index,x,y,z,w)  GL_CALL(VertexAttrib4fNV)(index,x,y,z,w)
+#define FOGCOORDF(x)            GL_CALL(FogCoordfEXT)(x)
+#define SECONDARYCOLORF(a,b,c)  GL_CALL(SecondaryColor3fEXT)(a,b,c)
 
 static void GLAPIENTRY
 loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue )
index 2f38526..e5e6717 100644 (file)
@@ -595,12 +595,12 @@ void GLAPIENTRY _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2
       ASSERT_OUTSIDE_BEGIN_END(ctx);
    }
 
-   _glapi_Dispatch->Begin( GL_QUADS );
-   _glapi_Dispatch->Vertex2f( x1, y1 );
-   _glapi_Dispatch->Vertex2f( x2, y1 );
-   _glapi_Dispatch->Vertex2f( x2, y2 );
-   _glapi_Dispatch->Vertex2f( x1, y2 );
-   _glapi_Dispatch->End();
+   GL_CALL(Begin)( GL_QUADS );
+   GL_CALL(Vertex2f)( x1, y1 );
+   GL_CALL(Vertex2f)( x2, y1 );
+   GL_CALL(Vertex2f)( x2, y2 );
+   GL_CALL(Vertex2f)( x1, y2 );
+   GL_CALL(End)();
 }
 
 
@@ -616,10 +616,10 @@ void GLAPIENTRY _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
    if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
       return;
 
-   _glapi_Dispatch->Begin(mode);
+   GL_CALL(Begin)(mode);
    for (i = 0; i < count; i++)
-      _glapi_Dispatch->ArrayElement(start + i);
-   _glapi_Dispatch->End();
+       GL_CALL(ArrayElement)(start + i);
+   GL_CALL(End)();
 }
 
 
@@ -632,27 +632,27 @@ void GLAPIENTRY _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
    if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
       return;
 
-   _glapi_Dispatch->Begin(mode);
+   GL_CALL(Begin)(mode);
 
    switch (type) {
    case GL_UNSIGNED_BYTE:
       for (i = 0 ; i < count ; i++)
-        _glapi_Dispatch->ArrayElement( ((GLubyte *)indices)[i] );
+         GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] );
       break;
    case GL_UNSIGNED_SHORT:
       for (i = 0 ; i < count ; i++)
-        _glapi_Dispatch->ArrayElement( ((GLushort *)indices)[i] );
+         GL_CALL(ArrayElement)( ((GLushort *)indices)[i] );
       break;
    case GL_UNSIGNED_INT:
       for (i = 0 ; i < count ; i++)
-        _glapi_Dispatch->ArrayElement( ((GLuint *)indices)[i] );
+         GL_CALL(ArrayElement)( ((GLuint *)indices)[i] );
       break;
    default:
       _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
       break;
    }
 
-   _glapi_Dispatch->End();
+   GL_CALL(End)();
 }
 
 void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode,
@@ -665,7 +665,7 @@ void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode,
    if (_mesa_validate_DrawRangeElements( ctx, mode,
                                         start, end,
                                         count, type, indices ))
-      _glapi_Dispatch->DrawElements( mode, count, type, indices );
+       GL_CALL(DrawElements)( mode, count, type, indices );
 }
 
 /*
@@ -710,11 +710,11 @@ void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
    du = ctx->Eval.MapGrid1du;
    u = ctx->Eval.MapGrid1u1 + i1 * du;
 
-   _glapi_Dispatch->Begin( prim );
+   GL_CALL(Begin)( prim );
    for (i=i1;i<=i2;i++,u+=du) {
-      _glapi_Dispatch->EvalCoord1f( u );
+      GL_CALL(EvalCoord1f)( u );
    }
-   _glapi_Dispatch->End();
+   GL_CALL(End)();
 }
 
 
@@ -749,38 +749,38 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1,
 
    switch (mode) {
    case GL_POINT:
-      _glapi_Dispatch->Begin( GL_POINTS );
+      GL_CALL(Begin)( GL_POINTS );
       for (v=v1,j=j1;j<=j2;j++,v+=dv) {
         for (u=u1,i=i1;i<=i2;i++,u+=du) {
-           _glapi_Dispatch->EvalCoord2f(u, v );
+           GL_CALL(EvalCoord2f)(u, v );
         }
       }
-      _glapi_Dispatch->End();
+      GL_CALL(End)();
       break;
    case GL_LINE:
       for (v=v1,j=j1;j<=j2;j++,v+=dv) {
-        _glapi_Dispatch->Begin( GL_LINE_STRIP );
+        GL_CALL(Begin)( GL_LINE_STRIP );
         for (u=u1,i=i1;i<=i2;i++,u+=du) {
-           _glapi_Dispatch->EvalCoord2f(u, v );
+           GL_CALL(EvalCoord2f)(u, v );
         }
-        _glapi_Dispatch->End();
+        GL_CALL(End)();
       }
       for (u=u1,i=i1;i<=i2;i++,u+=du) {
-        _glapi_Dispatch->Begin( GL_LINE_STRIP );
+        GL_CALL(Begin)( GL_LINE_STRIP );
         for (v=v1,j=j1;j<=j2;j++,v+=dv) {
-           _glapi_Dispatch->EvalCoord2f(u, v );
+           GL_CALL(EvalCoord2f)(u, v );
         }
-        _glapi_Dispatch->End();
+        GL_CALL(End)();
       }
       break;
    case GL_FILL:
       for (v=v1,j=j1;j<j2;j++,v+=dv) {
-        _glapi_Dispatch->Begin( GL_TRIANGLE_STRIP );
+        GL_CALL(Begin)( GL_TRIANGLE_STRIP );
         for (u=u1,i=i1;i<=i2;i++,u+=du) {
-           _glapi_Dispatch->EvalCoord2f(u, v );
-           _glapi_Dispatch->EvalCoord2f(u, v+dv );
+           GL_CALL(EvalCoord2f)(u, v );
+           GL_CALL(EvalCoord2f)(u, v+dv );
         }
-        _glapi_Dispatch->End();
+        GL_CALL(End)();
       }
       break;
    default:
index 87dc64f..5337636 100644 (file)
 #define NAME(func)  gl##func
 #endif
 
-
 #if 0  /* Use this to log GL calls to stdout (for DEBUG only!) */
 
 #define F stdout
 #define DISPATCH(FUNC, ARGS, MESSAGE)          \
    fprintf MESSAGE;                            \
-   (_glapi_Dispatch->FUNC) ARGS;
+   GL_CALL(FUNC) ARGS;
 
 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE)   \
    fprintf MESSAGE;                            \
-   return (_glapi_Dispatch->FUNC) ARGS
+   return GL_CALL(FUNC) ARGS;
 
 #else
 
 #define DISPATCH(FUNC, ARGS, MESSAGE)          \
-   (_glapi_Dispatch->FUNC) ARGS;
+   GL_CALL(FUNC) ARGS;
 
 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE)   \
-   return (_glapi_Dispatch->FUNC) ARGS
+   return GL_CALL(FUNC) ARGS;
 
 #endif /* logging */
 
index 044ec1b..22a4b35 100644 (file)
 static void GLAPIENTRY TAG(ArrayElement)( GLint i )
 {
    PRE_LOOPBACK( ArrayElement );
-   _glapi_Dispatch->ArrayElement( i );
+   GL_CALL(ArrayElement)( i );
 }
 
 static void GLAPIENTRY TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b )
 {
    PRE_LOOPBACK( Color3f );
-   _glapi_Dispatch->Color3f( r, g, b );
+   GL_CALL(Color3f)( r, g, b );
 }
 
 static void GLAPIENTRY TAG(Color3fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Color3fv );
-   _glapi_Dispatch->Color3fv( v );
+   GL_CALL(Color3fv)( v );
 }
 
 static void GLAPIENTRY TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a )
 {
    PRE_LOOPBACK( Color4f );
-   _glapi_Dispatch->Color4f( r, g, b, a );
+   GL_CALL(Color4f)( r, g, b, a );
 }
 
 static void GLAPIENTRY TAG(Color4fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Color4fv );
-   _glapi_Dispatch->Color4fv( v );
+   GL_CALL(Color4fv)( v );
 }
 
 static void GLAPIENTRY TAG(EdgeFlag)( GLboolean e )
 {
    PRE_LOOPBACK( EdgeFlag );
-   _glapi_Dispatch->EdgeFlag( e );
+   GL_CALL(EdgeFlag)( e );
 }
 
 static void GLAPIENTRY TAG(EdgeFlagv)( const GLboolean *v )
 {
    PRE_LOOPBACK( EdgeFlagv );
-   _glapi_Dispatch->EdgeFlagv( v );
+   GL_CALL(EdgeFlagv)( v );
 }
 
 static void GLAPIENTRY TAG(EvalCoord1f)( GLfloat s )
 {
    PRE_LOOPBACK( EvalCoord1f );
-   _glapi_Dispatch->EvalCoord1f( s );
+   GL_CALL(EvalCoord1f)( s );
 }
 
 static void GLAPIENTRY TAG(EvalCoord1fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( EvalCoord1fv );
-   _glapi_Dispatch->EvalCoord1fv( v );
+   GL_CALL(EvalCoord1fv)( v );
 }
 
 static void GLAPIENTRY TAG(EvalCoord2f)( GLfloat s, GLfloat t )
 {
    PRE_LOOPBACK( EvalCoord2f );
-   _glapi_Dispatch->EvalCoord2f( s, t );
+   GL_CALL(EvalCoord2f)( s, t );
 }
 
 static void GLAPIENTRY TAG(EvalCoord2fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( EvalCoord2fv );
-   _glapi_Dispatch->EvalCoord2fv( v );
+   GL_CALL(EvalCoord2fv)( v );
 }
 
 static void GLAPIENTRY TAG(EvalPoint1)( GLint i )
 {
    PRE_LOOPBACK( EvalPoint1 );
-   _glapi_Dispatch->EvalPoint1( i );
+   GL_CALL(EvalPoint1)( i );
 }
 
 static void GLAPIENTRY TAG(EvalPoint2)( GLint i, GLint j )
 {
    PRE_LOOPBACK( EvalPoint2 );
-   _glapi_Dispatch->EvalPoint2( i, j );
+   GL_CALL(EvalPoint2)( i, j );
 }
 
 static void GLAPIENTRY TAG(FogCoordfEXT)( GLfloat f )
 {
    PRE_LOOPBACK( FogCoordfEXT );
-   _glapi_Dispatch->FogCoordfEXT( f );
+   GL_CALL(FogCoordfEXT)( f );
 }
 
 static void GLAPIENTRY TAG(FogCoordfvEXT)( const GLfloat *v )
 {
    PRE_LOOPBACK( FogCoordfvEXT );
-   _glapi_Dispatch->FogCoordfvEXT( v );
+   GL_CALL(FogCoordfvEXT)( v );
 }
 
 static void GLAPIENTRY TAG(Indexf)( GLfloat f )
 {
    PRE_LOOPBACK( Indexf );
-   _glapi_Dispatch->Indexf( f );
+   GL_CALL(Indexf)( f );
 }
 
 static void GLAPIENTRY TAG(Indexfv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Indexfv );
-   _glapi_Dispatch->Indexfv( v );
+   GL_CALL(Indexfv)( v );
 }
 
 static void GLAPIENTRY TAG(Materialfv)( GLenum face, GLenum pname, const GLfloat *v )
 {
    PRE_LOOPBACK( Materialfv );
-   _glapi_Dispatch->Materialfv( face, pname, v );
+   GL_CALL(Materialfv)( face, pname, v );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord1fARB)( GLenum target, GLfloat a )
 {
    PRE_LOOPBACK( MultiTexCoord1fARB );
-   _glapi_Dispatch->MultiTexCoord1fARB( target, a );
+   GL_CALL(MultiTexCoord1fARB)( target, a );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord1fvARB)( GLenum target, const GLfloat *tc )
 {
    PRE_LOOPBACK( MultiTexCoord1fvARB );
-   _glapi_Dispatch->MultiTexCoord1fvARB( target, tc );
+   GL_CALL(MultiTexCoord1fvARB)( target, tc );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord2fARB)( GLenum target, GLfloat s, GLfloat t )
 {
    PRE_LOOPBACK( MultiTexCoord2fARB );
-   _glapi_Dispatch->MultiTexCoord2fARB( target, s, t );
+   GL_CALL(MultiTexCoord2fARB)( target, s, t );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord2fvARB)( GLenum target, const GLfloat *tc )
 {
    PRE_LOOPBACK( MultiTexCoord2fvARB );
-   _glapi_Dispatch->MultiTexCoord2fvARB( target, tc );
+   GL_CALL(MultiTexCoord2fvARB)( target, tc );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord3fARB)( GLenum target, GLfloat s,
                                     GLfloat t, GLfloat r )
 {
    PRE_LOOPBACK( MultiTexCoord3fARB );
-   _glapi_Dispatch->MultiTexCoord3fARB( target, s, t, r );
+   GL_CALL(MultiTexCoord3fARB)( target, s, t, r );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord3fvARB)( GLenum target, const GLfloat *tc )
 {
    PRE_LOOPBACK( MultiTexCoord3fvARB );
-   _glapi_Dispatch->MultiTexCoord3fvARB( target, tc );
+   GL_CALL(MultiTexCoord3fvARB)( target, tc );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s,
                                     GLfloat t, GLfloat r, GLfloat q )
 {
    PRE_LOOPBACK( MultiTexCoord4fARB );
-   _glapi_Dispatch->MultiTexCoord4fARB( target, s, t, r, q );
+   GL_CALL(MultiTexCoord4fARB)( target, s, t, r, q );
 }
 
 static void GLAPIENTRY TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *tc )
 {
    PRE_LOOPBACK( MultiTexCoord4fvARB );
-   _glapi_Dispatch->MultiTexCoord4fvARB( target, tc );
+   GL_CALL(MultiTexCoord4fvARB)( target, tc );
 }
 
 static void GLAPIENTRY TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z )
 {
    PRE_LOOPBACK( Normal3f );
-   _glapi_Dispatch->Normal3f( x, y, z );
+   GL_CALL(Normal3f)( x, y, z );
 }
 
 static void GLAPIENTRY TAG(Normal3fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Normal3fv );
-   _glapi_Dispatch->Normal3fv( v );
+   GL_CALL(Normal3fv)( v );
 }
 
 static void GLAPIENTRY TAG(SecondaryColor3fEXT)( GLfloat r, GLfloat g, GLfloat b )
 {
    PRE_LOOPBACK( SecondaryColor3fEXT );
-   _glapi_Dispatch->SecondaryColor3fEXT( r, g, b );
+   GL_CALL(SecondaryColor3fEXT)( r, g, b );
 }
 
 static void GLAPIENTRY TAG(SecondaryColor3fvEXT)( const GLfloat *v )
 {
    PRE_LOOPBACK( SecondaryColor3fvEXT );
-   _glapi_Dispatch->SecondaryColor3fvEXT( v );
+   GL_CALL(SecondaryColor3fvEXT)( v );
 }
 
 static void GLAPIENTRY TAG(TexCoord1f)( GLfloat s )
 {
    PRE_LOOPBACK( TexCoord1f );
-   _glapi_Dispatch->TexCoord1f( s );
+   GL_CALL(TexCoord1f)( s );
 }
 
 static void GLAPIENTRY TAG(TexCoord1fv)( const GLfloat *tc )
 {
    PRE_LOOPBACK( TexCoord1fv );
-   _glapi_Dispatch->TexCoord1fv( tc );
+   GL_CALL(TexCoord1fv)( tc );
 }
 
 static void GLAPIENTRY TAG(TexCoord2f)( GLfloat s, GLfloat t )
 {
    PRE_LOOPBACK( TexCoord2f );
-   _glapi_Dispatch->TexCoord2f( s, t );
+   GL_CALL(TexCoord2f)( s, t );
 }
 
 static void GLAPIENTRY TAG(TexCoord2fv)( const GLfloat *tc )
 {
    PRE_LOOPBACK( TexCoord2fv );
-   _glapi_Dispatch->TexCoord2fv( tc );
+   GL_CALL(TexCoord2fv)( tc );
 }
 
 static void GLAPIENTRY TAG(TexCoord3f)( GLfloat s, GLfloat t, GLfloat r )
 {
    PRE_LOOPBACK( TexCoord3f );
-   _glapi_Dispatch->TexCoord3f( s, t, r );
+   GL_CALL(TexCoord3f)( s, t, r );
 }
 
 static void GLAPIENTRY TAG(TexCoord3fv)( const GLfloat *tc )
 {
    PRE_LOOPBACK( TexCoord3fv );
-   _glapi_Dispatch->TexCoord3fv( tc );
+   GL_CALL(TexCoord3fv)( tc );
 }
 
 static void GLAPIENTRY TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
 {
    PRE_LOOPBACK( TexCoord4f );
-   _glapi_Dispatch->TexCoord4f( s, t, r, q );
+   GL_CALL(TexCoord4f)( s, t, r, q );
 }
 
 static void GLAPIENTRY TAG(TexCoord4fv)( const GLfloat *tc )
 {
    PRE_LOOPBACK( TexCoord4fv );
-   _glapi_Dispatch->TexCoord4fv( tc );
+   GL_CALL(TexCoord4fv)( tc );
 }
 
 static void GLAPIENTRY TAG(Vertex2f)( GLfloat x, GLfloat y )
 {
    PRE_LOOPBACK( Vertex2f );
-   _glapi_Dispatch->Vertex2f( x, y );
+   GL_CALL(Vertex2f)( x, y );
 }
 
 static void GLAPIENTRY TAG(Vertex2fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Vertex2fv );
-   _glapi_Dispatch->Vertex2fv( v );
+   GL_CALL(Vertex2fv)( v );
 }
 
 static void GLAPIENTRY TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z )
 {
    PRE_LOOPBACK( Vertex3f );
-   _glapi_Dispatch->Vertex3f( x, y, z );
+   GL_CALL(Vertex3f)( x, y, z );
 }
 
 static void GLAPIENTRY TAG(Vertex3fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Vertex3fv );
-   _glapi_Dispatch->Vertex3fv( v );
+   GL_CALL(Vertex3fv)( v );
 }
 
 static void GLAPIENTRY TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
 {
    PRE_LOOPBACK( Vertex4f );
-   _glapi_Dispatch->Vertex4f( x, y, z, w );
+   GL_CALL(Vertex4f)( x, y, z, w );
 }
 
 static void GLAPIENTRY TAG(Vertex4fv)( const GLfloat *v )
 {
    PRE_LOOPBACK( Vertex4fv );
-   _glapi_Dispatch->Vertex4fv( v );
+   GL_CALL(Vertex4fv)( v );
 }
 
 static void GLAPIENTRY TAG(CallList)( GLuint i )
 {
    PRE_LOOPBACK( CallList );
-   _glapi_Dispatch->CallList( i );
+   GL_CALL(CallList)( i );
 }
 
 static void GLAPIENTRY TAG(CallLists)( GLsizei sz, GLenum type, const GLvoid *v )
 {
    PRE_LOOPBACK( CallLists );
-   _glapi_Dispatch->CallLists( sz, type, v );
+   GL_CALL(CallLists)( sz, type, v );
 }
 
 static void GLAPIENTRY TAG(Begin)( GLenum mode )
 {
    PRE_LOOPBACK( Begin );
-   _glapi_Dispatch->Begin( mode );
+   GL_CALL(Begin)( mode );
 }
 
 static void GLAPIENTRY TAG(End)( void )
 {
    PRE_LOOPBACK( End );
-   _glapi_Dispatch->End();
+   GL_CALL(End)();
 }
 
 static void GLAPIENTRY TAG(Rectf)( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
 {
    PRE_LOOPBACK( Rectf );
-   _glapi_Dispatch->Rectf( x1, y1, x2, y2 );
+   GL_CALL(Rectf)( x1, y1, x2, y2 );
 }
 
 static void GLAPIENTRY TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count )
 {
    PRE_LOOPBACK( DrawArrays );
-   _glapi_Dispatch->DrawArrays( mode, start, count );
+   GL_CALL(DrawArrays)( mode, start, count );
 }
 
 static void GLAPIENTRY TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type,
                               const GLvoid *indices )
 {
    PRE_LOOPBACK( DrawElements );
-   _glapi_Dispatch->DrawElements( mode, count, type, indices );
+   GL_CALL(DrawElements)( mode, count, type, indices );
 }
 
 static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start,
@@ -344,68 +344,68 @@ static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start,
                                    GLenum type, const GLvoid *indices )
 {
    PRE_LOOPBACK( DrawRangeElements );
-   _glapi_Dispatch->DrawRangeElements( mode, start, end, count, type, indices );
+   GL_CALL(DrawRangeElements)( mode, start, end, count, type, indices );
 }
 
 static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 )
 {
    PRE_LOOPBACK( EvalMesh1 );
-   _glapi_Dispatch->EvalMesh1( mode, i1, i2 );
+   GL_CALL(EvalMesh1)( mode, i1, i2 );
 }
 
 static void GLAPIENTRY TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2,
                            GLint j1, GLint j2 )
 {
    PRE_LOOPBACK( EvalMesh2 );
-   _glapi_Dispatch->EvalMesh2( mode, i1, i2, j1, j2 );
+   GL_CALL(EvalMesh2)( mode, i1, i2, j1, j2 );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib1fNV)( GLuint index, GLfloat x )
 {
    PRE_LOOPBACK( VertexAttrib1fNV );
-   _glapi_Dispatch->VertexAttrib1fNV( index, x );
+   GL_CALL(VertexAttrib1fNV)( index, x );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib1fvNV)( GLuint index, const GLfloat *v )
 {
    PRE_LOOPBACK( VertexAttrib1fvNV );
-   _glapi_Dispatch->VertexAttrib1fvNV( index, v );
+   GL_CALL(VertexAttrib1fvNV)( index, v );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y )
 {
    PRE_LOOPBACK( VertexAttrib2fNV );
-   _glapi_Dispatch->VertexAttrib2fNV( index, x, y );
+   GL_CALL(VertexAttrib2fNV)( index, x, y );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib2fvNV)( GLuint index, const GLfloat *v )
 {
    PRE_LOOPBACK( VertexAttrib2fvNV );
-   _glapi_Dispatch->VertexAttrib2fvNV( index, v );
+   GL_CALL(VertexAttrib2fvNV)( index, v );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z )
 {
    PRE_LOOPBACK( VertexAttrib3fNV );
-   _glapi_Dispatch->VertexAttrib3fNV( index, x, y, z );
+   GL_CALL(VertexAttrib3fNV)( index, x, y, z );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib3fvNV)( GLuint index, const GLfloat *v )
 {
    PRE_LOOPBACK( VertexAttrib3fvNV );
-   _glapi_Dispatch->VertexAttrib3fvNV( index, v );
+   GL_CALL(VertexAttrib3fvNV)( index, v );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
 {
    PRE_LOOPBACK( VertexAttrib4fNV );
-   _glapi_Dispatch->VertexAttrib4fNV( index, x, y, z, w );
+   GL_CALL(VertexAttrib4fNV)( index, x, y, z, w );
 }
 
 static void GLAPIENTRY TAG(VertexAttrib4fvNV)( GLuint index, const GLfloat *v )
 {
    PRE_LOOPBACK( VertexAttrib4fvNV );
-   _glapi_Dispatch->VertexAttrib4fvNV( index, v );
+   GL_CALL(VertexAttrib4fvNV)( index, v );
 }
 
 
index 8375c17..cc709d3 100644 (file)
@@ -52,10 +52,10 @@ static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start,
    assert(!ctx->CompileFlag);
    assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1);
 
-   _glapi_Dispatch->Begin(mode);
+   GL_CALL(Begin)(mode);
    for (i = 0; i < count; i++) 
-      _glapi_Dispatch->ArrayElement( start + i );
-   _glapi_Dispatch->End();
+       GL_CALL(ArrayElement)( start + i );
+   GL_CALL(End)();
 }
 
 
@@ -69,11 +69,11 @@ static void fallback_drawelements( GLcontext *ctx, GLenum mode, GLsizei count,
 
    /* Here, indices will already reflect the buffer object if active */
 
-   _glapi_Dispatch->Begin(mode);
+   GL_CALL(Begin)(mode);
    for (i = 0 ; i < count ; i++) {
-      _glapi_Dispatch->ArrayElement( indices[i] );
+      GL_CALL(ArrayElement)( indices[i] );
    }
-   _glapi_Dispatch->End();
+   GL_CALL(End)();
 }
 
 
index 1f332c7..c40de16 100644 (file)
@@ -1294,11 +1294,11 @@ static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfl
 {
    GET_CURRENT_CONTEXT(ctx);
    _save_NotifyBegin( ctx, GL_QUADS | PRIM_WEAK );
-   _glapi_Dispatch->Vertex2f( x1, y1 );
-   _glapi_Dispatch->Vertex2f( x2, y1 );
-   _glapi_Dispatch->Vertex2f( x2, y2 );
-   _glapi_Dispatch->Vertex2f( x1, y2 );
-   _glapi_Dispatch->End();
+   GL_CALL(Vertex2f)( x1, y1 );
+   GL_CALL(Vertex2f)( x2, y1 );
+   GL_CALL(Vertex2f)( x2, y2 );
+   GL_CALL(Vertex2f)( x1, y2 );
+   GL_CALL(End)();
 }
 
 
@@ -1312,8 +1312,8 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co
 
    _save_NotifyBegin( ctx, mode | PRIM_WEAK );
    for (i = 0; i < count; i++)
-      _glapi_Dispatch->ArrayElement(start + i);
-   _glapi_Dispatch->End();
+       GL_CALL(ArrayElement)(start + i);
+   GL_CALL(End)();
 }
 
 
@@ -1331,22 +1331,22 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
    switch (type) {
    case GL_UNSIGNED_BYTE:
       for (i = 0 ; i < count ; i++)
-        _glapi_Dispatch->ArrayElement( ((GLubyte *)indices)[i] );
+         GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] );
       break;
    case GL_UNSIGNED_SHORT:
       for (i = 0 ; i < count ; i++)
-        _glapi_Dispatch->ArrayElement( ((GLushort *)indices)[i] );
+         GL_CALL(ArrayElement)( ((GLushort *)indices)[i] );
       break;
    case GL_UNSIGNED_INT:
       for (i = 0 ; i < count ; i++)
-        _glapi_Dispatch->ArrayElement( ((GLuint *)indices)[i] );
+         GL_CALL(ArrayElement)( ((GLuint *)indices)[i] );
       break;
    default:
       _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
       break;
    }
 
-   _glapi_Dispatch->End();
+   GL_CALL(End)();
 }
 
 static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,