generated file, called src/mesa/glapi/dispatch.h, is added. This file contains three macros for each API function. It contains a GET, a SET, and a CALL. Each of the macros take a pointer to the context and a pointer to the dispatch table. In several threads on mesa3d-dev we discussed replacing _glapi_add_entrypoint with a new function called _glapi_add_dispatch. For this discussion, the important difference between the two is that the caller of _glapi_add_dispatch does *not* know what the dispatch offset will be at compile time. Because of this callers need to track the dispatch offset returned by _glapi_add_dispatch. http://marc.theaimsgroup.com/?t=111947074700001&r=1&w=2 The downside is that driver code then has to access the dispatch table two different ways. It accesses it using structure tags (e.g., exec->Begin) for functions with fixed offsets and via a remap table (e.g., exec[ remap->NewExtensionFunction ]) for functions without fixed offsets. Yuck! Using the macros allows both types of functions to be accessed identically. If a driver needs to set a pointer for Begin, it does 'SET_Begin(ctx, exec, my_begin_function)'. If it needs to set a pointer for NewExtensionFunction, it does 'SET_NewExtensionFunction(ctx, exec, my_NewExtensionFunction_function)'. Furthermore, if at some point in the future a static offset is assigned for NewExtensionFunction, only the macros need to change (instead of every single place that accesses a table for that function). This code differs slightly from the originally posted patches in that the CALL, GET, and SET marcos no longer take a context pointer as a parameter. Brian Paul had suggested that the remap table could be stored as a global since it would be set at CreateScreen time and would be constant for all contexts. This change reflects that feedback. http://marc.theaimsgroup.com/?t=112087194700001&r=1&w=2tags/mesa_6_3
@@ -146,28 +146,28 @@ static void choose_normals(void) | |||
} | |||
if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) { | |||
ctx->Exec->Normal3f = norm_tab[index].normal3f_single; | |||
ctx->Exec->Normal3fv = norm_tab[index].normal3fv_single; | |||
SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_single); | |||
SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_single); | |||
} else { | |||
ctx->Exec->Normal3f = norm_tab[index].normal3f_multi; | |||
ctx->Exec->Normal3fv = norm_tab[index].normal3fv_multi; | |||
SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_multi); | |||
SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_multi); | |||
} | |||
} else { | |||
ctx->Exec->Normal3f = _mesa_noop_Normal3f; | |||
ctx->Exec->Normal3fv = _mesa_noop_Normal3fv; | |||
SET_Normal3f(ctx->Exec, _mesa_noop_Normal3f); | |||
SET_Normal3fv(ctx->Exec, _mesa_noop_Normal3fv); | |||
} | |||
} | |||
static void ffb_choose_Normal3f(GLfloat x, GLfloat y, GLfloat z) | |||
{ | |||
choose_normals(); | |||
GL_CALL(Normal3f)(x, y, z); | |||
CALL_Normal3f(GET_DISPATCH(), (x, y, z)); | |||
} | |||
static void ffb_choose_Normal3fv(const GLfloat *v) | |||
{ | |||
choose_normals(); | |||
GL_CALL(Normal3fv)(v); | |||
CALL_Normal3fv(GET_DISPATCH(), (v)); | |||
} | |||
/* Vertex functions: */ | |||
@@ -267,13 +267,14 @@ static void ffb_do_fallback(GLcontext *ctx) | |||
* correctly: | |||
*/ | |||
if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END ) | |||
GL_CALL(Begin)(fmesa->imm.prim); | |||
CALL_Begin(GET_DISPATCH(), (fmesa->imm.prim)); | |||
if (ctx->Light.Enabled) { | |||
GL_CALL(Color4fv)(ctx->Current.Color); /* Catch ColorMaterial */ | |||
GL_CALL(Normal3fv)(current->normal); | |||
/* Catch ColorMaterial */ | |||
CALL_Color4fv(GET_DISPATCH(), (ctx->Current.Color)); | |||
CALL_Normal3fv(GET_DISPATCH(), (current->normal)); | |||
} else { | |||
GL_CALL(Color4fv)(current->color); | |||
CALL_Color4fv(GET_DISPATCH(), (current->color)); | |||
} | |||
} | |||
@@ -58,6 +58,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
#include "tnl/t_context.h" | |||
#include "tnl/t_array_api.h" | |||
#include "dispatch.h" | |||
static void r200VtxFmtFlushVertices( GLcontext *, GLuint ); | |||
static void count_func( const char *name, struct dynfn *l ) | |||
@@ -411,13 +413,13 @@ static void dispatch_multitexcoord( GLuint count, GLuint unit, GLfloat * f ) | |||
{ | |||
switch( count ) { | |||
case 3: | |||
GL_CALL(MultiTexCoord3fvARB)( GL_TEXTURE0+unit, f ); | |||
CALL_MultiTexCoord3fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f)); | |||
break; | |||
case 2: | |||
GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE0+unit, f ); | |||
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f)); | |||
break; | |||
case 1: | |||
GL_CALL(MultiTexCoord1fvARB)( GL_TEXTURE0+unit, f ); | |||
CALL_MultiTexCoord1fvARB(GET_DISPATCH(), (GL_TEXTURE0+unit, f)); | |||
break; | |||
default: | |||
assert( count == 0 ); | |||
@@ -465,7 +467,7 @@ void VFMT_FALLBACK( const char *caller ) | |||
assert(rmesa->dma.flush == 0); | |||
rmesa->vb.fell_back = GL_TRUE; | |||
rmesa->vb.installed = GL_FALSE; | |||
GL_CALL(Begin)( prim ); | |||
CALL_Begin(GET_DISPATCH(), (prim)); | |||
if (rmesa->vb.installed_color_3f_sz == 4) | |||
alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; | |||
@@ -476,30 +478,30 @@ void VFMT_FALLBACK( const char *caller ) | |||
GLuint offset = 3; | |||
if (ind0 & R200_VTX_N0) { | |||
GL_CALL(Normal3fv)( &tmp[i][offset] ); | |||
CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset += 3; | |||
} | |||
if (ind0 & R200_VTX_DISCRETE_FOG) { | |||
GL_CALL(FogCoordfvEXT)( &tmp[i][offset] ); | |||
CALL_FogCoordfvEXT(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset++; | |||
} | |||
if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) { | |||
GL_CALL(Color4ubv)( (GLubyte *)&tmp[i][offset] ); | |||
CALL_Color4ubv(GET_DISPATCH(), ((GLubyte *)&tmp[i][offset])); | |||
offset++; | |||
} | |||
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) { | |||
GL_CALL(Color4fv)( &tmp[i][offset] ); | |||
CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset+=4; | |||
} | |||
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) { | |||
GL_CALL(Color3fv)( &tmp[i][offset] ); | |||
CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset+=3; | |||
} | |||
if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) { | |||
GL_CALL(SecondaryColor3ubvEXT)( (GLubyte *)&tmp[i][offset] ); | |||
CALL_SecondaryColor3ubvEXT(GET_DISPATCH(), ((GLubyte *)&tmp[i][offset])); | |||
offset++; | |||
} | |||
@@ -509,42 +511,42 @@ void VFMT_FALLBACK( const char *caller ) | |||
offset += count; | |||
} | |||
GL_CALL(Vertex3fv)( &tmp[i][0] ); | |||
CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0])); | |||
} | |||
/* Replay current vertex | |||
*/ | |||
if (ind0 & R200_VTX_N0) | |||
GL_CALL(Normal3fv)( rmesa->vb.normalptr ); | |||
CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr)); | |||
if (ind0 & R200_VTX_DISCRETE_FOG) { | |||
GL_CALL(FogCoordfvEXT)( rmesa->vb.fogptr ); | |||
CALL_FogCoordfvEXT(GET_DISPATCH(), (rmesa->vb.fogptr)); | |||
} | |||
if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) { | |||
GL_CALL(Color4ub)( rmesa->vb.colorptr->red, | |||
rmesa->vb.colorptr->green, | |||
rmesa->vb.colorptr->blue, | |||
rmesa->vb.colorptr->alpha ); | |||
CALL_Color4ub(GET_DISPATCH(), (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) { | |||
GL_CALL(Color4fv)( rmesa->vb.floatcolorptr ); | |||
CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr)); | |||
} | |||
else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) { | |||
if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) { | |||
GL_CALL(Color4f)( rmesa->vb.floatcolorptr[0], | |||
rmesa->vb.floatcolorptr[1], | |||
rmesa->vb.floatcolorptr[2], | |||
alpha ); | |||
CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0], | |||
rmesa->vb.floatcolorptr[1], | |||
rmesa->vb.floatcolorptr[2], | |||
alpha)); | |||
} | |||
else { | |||
GL_CALL(Color3fv)( rmesa->vb.floatcolorptr ); | |||
CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr)); | |||
} | |||
} | |||
if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) | |||
GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red, | |||
rmesa->vb.specptr->green, | |||
rmesa->vb.specptr->blue ); | |||
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (rmesa->vb.specptr->red, | |||
rmesa->vb.specptr->green, | |||
rmesa->vb.specptr->blue)); | |||
for ( unit = 0 ; unit < ctx->Const.MaxTextureUnits ; unit++ ) { | |||
count = VTX_TEXn_COUNT( ind1, unit ); | |||
@@ -882,7 +884,7 @@ static void r200_Materialfv( GLenum face, GLenum pname, | |||
if (rmesa->vb.prim[0] != GL_POLYGON+1) { | |||
VFMT_FALLBACK( __FUNCTION__ ); | |||
GL_CALL(Materialfv)( face, pname, params ); | |||
CALL_Materialfv(GET_DISPATCH(), (face, pname, params)); | |||
return; | |||
} | |||
_mesa_noop_Materialfv( face, pname, params ); | |||
@@ -921,7 +923,7 @@ static void r200_Begin( GLenum mode ) | |||
r200VtxfmtValidate( ctx ); | |||
if (!rmesa->vb.installed) { | |||
GL_CALL(Begin)( mode ); | |||
CALL_Begin(GET_DISPATCH(), (mode)); | |||
return; | |||
} | |||
@@ -44,6 +44,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
#include "r200_vtxfmt.h" | |||
#include "r200_tcl.h" | |||
#include "dispatch.h" | |||
/* Fallback versions of all the entrypoints for situations where | |||
* codegen isn't available. This is still a lot faster than the | |||
* vb/pipeline implementation in Mesa. | |||
@@ -578,7 +580,7 @@ static void r200_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) | |||
break; | |||
default: | |||
VFMT_FALLBACK(__FUNCTION__); | |||
GL_CALL(MultiTexCoord2fARB)(target, s, t); | |||
CALL_MultiTexCoord2fARB(GET_DISPATCH(), (target, s, t)); | |||
return; | |||
} | |||
} | |||
@@ -599,7 +601,7 @@ static void r200_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat | |||
break; | |||
default: | |||
VFMT_FALLBACK(__FUNCTION__); | |||
GL_CALL(MultiTexCoord3fARB)(target, s, t, r); | |||
CALL_MultiTexCoord3fARB(GET_DISPATCH(), (target, s, t, r)); | |||
return; | |||
} | |||
} | |||
@@ -683,15 +685,15 @@ static void choose_##FN ARGS1 \ | |||
fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \ | |||
\ | |||
if (dfn) \ | |||
ctx->Exec->FN = (FNTYPE)(dfn->code); \ | |||
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \ | |||
else { \ | |||
if (R200_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ | |||
ctx->Exec->FN = r200_##FN; \ | |||
SET_ ## FN (ctx->Exec, r200_##FN); \ | |||
} \ | |||
\ | |||
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
} | |||
@@ -715,7 +717,7 @@ static void choose_##FN ARGS1 \ | |||
key[1] = rmesa->vb.vtxfmt_1 & MASK1; \ | |||
\ | |||
if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \ | |||
ctx->Exec->FN = r200_##FN##_ub; \ | |||
SET_ ## FN (ctx->Exec, r200_##FN##_ub); \ | |||
} \ | |||
else if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_FP_RGB) { \ | |||
\ | |||
@@ -725,15 +727,15 @@ static void choose_##FN ARGS1 \ | |||
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \ | |||
r200_copy_to_current( ctx ); \ | |||
_mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
return; \ | |||
} \ | |||
} \ | |||
\ | |||
ctx->Exec->FN = r200_##FN##_3f; \ | |||
SET_ ## FN (ctx->Exec, r200_##FN##_3f); \ | |||
} \ | |||
else { \ | |||
ctx->Exec->FN = r200_##FN##_4f; \ | |||
SET_ ## FN (ctx->Exec, r200_##FN##_4f); \ | |||
} \ | |||
\ | |||
\ | |||
@@ -743,13 +745,13 @@ static void choose_##FN ARGS1 \ | |||
if (dfn) { \ | |||
if (R200_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \ | |||
ctx->Exec->FN = (FNTYPE)dfn->code; \ | |||
SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \ | |||
} \ | |||
else if (R200_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \ | |||
\ | |||
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
} | |||
@@ -778,16 +780,16 @@ static void choose_##FN ARGS1 \ | |||
fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \ | |||
\ | |||
if (dfn) \ | |||
ctx->Exec->FN = (FNTYPE)(dfn->code); \ | |||
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \ | |||
else { \ | |||
if (R200_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ | |||
ctx->Exec->FN = (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \ | |||
? r200_##FN##_ub : r200_##FN##_3f; \ | |||
SET_ ## FN (ctx->Exec, (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \ | |||
? r200_##FN##_ub : r200_##FN##_3f); \ | |||
} \ | |||
\ | |||
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
} | |||
@@ -57,6 +57,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
#include "radeon_swtcl.h" | |||
#include "radeon_vtxfmt.h" | |||
#include "dispatch.h" | |||
static void radeonVtxfmtFlushVertices( GLcontext *, GLuint ); | |||
static void count_func( const char *name, struct dynfn *l ) | |||
@@ -387,7 +389,7 @@ static void VFMT_FALLBACK( const char *caller ) | |||
assert(rmesa->dma.flush == 0); | |||
rmesa->vb.fell_back = GL_TRUE; | |||
rmesa->vb.installed = GL_FALSE; | |||
GL_CALL(Begin)( prim ); | |||
CALL_Begin(GET_DISPATCH(), (prim)); | |||
if (rmesa->vb.installed_color_3f_sz == 4) | |||
alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; | |||
@@ -397,69 +399,69 @@ static void VFMT_FALLBACK( const char *caller ) | |||
for (i = 0 ; i < nrverts; i++) { | |||
GLuint offset = 3; | |||
if (ind & RADEON_CP_VC_FRMT_N0) { | |||
GL_CALL(Normal3fv)( &tmp[i][offset] ); | |||
CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset += 3; | |||
} | |||
if (ind & RADEON_CP_VC_FRMT_PKCOLOR) { | |||
radeon_color_t *col = (radeon_color_t *)&tmp[i][offset]; | |||
GL_CALL(Color4ub)( col->red, col->green, col->blue, col->alpha ); | |||
CALL_Color4ub(GET_DISPATCH(), (col->red, col->green, col->blue, col->alpha)); | |||
offset++; | |||
} | |||
else if (ind & RADEON_CP_VC_FRMT_FPALPHA) { | |||
GL_CALL(Color4fv)( &tmp[i][offset] ); | |||
CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset+=4; | |||
} | |||
else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) { | |||
GL_CALL(Color3fv)( &tmp[i][offset] ); | |||
CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset+=3; | |||
} | |||
if (ind & RADEON_CP_VC_FRMT_PKSPEC) { | |||
radeon_color_t *spec = (radeon_color_t *)&tmp[i][offset]; | |||
GL_CALL(SecondaryColor3ubEXT)( spec->red, spec->green, spec->blue ); | |||
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (spec->red, spec->green, spec->blue)); | |||
offset++; | |||
} | |||
if (ind & RADEON_CP_VC_FRMT_ST0) { | |||
GL_CALL(TexCoord2fv)( &tmp[i][offset] ); | |||
CALL_TexCoord2fv(GET_DISPATCH(), (&tmp[i][offset])); | |||
offset += 2; | |||
} | |||
if (ind & RADEON_CP_VC_FRMT_ST1) { | |||
GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE1_ARB, &tmp[i][offset] ); | |||
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE1_ARB, &tmp[i][offset])); | |||
offset += 2; | |||
} | |||
GL_CALL(Vertex3fv)( &tmp[i][0] ); | |||
CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0])); | |||
} | |||
/* Replay current vertex | |||
*/ | |||
if (ind & RADEON_CP_VC_FRMT_N0) | |||
GL_CALL(Normal3fv)( rmesa->vb.normalptr ); | |||
CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr)); | |||
if (ind & RADEON_CP_VC_FRMT_PKCOLOR) | |||
GL_CALL(Color4ub)( rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha ); | |||
CALL_Color4ub(GET_DISPATCH(), (rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha)); | |||
else if (ind & RADEON_CP_VC_FRMT_FPALPHA) | |||
GL_CALL(Color4fv)( rmesa->vb.floatcolorptr ); | |||
CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr)); | |||
else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) { | |||
if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) | |||
GL_CALL(Color4f)( rmesa->vb.floatcolorptr[0], | |||
rmesa->vb.floatcolorptr[1], | |||
rmesa->vb.floatcolorptr[2], | |||
alpha ); | |||
CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0], | |||
rmesa->vb.floatcolorptr[1], | |||
rmesa->vb.floatcolorptr[2], | |||
alpha)); | |||
else | |||
GL_CALL(Color3fv)( rmesa->vb.floatcolorptr ); | |||
CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr)); | |||
} | |||
if (ind & RADEON_CP_VC_FRMT_PKSPEC) | |||
GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue ); | |||
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue)); | |||
if (ind & RADEON_CP_VC_FRMT_ST0) | |||
GL_CALL(TexCoord2fv)( rmesa->vb.texcoordptr[0] ); | |||
CALL_TexCoord2fv(GET_DISPATCH(), (rmesa->vb.texcoordptr[0])); | |||
if (ind & RADEON_CP_VC_FRMT_ST1) | |||
GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1] ); | |||
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), (GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1])); | |||
} | |||
@@ -758,7 +760,7 @@ static void radeon_Materialfv( GLenum face, GLenum pname, | |||
if (rmesa->vb.prim[0] != GL_POLYGON+1) { | |||
VFMT_FALLBACK( __FUNCTION__ ); | |||
GL_CALL(Materialfv)( face, pname, params ); | |||
CALL_Materialfv(GET_DISPATCH(), (face, pname, params)); | |||
return; | |||
} | |||
_mesa_noop_Materialfv( face, pname, params ); | |||
@@ -797,7 +799,7 @@ static void radeon_Begin( GLenum mode ) | |||
radeonVtxfmtValidate( ctx ); | |||
if (!rmesa->vb.installed) { | |||
GL_CALL(Begin)( mode ); | |||
CALL_Begin(GET_DISPATCH(), (mode)); | |||
return; | |||
} | |||
@@ -41,6 +41,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
#include "radeon_vtxfmt.h" | |||
#include "dispatch.h" | |||
/* Fallback versions of all the entrypoints for situations where | |||
* codegen isn't available. This is still a lot faster than the | |||
* vb/pipeline implementation in Mesa. | |||
@@ -623,15 +625,15 @@ static void choose_##FN ARGS1 \ | |||
fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \ | |||
\ | |||
if (dfn) \ | |||
ctx->Exec->FN = (FNTYPE)(dfn->code); \ | |||
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \ | |||
else { \ | |||
if (RADEON_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ | |||
ctx->Exec->FN = radeon_##FN; \ | |||
SET_ ## FN (ctx->Exec, radeon_##FN); \ | |||
} \ | |||
\ | |||
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
} | |||
@@ -652,7 +654,7 @@ static void choose_##FN ARGS1 \ | |||
struct dynfn *dfn; \ | |||
\ | |||
if (rmesa->vb.vertex_format & ACTIVE_PKCOLOR) { \ | |||
ctx->Exec->FN = radeon_##FN##_ub; \ | |||
SET_ ## FN (ctx->Exec, radeon_##FN##_ub); \ | |||
} \ | |||
else if ((rmesa->vb.vertex_format & \ | |||
(ACTIVE_FPCOLOR|ACTIVE_FPALPHA)) == ACTIVE_FPCOLOR) { \ | |||
@@ -663,15 +665,15 @@ static void choose_##FN ARGS1 \ | |||
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \ | |||
radeon_copy_to_current( ctx ); \ | |||
_mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
return; \ | |||
} \ | |||
} \ | |||
\ | |||
ctx->Exec->FN = radeon_##FN##_3f; \ | |||
SET_ ## FN (ctx->Exec, radeon_##FN##_3f); \ | |||
} \ | |||
else { \ | |||
ctx->Exec->FN = radeon_##FN##_4f; \ | |||
SET_ ## FN (ctx->Exec, radeon_##FN##_4f); \ | |||
} \ | |||
\ | |||
\ | |||
@@ -681,13 +683,13 @@ static void choose_##FN ARGS1 \ | |||
if (dfn) { \ | |||
if (RADEON_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \ | |||
ctx->Exec->FN = (FNTYPE)dfn->code; \ | |||
SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \ | |||
} \ | |||
else if (RADEON_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \ | |||
\ | |||
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
} | |||
@@ -712,16 +714,16 @@ static void choose_##FN ARGS1 \ | |||
fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \ | |||
\ | |||
if (dfn) \ | |||
ctx->Exec->FN = (FNTYPE)(dfn->code); \ | |||
SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \ | |||
else { \ | |||
if (RADEON_DEBUG & DEBUG_CODEGEN) \ | |||
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ | |||
ctx->Exec->FN = ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \ | |||
? radeon_##FN##_ub : radeon_##FN##_3f; \ | |||
SET_ ## FN (ctx->Exec, ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \ | |||
? radeon_##FN##_ub : radeon_##FN##_3f); \ | |||
} \ | |||
\ | |||
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ | |||
ctx->Exec->FN ARGS2; \ | |||
CALL_ ## FN (ctx->Exec, ARGS2); \ | |||
} | |||
@@ -7,7 +7,7 @@ | |||
TOP = ../../.. | |||
include $(TOP)/configs/current | |||
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h \ | |||
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \ | |||
../main/enums.c \ | |||
../x86/glapi_x86.S \ | |||
../drivers/dri/common/extension_helper.h \ | |||
@@ -34,6 +34,9 @@ glapioffsets.h: $(COMMON) gl_offsets.py | |||
glapitable.h: $(COMMON) gl_table.py | |||
$(PYTHON2) $(PYTHON_FLAGS) gl_table.py > glapitable.h | |||
dispatch.h: $(COMMON) gl_table.py | |||
$(PYTHON2) $(PYTHON_FLAGS) gl_table.py -m remap_table > dispatch.h | |||
../main/enums.c: $(COMMON) gl_enums.py | |||
$(PYTHON2) $(PYTHON_FLAGS) gl_enums.py > ../main/enums.c | |||
@@ -62,23 +62,110 @@ class PrintGlTable(gl_XML.gl_print_base): | |||
return | |||
class PrintRemapTable(gl_XML.gl_print_base): | |||
def __init__(self): | |||
gl_XML.gl_print_base.__init__(self) | |||
self.header_tag = '_DISPATCH_H_' | |||
self.name = "gl_table.py (from Mesa)" | |||
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") | |||
return | |||
def printRealHeader(self): | |||
print """/** | |||
* \\file dispatch.h | |||
* Macros for handling GL dispatch tables. | |||
* | |||
* For each known GL function, there are 3 macros in this file. The first | |||
* macro is named CALL_FuncName and is used to call that GL function using | |||
* the specified dispatch table. The other 2 macros, called GET_FuncName | |||
* can SET_FuncName, are used to get and set the dispatch pointer for the | |||
* named function in the specified dispatch table. | |||
*/ | |||
""" | |||
return | |||
def printBody(self, api): | |||
print '#define CALL_by_offset(disp, cast, offset, parameters) \\' | |||
print ' (*(cast (((_glapi_proc *)(disp))[offset]))) parameters' | |||
print '#define GET_by_offset(disp, offset) \\' | |||
print ' (((_glapi_proc *)(disp))[offset])' | |||
print '#define SET_by_offset(disp, offset, fn) \\' | |||
print ' ((((_glapi_proc *)(disp))[offset]) = fn)' | |||
print '' | |||
for f in api.functionIterateByOffset(): | |||
print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) | |||
print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) | |||
print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) | |||
return | |||
abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] | |||
functions = [] | |||
abi_functions = [] | |||
count = 0 | |||
for f in api.functionIterateByOffset(): | |||
[category, num] = api.get_category_for_name( f.name ) | |||
if category not in abi: | |||
functions.append( [f, count] ) | |||
count += 1 | |||
else: | |||
abi_functions.append( f ) | |||
print 'struct _mesa_dispatch_remap_table {' | |||
for [f, index] in functions: | |||
print ' unsigned %s;' % (f.name) | |||
print '};' | |||
print '' | |||
print '/* %u functions need remapping. */' % (count) | |||
print '' | |||
for f in abi_functions: | |||
print '#define CALL_%s(disp, parameters) (*disp->%s) parameters' % (f.name, f.name) | |||
for [f, index] in functions: | |||
arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) | |||
cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) | |||
print '#define CALL_%s(disp, parameters) (* (%s) (((_glapi_proc *)disp)[dispatch_remap.%s])) parameters' % (f.name, cast, f.name) | |||
return | |||
def show_usage(): | |||
print "Usage: %s [-f input_file_name]" % sys.argv[0] | |||
print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] | |||
print " -m mode Mode can be 'table' or 'remap_table'." | |||
sys.exit(1) | |||
if __name__ == '__main__': | |||
file_name = "gl_API.xml" | |||
try: | |||
(args, trail) = getopt.getopt(sys.argv[1:], "f:") | |||
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:") | |||
except Exception,e: | |||
show_usage() | |||
mode = "table" | |||
for (arg,val) in args: | |||
if arg == "-f": | |||
file_name = val | |||
elif arg == "-m": | |||
mode = val | |||
if mode == "table": | |||
printer = PrintGlTable() | |||
elif mode == "remap_table": | |||
printer = PrintRemapTable() | |||
else: | |||
show_usage() | |||
api = gl_XML.parse_GL_API( file_name ) | |||
printer = PrintGlTable() | |||
printer.Print( api ) |
@@ -119,9 +119,9 @@ typedef pthread_mutex_t _glthread_Mutex; | |||
extern struct _glapi_table * _glapi_DispatchTSD; | |||
extern _glthread_TSD _gl_DispatchTSD; | |||
#define GL_CALL(name) \ | |||
(((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \ | |||
? _glapi_DispatchTSD : (struct _glapi_table *) pthread_getspecific(_gl_DispatchTSD.key))-> name) | |||
#define GET_DISPATCH() \ | |||
((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \ | |||
? _glapi_DispatchTSD : (struct _glapi_table *) pthread_getspecific(_gl_DispatchTSD.key)) | |||
#endif | |||
#endif /* PTHREADS */ | |||
@@ -312,16 +312,16 @@ _glthread_SetTSD(_glthread_TSD *, void *); | |||
extern __thread struct _glapi_table * _glapi_tls_Dispatch | |||
__attribute__((tls_model("initial-exec"))); | |||
# define GL_CALL(name) (*(_glapi_tls_Dispatch-> name)) | |||
#define GET_DISPATCH() _glapi_tls_Dispatch | |||
#elif !defined(GL_CALL) | |||
# if defined(THREADS) | |||
extern struct _glapi_table * _glapi_DispatchTSD; | |||
# define GL_CALL(name) \ | |||
(((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \ | |||
? _glapi_DispatchTSD : _glapi_get_dispatch())-> name) | |||
# define GET_DISPATCH() \ | |||
((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \ | |||
? _glapi_DispatchTSD : _glapi_get_dispatch()) | |||
# else | |||
# define GL_CALL(name) (*(_glapi_Dispatch-> name)) | |||
# define GET_DISPATCH() _glapi_Dispatch | |||
# endif /* defined(THREADS) */ | |||
#endif /* ndef GL_CALL */ | |||
@@ -33,12 +33,14 @@ | |||
#include "imports.h" | |||
#include "macros.h" | |||
#include "mtypes.h" | |||
#include "glapioffsets.h" | |||
#include "dispatch.h" | |||
typedef void (GLAPIENTRY *array_func)( const void * ); | |||
typedef struct { | |||
const struct gl_client_array *array; | |||
array_func func; | |||
int offset; | |||
} AEarray; | |||
typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); | |||
@@ -57,6 +59,7 @@ typedef struct { | |||
#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) | |||
/* | |||
* Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer | |||
* in the range [0, 7]. Luckily these type tokens are sequentially | |||
@@ -64,347 +67,104 @@ typedef struct { | |||
*/ | |||
#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) | |||
static void GLAPIENTRY Color3bv(const GLbyte *v) | |||
{ | |||
GL_CALL(Color3bv)(v); | |||
} | |||
static void GLAPIENTRY Color3ubv(const GLubyte *v) | |||
{ | |||
GL_CALL(Color3ubv)(v); | |||
} | |||
static void GLAPIENTRY Color3sv(const GLshort *v) | |||
{ | |||
GL_CALL(Color3sv)(v); | |||
} | |||
static void GLAPIENTRY Color3usv(const GLushort *v) | |||
{ | |||
GL_CALL(Color3usv)(v); | |||
} | |||
static void GLAPIENTRY Color3iv(const GLint *v) | |||
{ | |||
GL_CALL(Color3iv)(v); | |||
} | |||
static void GLAPIENTRY Color3uiv(const GLuint *v) | |||
{ | |||
GL_CALL(Color3uiv)(v); | |||
} | |||
static void GLAPIENTRY Color3fv(const GLfloat *v) | |||
{ | |||
GL_CALL(Color3fv)(v); | |||
} | |||
static void GLAPIENTRY Color3dv(const GLdouble *v) | |||
{ | |||
GL_CALL(Color3dv)(v); | |||
} | |||
static void GLAPIENTRY Color4bv(const GLbyte *v) | |||
{ | |||
GL_CALL(Color4bv)(v); | |||
} | |||
static void GLAPIENTRY Color4ubv(const GLubyte *v) | |||
{ | |||
GL_CALL(Color4ubv)(v); | |||
} | |||
static void GLAPIENTRY Color4sv(const GLshort *v) | |||
{ | |||
GL_CALL(Color4sv)(v); | |||
} | |||
static void GLAPIENTRY Color4usv(const GLushort *v) | |||
{ | |||
GL_CALL(Color4usv)(v); | |||
} | |||
static void GLAPIENTRY Color4iv(const GLint *v) | |||
{ | |||
GL_CALL(Color4iv)(v); | |||
} | |||
static void GLAPIENTRY Color4uiv(const GLuint *v) | |||
{ | |||
GL_CALL(Color4uiv)(v); | |||
} | |||
static void GLAPIENTRY Color4fv(const GLfloat *v) | |||
{ | |||
GL_CALL(Color4fv)(v); | |||
} | |||
static void GLAPIENTRY Color4dv(const GLdouble *v) | |||
{ | |||
GL_CALL(Color4dv)(v); | |||
} | |||
static const array_func ColorFuncs[2][8] = { | |||
static const int ColorFuncs[2][8] = { | |||
{ | |||
(array_func) Color3bv, | |||
(array_func) Color3ubv, | |||
(array_func) Color3sv, | |||
(array_func) Color3usv, | |||
(array_func) Color3iv, | |||
(array_func) Color3uiv, | |||
(array_func) Color3fv, | |||
(array_func) Color3dv, | |||
_gloffset_Color3bv, | |||
_gloffset_Color3ubv, | |||
_gloffset_Color3sv, | |||
_gloffset_Color3usv, | |||
_gloffset_Color3iv, | |||
_gloffset_Color3uiv, | |||
_gloffset_Color3fv, | |||
_gloffset_Color3dv, | |||
}, | |||
{ | |||
(array_func) Color4bv, | |||
(array_func) Color4ubv, | |||
(array_func) Color4sv, | |||
(array_func) Color4usv, | |||
(array_func) Color4iv, | |||
(array_func) Color4uiv, | |||
(array_func) Color4fv, | |||
(array_func) Color4dv, | |||
_gloffset_Color4bv, | |||
_gloffset_Color4ubv, | |||
_gloffset_Color4sv, | |||
_gloffset_Color4usv, | |||
_gloffset_Color4iv, | |||
_gloffset_Color4uiv, | |||
_gloffset_Color4fv, | |||
_gloffset_Color4dv, | |||
}, | |||
}; | |||
static void GLAPIENTRY Vertex2sv(const GLshort *v) | |||
{ | |||
GL_CALL(Vertex2sv)(v); | |||
} | |||
static void GLAPIENTRY Vertex2iv(const GLint *v) | |||
{ | |||
GL_CALL(Vertex2iv)(v); | |||
} | |||
static void GLAPIENTRY Vertex2fv(const GLfloat *v) | |||
{ | |||
GL_CALL(Vertex2fv)(v); | |||
} | |||
static void GLAPIENTRY Vertex2dv(const GLdouble *v) | |||
{ | |||
GL_CALL(Vertex2dv)(v); | |||
} | |||
static void GLAPIENTRY Vertex3sv(const GLshort *v) | |||
{ | |||
GL_CALL(Vertex3sv)(v); | |||
} | |||
static void GLAPIENTRY Vertex3iv(const GLint *v) | |||
{ | |||
GL_CALL(Vertex3iv)(v); | |||
} | |||
static void GLAPIENTRY Vertex3fv(const GLfloat *v) | |||
{ | |||
GL_CALL(Vertex3fv)(v); | |||
} | |||
static void GLAPIENTRY Vertex3dv(const GLdouble *v) | |||
{ | |||
GL_CALL(Vertex3dv)(v); | |||
} | |||
static void GLAPIENTRY Vertex4sv(const GLshort *v) | |||
{ | |||
GL_CALL(Vertex4sv)(v); | |||
} | |||
static void GLAPIENTRY Vertex4iv(const GLint *v) | |||
{ | |||
GL_CALL(Vertex4iv)(v); | |||
} | |||
static void GLAPIENTRY Vertex4fv(const GLfloat *v) | |||
{ | |||
GL_CALL(Vertex4fv)(v); | |||
} | |||
static void GLAPIENTRY Vertex4dv(const GLdouble *v) | |||
{ | |||
GL_CALL(Vertex4dv)(v); | |||
} | |||
static const array_func VertexFuncs[3][8] = { | |||
static const int VertexFuncs[3][8] = { | |||
{ | |||
NULL, | |||
NULL, | |||
(array_func) Vertex2sv, | |||
NULL, | |||
(array_func) Vertex2iv, | |||
NULL, | |||
(array_func) Vertex2fv, | |||
(array_func) Vertex2dv, | |||
-1, | |||
-1, | |||
_gloffset_Vertex2sv, | |||
-1, | |||
_gloffset_Vertex2iv, | |||
-1, | |||
_gloffset_Vertex2fv, | |||
_gloffset_Vertex2dv, | |||
}, | |||
{ | |||
NULL, | |||
NULL, | |||
(array_func) Vertex3sv, | |||
NULL, | |||
(array_func) Vertex3iv, | |||
NULL, | |||
(array_func) Vertex3fv, | |||
(array_func) Vertex3dv, | |||
-1, | |||
-1, | |||
_gloffset_Vertex3sv, | |||
-1, | |||
_gloffset_Vertex3iv, | |||
-1, | |||
_gloffset_Vertex3fv, | |||
_gloffset_Vertex3dv, | |||
}, | |||
{ | |||
NULL, | |||
NULL, | |||
(array_func) Vertex4sv, | |||
NULL, | |||
(array_func) Vertex4iv, | |||
NULL, | |||
(array_func) Vertex4fv, | |||
(array_func) Vertex4dv, | |||
-1, | |||
-1, | |||
_gloffset_Vertex4sv, | |||
-1, | |||
_gloffset_Vertex4iv, | |||
-1, | |||
_gloffset_Vertex4fv, | |||
_gloffset_Vertex4dv, | |||
}, | |||
}; | |||
static void GLAPIENTRY Indexubv(const GLubyte *c) | |||
{ | |||
GL_CALL(Indexubv)(c); | |||
} | |||
static void GLAPIENTRY Indexsv(const GLshort *c) | |||
{ | |||
GL_CALL(Indexsv)(c); | |||
} | |||
static void GLAPIENTRY Indexiv(const GLint *c) | |||
{ | |||
GL_CALL(Indexiv)(c); | |||
} | |||
static void GLAPIENTRY Indexfv(const GLfloat *c) | |||
{ | |||
GL_CALL(Indexfv)(c); | |||
} | |||
static void GLAPIENTRY Indexdv(const GLdouble *c) | |||
{ | |||
GL_CALL(Indexdv)(c); | |||
} | |||
static const array_func IndexFuncs[8] = { | |||
NULL, | |||
(array_func) Indexubv, | |||
(array_func) Indexsv, | |||
NULL, | |||
(array_func) Indexiv, | |||
NULL, | |||
(array_func) Indexfv, | |||
(array_func) Indexdv, | |||
static const int IndexFuncs[8] = { | |||
-1, | |||
_gloffset_Indexubv, | |||
_gloffset_Indexsv, | |||
-1, | |||
_gloffset_Indexiv, | |||
-1, | |||
_gloffset_Indexfv, | |||
_gloffset_Indexdv, | |||
}; | |||
static void GLAPIENTRY Normal3bv(const GLbyte *v) | |||
{ | |||
GL_CALL(Normal3bv)(v); | |||
} | |||
static void GLAPIENTRY Normal3sv(const GLshort *v) | |||
{ | |||
GL_CALL(Normal3sv)(v); | |||
} | |||
static void GLAPIENTRY Normal3iv(const GLint *v) | |||
{ | |||
GL_CALL(Normal3iv)(v); | |||
} | |||
static void GLAPIENTRY Normal3fv(const GLfloat *v) | |||
{ | |||
GL_CALL(Normal3fv)(v); | |||
} | |||
static void GLAPIENTRY Normal3dv(const GLdouble *v) | |||
{ | |||
GL_CALL(Normal3dv)(v); | |||
} | |||
static const array_func NormalFuncs[8] = { | |||
(array_func) Normal3bv, | |||
NULL, | |||
(array_func) Normal3sv, | |||
NULL, | |||
(array_func) Normal3iv, | |||
NULL, | |||
(array_func) Normal3fv, | |||
(array_func) Normal3dv, | |||
static const int NormalFuncs[8] = { | |||
_gloffset_Normal3bv, | |||
-1, | |||
_gloffset_Normal3sv, | |||
-1, | |||
_gloffset_Normal3iv, | |||
-1, | |||
_gloffset_Normal3fv, | |||
_gloffset_Normal3dv, | |||
}; | |||
/* Wrapper functions in case glSecondaryColor*EXT doesn't exist */ | |||
static void GLAPIENTRY SecondaryColor3bvEXT(const GLbyte *c) | |||
{ | |||
GL_CALL(SecondaryColor3bvEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3ubvEXT(const GLubyte *c) | |||
{ | |||
GL_CALL(SecondaryColor3ubvEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3svEXT(const GLshort *c) | |||
{ | |||
GL_CALL(SecondaryColor3svEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3usvEXT(const GLushort *c) | |||
{ | |||
GL_CALL(SecondaryColor3usvEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3ivEXT(const GLint *c) | |||
{ | |||
GL_CALL(SecondaryColor3ivEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3uivEXT(const GLuint *c) | |||
{ | |||
GL_CALL(SecondaryColor3uivEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3fvEXT(const GLfloat *c) | |||
{ | |||
GL_CALL(SecondaryColor3fvEXT)(c); | |||
} | |||
static void GLAPIENTRY SecondaryColor3dvEXT(const GLdouble *c) | |||
{ | |||
GL_CALL(SecondaryColor3dvEXT)(c); | |||
} | |||
static const array_func SecondaryColorFuncs[8] = { | |||
(array_func) SecondaryColor3bvEXT, | |||
(array_func) SecondaryColor3ubvEXT, | |||
(array_func) SecondaryColor3svEXT, | |||
(array_func) SecondaryColor3usvEXT, | |||
(array_func) SecondaryColor3ivEXT, | |||
(array_func) SecondaryColor3uivEXT, | |||
(array_func) SecondaryColor3fvEXT, | |||
(array_func) SecondaryColor3dvEXT, | |||
static const int SecondaryColorFuncs[8] = { | |||
_gloffset_SecondaryColor3bvEXT, | |||
_gloffset_SecondaryColor3ubvEXT, | |||
_gloffset_SecondaryColor3svEXT, | |||
_gloffset_SecondaryColor3usvEXT, | |||
_gloffset_SecondaryColor3ivEXT, | |||
_gloffset_SecondaryColor3uivEXT, | |||
_gloffset_SecondaryColor3fvEXT, | |||
_gloffset_SecondaryColor3dvEXT, | |||
}; | |||
/* Again, wrapper functions in case glSecondaryColor*EXT doesn't exist */ | |||
static void GLAPIENTRY FogCoordfvEXT(const GLfloat *f) | |||
{ | |||
GL_CALL(FogCoordfvEXT)(f); | |||
} | |||
static void GLAPIENTRY FogCoorddvEXT(const GLdouble *f) | |||
{ | |||
GL_CALL(FogCoorddvEXT)(f); | |||
} | |||
static const array_func FogCoordFuncs[8] = { | |||
NULL, | |||
NULL, | |||
NULL, | |||
NULL, | |||
NULL, | |||
NULL, | |||
(array_func) FogCoordfvEXT, | |||
(array_func) FogCoorddvEXT | |||
static const int FogCoordFuncs[8] = { | |||
-1, | |||
-1, | |||
-1, | |||
-1, | |||
-1, | |||
-1, | |||
_gloffset_FogCoordfvEXT, | |||
_gloffset_FogCoorddvEXT | |||
}; | |||
/**********************************************************************/ | |||
@@ -413,330 +173,330 @@ static const array_func FogCoordFuncs[8] = { | |||
static void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, BYTE_TO_FLOAT(v[0])); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, v[0]); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); | |||
} | |||
static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); | |||
} | |||
static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, BYTE_TO_FLOAT(v[0]), | |||
BYTE_TO_FLOAT(v[1]), | |||
BYTE_TO_FLOAT(v[2])); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), | |||
BYTE_TO_FLOAT(v[1]), | |||
BYTE_TO_FLOAT(v[2]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); | |||
} | |||
static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, BYTE_TO_FLOAT(v[0]), | |||
BYTE_TO_FLOAT(v[1]), | |||
BYTE_TO_FLOAT(v[2]), | |||
BYTE_TO_FLOAT(v[3])); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), | |||
BYTE_TO_FLOAT(v[1]), | |||
BYTE_TO_FLOAT(v[2]), | |||
BYTE_TO_FLOAT(v[3]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); | |||
} | |||
/* GL_UNSIGNED_BYTE attributes */ | |||
static void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, UBYTE_TO_FLOAT(v[0])); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, v[0]); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); | |||
} | |||
static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, UBYTE_TO_FLOAT(v[0]), | |||
UBYTE_TO_FLOAT(v[1])); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), | |||
UBYTE_TO_FLOAT(v[1]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); | |||
} | |||
static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, UBYTE_TO_FLOAT(v[0]), | |||
UBYTE_TO_FLOAT(v[1]), | |||
UBYTE_TO_FLOAT(v[2])); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), | |||
UBYTE_TO_FLOAT(v[1]), | |||
UBYTE_TO_FLOAT(v[2]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); | |||
} | |||
static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, UBYTE_TO_FLOAT(v[0]), | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), | |||
UBYTE_TO_FLOAT(v[1]), | |||
UBYTE_TO_FLOAT(v[2]), | |||
UBYTE_TO_FLOAT(v[3])); | |||
UBYTE_TO_FLOAT(v[3]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); | |||
} | |||
/* GL_SHORT attributes */ | |||
static void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, SHORT_TO_FLOAT(v[0])); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, v[0]); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); | |||
} | |||
static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, SHORT_TO_FLOAT(v[0]), | |||
SHORT_TO_FLOAT(v[1])); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), | |||
SHORT_TO_FLOAT(v[1]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); | |||
} | |||
static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, SHORT_TO_FLOAT(v[0]), | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), | |||
SHORT_TO_FLOAT(v[1]), | |||
SHORT_TO_FLOAT(v[2])); | |||
SHORT_TO_FLOAT(v[2]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); | |||
} | |||
static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, SHORT_TO_FLOAT(v[0]), | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), | |||
SHORT_TO_FLOAT(v[1]), | |||
SHORT_TO_FLOAT(v[2]), | |||
SHORT_TO_FLOAT(v[3])); | |||
SHORT_TO_FLOAT(v[3]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); | |||
} | |||
/* GL_UNSIGNED_SHORT attributes */ | |||
static void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, USHORT_TO_FLOAT(v[0])); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, v[0]); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); | |||
} | |||
static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, USHORT_TO_FLOAT(v[0]), | |||
USHORT_TO_FLOAT(v[1])); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), | |||
USHORT_TO_FLOAT(v[1]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); | |||
} | |||
static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, USHORT_TO_FLOAT(v[0]), | |||
USHORT_TO_FLOAT(v[1]), | |||
USHORT_TO_FLOAT(v[2])); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), | |||
USHORT_TO_FLOAT(v[1]), | |||
USHORT_TO_FLOAT(v[2]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); | |||
} | |||
static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, USHORT_TO_FLOAT(v[0]), | |||
USHORT_TO_FLOAT(v[1]), | |||
USHORT_TO_FLOAT(v[2]), | |||
USHORT_TO_FLOAT(v[3])); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), | |||
USHORT_TO_FLOAT(v[1]), | |||
USHORT_TO_FLOAT(v[2]), | |||
USHORT_TO_FLOAT(v[3]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); | |||
} | |||
/* GL_INT attributes */ | |||
static void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, INT_TO_FLOAT(v[0])); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, v[0]); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); | |||
} | |||
static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, INT_TO_FLOAT(v[0]), | |||
INT_TO_FLOAT(v[1])); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), | |||
INT_TO_FLOAT(v[1]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); | |||
} | |||
static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, INT_TO_FLOAT(v[0]), | |||
INT_TO_FLOAT(v[1]), | |||
INT_TO_FLOAT(v[2])); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), | |||
INT_TO_FLOAT(v[1]), | |||
INT_TO_FLOAT(v[2]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); | |||
} | |||
static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, INT_TO_FLOAT(v[0]), | |||
INT_TO_FLOAT(v[1]), | |||
INT_TO_FLOAT(v[2]), | |||
INT_TO_FLOAT(v[3])); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), | |||
INT_TO_FLOAT(v[1]), | |||
INT_TO_FLOAT(v[2]), | |||
INT_TO_FLOAT(v[3]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); | |||
} | |||
/* GL_UNSIGNED_INT attributes */ | |||
static void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, UINT_TO_FLOAT(v[0])); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib1fNV)(index, v[0]); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); | |||
} | |||
static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, UINT_TO_FLOAT(v[0]), | |||
UINT_TO_FLOAT(v[1])); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), | |||
UINT_TO_FLOAT(v[1]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); | |||
} | |||
static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, UINT_TO_FLOAT(v[0]), | |||
UINT_TO_FLOAT(v[1]), | |||
UINT_TO_FLOAT(v[2])); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), | |||
UINT_TO_FLOAT(v[1]), | |||
UINT_TO_FLOAT(v[2]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); | |||
} | |||
static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, UINT_TO_FLOAT(v[0]), | |||
UINT_TO_FLOAT(v[1]), | |||
UINT_TO_FLOAT(v[2]), | |||
UINT_TO_FLOAT(v[3])); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), | |||
UINT_TO_FLOAT(v[1]), | |||
UINT_TO_FLOAT(v[2]), | |||
UINT_TO_FLOAT(v[3]))); | |||
} | |||
static void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v) | |||
{ | |||
GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); | |||
} | |||
/* GL_FLOAT attributes */ | |||
static void GLAPIENTRY VertexAttrib1fvNV(GLuint index, const GLfloat *v) | |||
{ | |||
GL_CALL(VertexAttrib1fvNV)(index, v); | |||
CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
static void GLAPIENTRY VertexAttrib2fvNV(GLuint index, const GLfloat *v) | |||
{ | |||
GL_CALL(VertexAttrib2fvNV)(index, v); | |||
CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
static void GLAPIENTRY VertexAttrib3fvNV(GLuint index, const GLfloat *v) | |||
{ | |||
GL_CALL(VertexAttrib3fvNV)(index, v); | |||
CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
static void GLAPIENTRY VertexAttrib4fvNV(GLuint index, const GLfloat *v) | |||
{ | |||
GL_CALL(VertexAttrib4fvNV)(index, v); | |||
CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
/* GL_DOUBLE attributes */ | |||
static void GLAPIENTRY VertexAttrib1dvNV(GLuint index, const GLdouble *v) | |||
{ | |||
GL_CALL(VertexAttrib1dvNV)(index, v); | |||
CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
static void GLAPIENTRY VertexAttrib2dvNV(GLuint index, const GLdouble *v) | |||
{ | |||
GL_CALL(VertexAttrib2dvNV)(index, v); | |||
CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
static void GLAPIENTRY VertexAttrib3dvNV(GLuint index, const GLdouble *v) | |||
{ | |||
GL_CALL(VertexAttrib3dvNV)(index, v); | |||
CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
static void GLAPIENTRY VertexAttrib4dvNV(GLuint index, const GLdouble *v) | |||
{ | |||
GL_CALL(VertexAttrib4dvNV)(index, v); | |||
CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v)); | |||
} | |||
@@ -840,11 +600,6 @@ static attrib_func AttribFuncsNV[2][4][8] = { | |||
} | |||
}; | |||
static void GLAPIENTRY EdgeFlagv(const GLboolean *flag) | |||
{ | |||
GL_CALL(EdgeFlagv)(flag); | |||
} | |||
/**********************************************************************/ | |||
@@ -887,32 +642,32 @@ static void _ae_update_state( GLcontext *ctx ) | |||
/* conventional vertex arrays */ | |||
if (ctx->Array.Index.Enabled) { | |||
aa->array = &ctx->Array.Index; | |||
aa->func = IndexFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
if (ctx->Array.EdgeFlag.Enabled) { | |||
aa->array = &ctx->Array.EdgeFlag; | |||
aa->func = (array_func) EdgeFlagv; | |||
aa->offset = _gloffset_EdgeFlagv; | |||
aa++; | |||
} | |||
if (ctx->Array.Normal.Enabled) { | |||
aa->array = &ctx->Array.Normal; | |||
aa->func = NormalFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
if (ctx->Array.Color.Enabled) { | |||
aa->array = &ctx->Array.Color; | |||
aa->func = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; | |||
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
if (ctx->Array.SecondaryColor.Enabled) { | |||
aa->array = &ctx->Array.SecondaryColor; | |||
aa->func = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
if (ctx->Array.FogCoord.Enabled) { | |||
aa->array = &ctx->Array.FogCoord; | |||
aa->func = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { | |||
@@ -952,19 +707,19 @@ static void _ae_update_state( GLcontext *ctx ) | |||
*/ | |||
aa->array = &ctx->Array.VertexAttrib[0]; | |||
assert(aa->array->Size >= 2); /* XXX fix someday? */ | |||
aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; | |||
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
else if (ctx->Array.Vertex.Enabled) { | |||
aa->array = &ctx->Array.Vertex; | |||
aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; | |||
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; | |||
aa++; | |||
} | |||
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); | |||
ASSERT(aa - actx->arrays < 32); | |||
at->func = NULL; /* terminate the list */ | |||
aa->func = NULL; /* terminate the list */ | |||
aa->offset = -1; /* terminate the list */ | |||
actx->NewState = 0; | |||
} | |||
@@ -982,6 +737,8 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) | |||
const AEcontext *actx = AE_CONTEXT(ctx); | |||
const AEarray *aa; | |||
const AEattrib *at; | |||
const struct _glapi_table * const disp = GET_DISPATCH(); | |||
if (actx->NewState) | |||
_ae_update_state( ctx ); | |||
@@ -995,11 +752,14 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) | |||
} | |||
/* conventional arrays */ | |||
for (aa = actx->arrays; aa->func ; aa++) { | |||
for (aa = actx->arrays; aa->offset != -1 ; aa++) { | |||
const GLubyte *src = aa->array->BufferObj->Data | |||
+ (uintptr_t) aa->array->Ptr | |||
+ elt * aa->array->StrideB; | |||
aa->func( src ); | |||
fprintf( stderr, "[%s,%u] aa->offset = %d\n", __func__, __LINE__, | |||
aa->offset ); | |||
CALL_by_offset( disp, (array_func), aa->offset, | |||
((const void *) src) ); | |||
} | |||
} | |||
@@ -36,6 +36,8 @@ | |||
#include "colormac.h" | |||
#include "api_loopback.h" | |||
#include "glthread.h" | |||
#include "mtypes.h" | |||
#include "dispatch.h" | |||
/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc | |||
* calls to a smaller set of driver-provided formats. Currently just | |||
@@ -46,35 +48,35 @@ | |||
* 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) 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) | |||
#define ATTRIB1NV(index,x) GL_CALL(VertexAttrib1fNV)(index,x) | |||
#define ATTRIB2NV(index,x,y) GL_CALL(VertexAttrib2fNV)(index,x,y) | |||
#define ATTRIB3NV(index,x,y,z) GL_CALL(VertexAttrib3fNV)(index,x,y,z) | |||
#define ATTRIB4NV(index,x,y,z,w) GL_CALL(VertexAttrib4fNV)(index,x,y,z,w) | |||
#define ATTRIB1ARB(index,x) GL_CALL(VertexAttrib1fARB)(index,x) | |||
#define ATTRIB2ARB(index,x,y) GL_CALL(VertexAttrib2fARB)(index,x,y) | |||
#define ATTRIB3ARB(index,x,y,z) GL_CALL(VertexAttrib3fARB)(index,x,y,z) | |||
#define ATTRIB4ARB(index,x,y,z,w) GL_CALL(VertexAttrib4fARB)(index,x,y,z,w) | |||
#define FOGCOORDF(x) GL_CALL(FogCoordfEXT)(x) | |||
#define SECONDARYCOLORF(a,b,c) GL_CALL(SecondaryColor3fEXT)(a,b,c) | |||
#define COLORF(r,g,b,a) CALL_Color4f(GET_DISPATCH(), (r,g,b,a)) | |||
#define VERTEX2(x,y) CALL_Vertex2f(GET_DISPATCH(), (x,y)) | |||
#define VERTEX3(x,y,z) CALL_Vertex3f(GET_DISPATCH(), (x,y,z)) | |||
#define VERTEX4(x,y,z,w) CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w)) | |||
#define NORMAL(x,y,z) CALL_Normal3f(GET_DISPATCH(), (x,y,z)) | |||
#define TEXCOORD1(s) CALL_TexCoord1f(GET_DISPATCH(), (s)) | |||
#define TEXCOORD2(s,t) CALL_TexCoord2f(GET_DISPATCH(), (s,t)) | |||
#define TEXCOORD3(s,t,u) CALL_TexCoord3f(GET_DISPATCH(), (s,t,u)) | |||
#define TEXCOORD4(s,t,u,v) CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v)) | |||
#define INDEX(c) CALL_Indexf(GET_DISPATCH(), (c)) | |||
#define MULTI_TEXCOORD1(z,s) CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s)) | |||
#define MULTI_TEXCOORD2(z,s,t) CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t)) | |||
#define MULTI_TEXCOORD3(z,s,t,u) CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u)) | |||
#define MULTI_TEXCOORD4(z,s,t,u,v) CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v)) | |||
#define EVALCOORD1(x) CALL_EvalCoord1f(GET_DISPATCH(), (x)) | |||
#define EVALCOORD2(x,y) CALL_EvalCoord2f(GET_DISPATCH(), (x,y)) | |||
#define MATERIALFV(a,b,c) CALL_Materialfv(GET_DISPATCH(), (a,b,c)) | |||
#define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d)) | |||
#define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x)) | |||
#define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y)) | |||
#define ATTRIB3NV(index,x,y,z) CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z)) | |||
#define ATTRIB4NV(index,x,y,z,w) CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w)) | |||
#define ATTRIB1ARB(index,x) CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x)) | |||
#define ATTRIB2ARB(index,x,y) CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y)) | |||
#define ATTRIB3ARB(index,x,y,z) CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z)) | |||
#define ATTRIB4ARB(index,x,y,z,w) CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w)) | |||
#define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) | |||
#define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) | |||
static void GLAPIENTRY | |||
loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) | |||
@@ -1437,209 +1439,209 @@ loopback_VertexAttrib4NuivARB(GLuint index, const GLuint * v) | |||
void | |||
_mesa_loopback_init_api_table( struct _glapi_table *dest ) | |||
{ | |||
dest->Color3b = loopback_Color3b_f; | |||
dest->Color3d = loopback_Color3d_f; | |||
dest->Color3i = loopback_Color3i_f; | |||
dest->Color3s = loopback_Color3s_f; | |||
dest->Color3ui = loopback_Color3ui_f; | |||
dest->Color3us = loopback_Color3us_f; | |||
dest->Color3ub = loopback_Color3ub_f; | |||
dest->Color4b = loopback_Color4b_f; | |||
dest->Color4d = loopback_Color4d_f; | |||
dest->Color4i = loopback_Color4i_f; | |||
dest->Color4s = loopback_Color4s_f; | |||
dest->Color4ui = loopback_Color4ui_f; | |||
dest->Color4us = loopback_Color4us_f; | |||
dest->Color4ub = loopback_Color4ub_f; | |||
dest->Color3bv = loopback_Color3bv_f; | |||
dest->Color3dv = loopback_Color3dv_f; | |||
dest->Color3iv = loopback_Color3iv_f; | |||
dest->Color3sv = loopback_Color3sv_f; | |||
dest->Color3uiv = loopback_Color3uiv_f; | |||
dest->Color3usv = loopback_Color3usv_f; | |||
dest->Color3ubv = loopback_Color3ubv_f; | |||
dest->Color4bv = loopback_Color4bv_f; | |||
dest->Color4dv = loopback_Color4dv_f; | |||
dest->Color4iv = loopback_Color4iv_f; | |||
dest->Color4sv = loopback_Color4sv_f; | |||
dest->Color4uiv = loopback_Color4uiv_f; | |||
dest->Color4usv = loopback_Color4usv_f; | |||
dest->Color4ubv = loopback_Color4ubv_f; | |||
dest->SecondaryColor3bEXT = loopback_SecondaryColor3bEXT_f; | |||
dest->SecondaryColor3dEXT = loopback_SecondaryColor3dEXT_f; | |||
dest->SecondaryColor3iEXT = loopback_SecondaryColor3iEXT_f; | |||
dest->SecondaryColor3sEXT = loopback_SecondaryColor3sEXT_f; | |||
dest->SecondaryColor3uiEXT = loopback_SecondaryColor3uiEXT_f; | |||
dest->SecondaryColor3usEXT = loopback_SecondaryColor3usEXT_f; | |||
dest->SecondaryColor3ubEXT = loopback_SecondaryColor3ubEXT_f; | |||
dest->SecondaryColor3bvEXT = loopback_SecondaryColor3bvEXT_f; | |||
dest->SecondaryColor3dvEXT = loopback_SecondaryColor3dvEXT_f; | |||
dest->SecondaryColor3ivEXT = loopback_SecondaryColor3ivEXT_f; | |||
dest->SecondaryColor3svEXT = loopback_SecondaryColor3svEXT_f; | |||
dest->SecondaryColor3uivEXT = loopback_SecondaryColor3uivEXT_f; | |||
dest->SecondaryColor3usvEXT = loopback_SecondaryColor3usvEXT_f; | |||
dest->SecondaryColor3ubvEXT = loopback_SecondaryColor3ubvEXT_f; | |||
SET_Color3b(dest, loopback_Color3b_f); | |||
SET_Color3d(dest, loopback_Color3d_f); | |||
SET_Color3i(dest, loopback_Color3i_f); | |||
SET_Color3s(dest, loopback_Color3s_f); | |||
SET_Color3ui(dest, loopback_Color3ui_f); | |||
SET_Color3us(dest, loopback_Color3us_f); | |||
SET_Color3ub(dest, loopback_Color3ub_f); | |||
SET_Color4b(dest, loopback_Color4b_f); | |||
SET_Color4d(dest, loopback_Color4d_f); | |||
SET_Color4i(dest, loopback_Color4i_f); | |||
SET_Color4s(dest, loopback_Color4s_f); | |||
SET_Color4ui(dest, loopback_Color4ui_f); | |||
SET_Color4us(dest, loopback_Color4us_f); | |||
SET_Color4ub(dest, loopback_Color4ub_f); | |||
SET_Color3bv(dest, loopback_Color3bv_f); | |||
SET_Color3dv(dest, loopback_Color3dv_f); | |||
SET_Color3iv(dest, loopback_Color3iv_f); | |||
SET_Color3sv(dest, loopback_Color3sv_f); | |||
SET_Color3uiv(dest, loopback_Color3uiv_f); | |||
SET_Color3usv(dest, loopback_Color3usv_f); | |||
SET_Color3ubv(dest, loopback_Color3ubv_f); | |||
SET_Color4bv(dest, loopback_Color4bv_f); | |||
SET_Color4dv(dest, loopback_Color4dv_f); | |||
SET_Color4iv(dest, loopback_Color4iv_f); | |||
SET_Color4sv(dest, loopback_Color4sv_f); | |||
SET_Color4uiv(dest, loopback_Color4uiv_f); | |||
SET_Color4usv(dest, loopback_Color4usv_f); | |||
SET_Color4ubv(dest, loopback_Color4ubv_f); | |||
SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f); | |||
SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f); | |||
SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f); | |||
SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f); | |||
SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f); | |||
SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f); | |||
SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f); | |||
SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f); | |||
SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f); | |||
SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f); | |||
SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f); | |||
SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); | |||
SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); | |||
SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); | |||
dest->Indexd = loopback_Indexd; | |||
dest->Indexi = loopback_Indexi; | |||
dest->Indexs = loopback_Indexs; | |||
dest->Indexub = loopback_Indexub; | |||
dest->Indexdv = loopback_Indexdv; | |||
dest->Indexiv = loopback_Indexiv; | |||
dest->Indexsv = loopback_Indexsv; | |||
dest->Indexubv = loopback_Indexubv; | |||
dest->Normal3b = loopback_Normal3b; | |||
dest->Normal3d = loopback_Normal3d; | |||
dest->Normal3i = loopback_Normal3i; | |||
dest->Normal3s = loopback_Normal3s; | |||
dest->Normal3bv = loopback_Normal3bv; | |||
dest->Normal3dv = loopback_Normal3dv; | |||
dest->Normal3iv = loopback_Normal3iv; | |||
dest->Normal3sv = loopback_Normal3sv; | |||
dest->TexCoord1d = loopback_TexCoord1d; | |||
dest->TexCoord1i = loopback_TexCoord1i; | |||
dest->TexCoord1s = loopback_TexCoord1s; | |||
dest->TexCoord2d = loopback_TexCoord2d; | |||
dest->TexCoord2s = loopback_TexCoord2s; | |||
dest->TexCoord2i = loopback_TexCoord2i; | |||
dest->TexCoord3d = loopback_TexCoord3d; | |||
dest->TexCoord3i = loopback_TexCoord3i; | |||
dest->TexCoord3s = loopback_TexCoord3s; | |||
dest->TexCoord4d = loopback_TexCoord4d; | |||
dest->TexCoord4i = loopback_TexCoord4i; | |||
dest->TexCoord4s = loopback_TexCoord4s; | |||
dest->TexCoord1dv = loopback_TexCoord1dv; | |||
dest->TexCoord1iv = loopback_TexCoord1iv; | |||
dest->TexCoord1sv = loopback_TexCoord1sv; | |||
dest->TexCoord2dv = loopback_TexCoord2dv; | |||
dest->TexCoord2iv = loopback_TexCoord2iv; | |||
dest->TexCoord2sv = loopback_TexCoord2sv; | |||
dest->TexCoord3dv = loopback_TexCoord3dv; | |||
dest->TexCoord3iv = loopback_TexCoord3iv; | |||
dest->TexCoord3sv = loopback_TexCoord3sv; | |||
dest->TexCoord4dv = loopback_TexCoord4dv; | |||
dest->TexCoord4iv = loopback_TexCoord4iv; | |||
dest->TexCoord4sv = loopback_TexCoord4sv; | |||
dest->Vertex2d = loopback_Vertex2d; | |||
dest->Vertex2i = loopback_Vertex2i; | |||
dest->Vertex2s = loopback_Vertex2s; | |||
dest->Vertex3d = loopback_Vertex3d; | |||
dest->Vertex3i = loopback_Vertex3i; | |||
dest->Vertex3s = loopback_Vertex3s; | |||
dest->Vertex4d = loopback_Vertex4d; | |||
dest->Vertex4i = loopback_Vertex4i; | |||
dest->Vertex4s = loopback_Vertex4s; | |||
dest->Vertex2dv = loopback_Vertex2dv; | |||
dest->Vertex2iv = loopback_Vertex2iv; | |||
dest->Vertex2sv = loopback_Vertex2sv; | |||
dest->Vertex3dv = loopback_Vertex3dv; | |||
dest->Vertex3iv = loopback_Vertex3iv; | |||
dest->Vertex3sv = loopback_Vertex3sv; | |||
dest->Vertex4dv = loopback_Vertex4dv; | |||
dest->Vertex4iv = loopback_Vertex4iv; | |||
dest->Vertex4sv = loopback_Vertex4sv; | |||
dest->MultiTexCoord1dARB = loopback_MultiTexCoord1dARB; | |||
dest->MultiTexCoord1dvARB = loopback_MultiTexCoord1dvARB; | |||
dest->MultiTexCoord1iARB = loopback_MultiTexCoord1iARB; | |||
dest->MultiTexCoord1ivARB = loopback_MultiTexCoord1ivARB; | |||
dest->MultiTexCoord1sARB = loopback_MultiTexCoord1sARB; | |||
dest->MultiTexCoord1svARB = loopback_MultiTexCoord1svARB; | |||
dest->MultiTexCoord2dARB = loopback_MultiTexCoord2dARB; | |||
dest->MultiTexCoord2dvARB = loopback_MultiTexCoord2dvARB; | |||
dest->MultiTexCoord2iARB = loopback_MultiTexCoord2iARB; | |||
dest->MultiTexCoord2ivARB = loopback_MultiTexCoord2ivARB; | |||
dest->MultiTexCoord2sARB = loopback_MultiTexCoord2sARB; | |||
dest->MultiTexCoord2svARB = loopback_MultiTexCoord2svARB; | |||
dest->MultiTexCoord3dARB = loopback_MultiTexCoord3dARB; | |||
dest->MultiTexCoord3dvARB = loopback_MultiTexCoord3dvARB; | |||
dest->MultiTexCoord3iARB = loopback_MultiTexCoord3iARB; | |||
dest->MultiTexCoord3ivARB = loopback_MultiTexCoord3ivARB; | |||
dest->MultiTexCoord3sARB = loopback_MultiTexCoord3sARB; | |||
dest->MultiTexCoord3svARB = loopback_MultiTexCoord3svARB; | |||
dest->MultiTexCoord4dARB = loopback_MultiTexCoord4dARB; | |||
dest->MultiTexCoord4dvARB = loopback_MultiTexCoord4dvARB; | |||
dest->MultiTexCoord4iARB = loopback_MultiTexCoord4iARB; | |||
dest->MultiTexCoord4ivARB = loopback_MultiTexCoord4ivARB; | |||
dest->MultiTexCoord4sARB = loopback_MultiTexCoord4sARB; | |||
dest->MultiTexCoord4svARB = loopback_MultiTexCoord4svARB; | |||
dest->EvalCoord2dv = loopback_EvalCoord2dv; | |||
dest->EvalCoord2fv = loopback_EvalCoord2fv; | |||
dest->EvalCoord2d = loopback_EvalCoord2d; | |||
dest->EvalCoord1dv = loopback_EvalCoord1dv; | |||
dest->EvalCoord1fv = loopback_EvalCoord1fv; | |||
dest->EvalCoord1d = loopback_EvalCoord1d; | |||
dest->Materialf = loopback_Materialf; | |||
dest->Materiali = loopback_Materiali; | |||
dest->Materialiv = loopback_Materialiv; | |||
dest->Rectd = loopback_Rectd; | |||
dest->Rectdv = loopback_Rectdv; | |||
dest->Rectfv = loopback_Rectfv; | |||
dest->Recti = loopback_Recti; | |||
dest->Rectiv = loopback_Rectiv; | |||
dest->Rects = loopback_Rects; | |||
dest->Rectsv = loopback_Rectsv; | |||
dest->FogCoorddEXT = loopback_FogCoorddEXT; | |||
dest->FogCoorddvEXT = loopback_FogCoorddvEXT; | |||
dest->VertexAttrib1sNV = loopback_VertexAttrib1sNV; | |||
dest->VertexAttrib1dNV = loopback_VertexAttrib1dNV; | |||
dest->VertexAttrib2sNV = loopback_VertexAttrib2sNV; | |||
dest->VertexAttrib2dNV = loopback_VertexAttrib2dNV; | |||
dest->VertexAttrib3sNV = loopback_VertexAttrib3sNV; | |||
dest->VertexAttrib3dNV = loopback_VertexAttrib3dNV; | |||
dest->VertexAttrib4sNV = loopback_VertexAttrib4sNV; | |||
dest->VertexAttrib4dNV = loopback_VertexAttrib4dNV; | |||
dest->VertexAttrib4ubNV = loopback_VertexAttrib4ubNV; | |||
dest->VertexAttrib1svNV = loopback_VertexAttrib1svNV; | |||
dest->VertexAttrib1dvNV = loopback_VertexAttrib1dvNV; | |||
dest->VertexAttrib2svNV = loopback_VertexAttrib2svNV; | |||
dest->VertexAttrib2dvNV = loopback_VertexAttrib2dvNV; | |||
dest->VertexAttrib3svNV = loopback_VertexAttrib3svNV; | |||
dest->VertexAttrib3dvNV = loopback_VertexAttrib3dvNV; | |||
dest->VertexAttrib4svNV = loopback_VertexAttrib4svNV; | |||
dest->VertexAttrib4dvNV = loopback_VertexAttrib4dvNV; | |||
dest->VertexAttrib4ubvNV = loopback_VertexAttrib4ubvNV; | |||
dest->VertexAttribs1svNV = loopback_VertexAttribs1svNV; | |||
dest->VertexAttribs1fvNV = loopback_VertexAttribs1fvNV; | |||
dest->VertexAttribs1dvNV = loopback_VertexAttribs1dvNV; | |||
dest->VertexAttribs2svNV = loopback_VertexAttribs2svNV; | |||
dest->VertexAttribs2fvNV = loopback_VertexAttribs2fvNV; | |||
dest->VertexAttribs2dvNV = loopback_VertexAttribs2dvNV; | |||
dest->VertexAttribs3svNV = loopback_VertexAttribs3svNV; | |||
dest->VertexAttribs3fvNV = loopback_VertexAttribs3fvNV; | |||
dest->VertexAttribs3dvNV = loopback_VertexAttribs3dvNV; | |||
dest->VertexAttribs4svNV = loopback_VertexAttribs4svNV; | |||
dest->VertexAttribs4fvNV = loopback_VertexAttribs4fvNV; | |||
dest->VertexAttribs4dvNV = loopback_VertexAttribs4dvNV; | |||
dest->VertexAttribs4ubvNV = loopback_VertexAttribs4ubvNV; | |||
dest->VertexAttrib1sARB = loopback_VertexAttrib1sARB; | |||
dest->VertexAttrib1dARB = loopback_VertexAttrib1dARB; | |||
dest->VertexAttrib2sARB = loopback_VertexAttrib2sARB; | |||
dest->VertexAttrib2dARB = loopback_VertexAttrib2dARB; | |||
dest->VertexAttrib3sARB = loopback_VertexAttrib3sARB; | |||
dest->VertexAttrib3dARB = loopback_VertexAttrib3dARB; | |||
dest->VertexAttrib4sARB = loopback_VertexAttrib4sARB; | |||
dest->VertexAttrib4dARB = loopback_VertexAttrib4dARB; | |||
dest->VertexAttrib1svARB = loopback_VertexAttrib1svARB; | |||
dest->VertexAttrib1dvARB = loopback_VertexAttrib1dvARB; | |||
dest->VertexAttrib2svARB = loopback_VertexAttrib2svARB; | |||
dest->VertexAttrib2dvARB = loopback_VertexAttrib2dvARB; | |||
dest->VertexAttrib3svARB = loopback_VertexAttrib3svARB; | |||
dest->VertexAttrib3dvARB = loopback_VertexAttrib3dvARB; | |||
dest->VertexAttrib4svARB = loopback_VertexAttrib4svARB; | |||
dest->VertexAttrib4dvARB = loopback_VertexAttrib4dvARB; | |||
dest->VertexAttrib4NubARB = loopback_VertexAttrib4NubARB; | |||
dest->VertexAttrib4NubvARB = loopback_VertexAttrib4NubvARB; | |||
dest->VertexAttrib4bvARB = loopback_VertexAttrib4bvARB; | |||
dest->VertexAttrib4ivARB = loopback_VertexAttrib4ivARB; | |||
dest->VertexAttrib4ubvARB = loopback_VertexAttrib4ubvARB; | |||
dest->VertexAttrib4usvARB = loopback_VertexAttrib4usvARB; | |||
dest->VertexAttrib4uivARB = loopback_VertexAttrib4uivARB; | |||
dest->VertexAttrib4NbvARB = loopback_VertexAttrib4NbvARB; | |||
dest->VertexAttrib4NsvARB = loopback_VertexAttrib4NsvARB; | |||
dest->VertexAttrib4NivARB = loopback_VertexAttrib4NivARB; | |||
dest->VertexAttrib4NusvARB = loopback_VertexAttrib4NusvARB; | |||
dest->VertexAttrib4NuivARB = loopback_VertexAttrib4NuivARB; | |||
SET_Indexd(dest, loopback_Indexd); | |||
SET_Indexi(dest, loopback_Indexi); | |||
SET_Indexs(dest, loopback_Indexs); | |||
SET_Indexub(dest, loopback_Indexub); | |||
SET_Indexdv(dest, loopback_Indexdv); | |||
SET_Indexiv(dest, loopback_Indexiv); | |||
SET_Indexsv(dest, loopback_Indexsv); | |||
SET_Indexubv(dest, loopback_Indexubv); | |||
SET_Normal3b(dest, loopback_Normal3b); | |||
SET_Normal3d(dest, loopback_Normal3d); | |||
SET_Normal3i(dest, loopback_Normal3i); | |||
SET_Normal3s(dest, loopback_Normal3s); | |||
SET_Normal3bv(dest, loopback_Normal3bv); | |||
SET_Normal3dv(dest, loopback_Normal3dv); | |||
SET_Normal3iv(dest, loopback_Normal3iv); | |||
SET_Normal3sv(dest, loopback_Normal3sv); | |||
SET_TexCoord1d(dest, loopback_TexCoord1d); | |||
SET_TexCoord1i(dest, loopback_TexCoord1i); | |||
SET_TexCoord1s(dest, loopback_TexCoord1s); | |||
SET_TexCoord2d(dest, loopback_TexCoord2d); | |||
SET_TexCoord2s(dest, loopback_TexCoord2s); | |||
SET_TexCoord2i(dest, loopback_TexCoord2i); | |||
SET_TexCoord3d(dest, loopback_TexCoord3d); | |||
SET_TexCoord3i(dest, loopback_TexCoord3i); | |||
SET_TexCoord3s(dest, loopback_TexCoord3s); | |||
SET_TexCoord4d(dest, loopback_TexCoord4d); | |||
SET_TexCoord4i(dest, loopback_TexCoord4i); | |||
SET_TexCoord4s(dest, loopback_TexCoord4s); | |||
SET_TexCoord1dv(dest, loopback_TexCoord1dv); | |||
SET_TexCoord1iv(dest, loopback_TexCoord1iv); | |||
SET_TexCoord1sv(dest, loopback_TexCoord1sv); | |||
SET_TexCoord2dv(dest, loopback_TexCoord2dv); | |||
SET_TexCoord2iv(dest, loopback_TexCoord2iv); | |||
SET_TexCoord2sv(dest, loopback_TexCoord2sv); | |||
SET_TexCoord3dv(dest, loopback_TexCoord3dv); | |||
SET_TexCoord3iv(dest, loopback_TexCoord3iv); | |||
SET_TexCoord3sv(dest, loopback_TexCoord3sv); | |||
SET_TexCoord4dv(dest, loopback_TexCoord4dv); | |||
SET_TexCoord4iv(dest, loopback_TexCoord4iv); | |||
SET_TexCoord4sv(dest, loopback_TexCoord4sv); | |||
SET_Vertex2d(dest, loopback_Vertex2d); | |||
SET_Vertex2i(dest, loopback_Vertex2i); | |||
SET_Vertex2s(dest, loopback_Vertex2s); | |||
SET_Vertex3d(dest, loopback_Vertex3d); | |||
SET_Vertex3i(dest, loopback_Vertex3i); | |||
SET_Vertex3s(dest, loopback_Vertex3s); | |||
SET_Vertex4d(dest, loopback_Vertex4d); | |||
SET_Vertex4i(dest, loopback_Vertex4i); | |||
SET_Vertex4s(dest, loopback_Vertex4s); | |||
SET_Vertex2dv(dest, loopback_Vertex2dv); | |||
SET_Vertex2iv(dest, loopback_Vertex2iv); | |||
SET_Vertex2sv(dest, loopback_Vertex2sv); | |||
SET_Vertex3dv(dest, loopback_Vertex3dv); | |||
SET_Vertex3iv(dest, loopback_Vertex3iv); | |||
SET_Vertex3sv(dest, loopback_Vertex3sv); | |||
SET_Vertex4dv(dest, loopback_Vertex4dv); | |||
SET_Vertex4iv(dest, loopback_Vertex4iv); | |||
SET_Vertex4sv(dest, loopback_Vertex4sv); | |||
SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB); | |||
SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB); | |||
SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB); | |||
SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB); | |||
SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB); | |||
SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB); | |||
SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB); | |||
SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB); | |||
SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB); | |||
SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB); | |||
SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB); | |||
SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB); | |||
SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB); | |||
SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB); | |||
SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB); | |||
SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB); | |||
SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB); | |||
SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB); | |||
SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB); | |||
SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB); | |||
SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB); | |||
SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB); | |||
SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB); | |||
SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB); | |||
SET_EvalCoord2dv(dest, loopback_EvalCoord2dv); | |||
SET_EvalCoord2fv(dest, loopback_EvalCoord2fv); | |||
SET_EvalCoord2d(dest, loopback_EvalCoord2d); | |||
SET_EvalCoord1dv(dest, loopback_EvalCoord1dv); | |||
SET_EvalCoord1fv(dest, loopback_EvalCoord1fv); | |||
SET_EvalCoord1d(dest, loopback_EvalCoord1d); | |||
SET_Materialf(dest, loopback_Materialf); | |||
SET_Materiali(dest, loopback_Materiali); | |||
SET_Materialiv(dest, loopback_Materialiv); | |||
SET_Rectd(dest, loopback_Rectd); | |||
SET_Rectdv(dest, loopback_Rectdv); | |||
SET_Rectfv(dest, loopback_Rectfv); | |||
SET_Recti(dest, loopback_Recti); | |||
SET_Rectiv(dest, loopback_Rectiv); | |||
SET_Rects(dest, loopback_Rects); | |||
SET_Rectsv(dest, loopback_Rectsv); | |||
SET_FogCoorddEXT(dest, loopback_FogCoorddEXT); | |||
SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT); | |||
SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV); | |||
SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV); | |||
SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV); | |||
SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV); | |||
SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV); | |||
SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV); | |||
SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV); | |||
SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV); | |||
SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV); | |||
SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV); | |||
SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV); | |||
SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV); | |||
SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV); | |||
SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV); | |||
SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV); | |||
SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV); | |||
SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV); | |||
SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV); | |||
SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV); | |||
SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV); | |||
SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV); | |||
SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV); | |||
SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV); | |||
SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV); | |||
SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV); | |||
SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV); | |||
SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV); | |||
SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV); | |||
SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV); | |||
SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV); | |||
SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV); | |||
SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB); | |||
SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB); | |||
SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB); | |||
SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB); | |||
SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB); | |||
SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB); | |||
SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB); | |||
SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB); | |||
SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB); | |||
SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB); | |||
SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB); | |||
SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB); | |||
SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB); | |||
SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB); | |||
SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB); | |||
SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB); | |||
SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB); | |||
SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB); | |||
SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB); | |||
SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB); | |||
SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB); | |||
SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB); | |||
SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB); | |||
SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB); | |||
SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB); | |||
SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB); | |||
SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); | |||
SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); | |||
} |
@@ -33,6 +33,7 @@ | |||
#include "macros.h" | |||
#include "mtypes.h" | |||
#include "dlist.h" | |||
#include "dispatch.h" | |||
/* In states where certain vertex components are required for t&l or | |||
@@ -685,12 +686,12 @@ void GLAPIENTRY _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 | |||
ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
} | |||
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)(); | |||
CALL_Begin(GET_DISPATCH(), (GL_QUADS)); | |||
CALL_Vertex2f(GET_DISPATCH(), (x1, y1)); | |||
CALL_Vertex2f(GET_DISPATCH(), (x2, y1)); | |||
CALL_Vertex2f(GET_DISPATCH(), (x2, y2)); | |||
CALL_Vertex2f(GET_DISPATCH(), (x1, y2)); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -706,10 +707,10 @@ void GLAPIENTRY _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count) | |||
if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) | |||
return; | |||
GL_CALL(Begin)(mode); | |||
CALL_Begin(GET_DISPATCH(), (mode)); | |||
for (i = 0; i < count; i++) | |||
GL_CALL(ArrayElement)(start + i); | |||
GL_CALL(End)(); | |||
CALL_ArrayElement(GET_DISPATCH(), (start + i)); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -722,27 +723,27 @@ void GLAPIENTRY _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, | |||
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) | |||
return; | |||
GL_CALL(Begin)(mode); | |||
CALL_Begin(GET_DISPATCH(), (mode)); | |||
switch (type) { | |||
case GL_UNSIGNED_BYTE: | |||
for (i = 0 ; i < count ; i++) | |||
GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] )); | |||
break; | |||
case GL_UNSIGNED_SHORT: | |||
for (i = 0 ; i < count ; i++) | |||
GL_CALL(ArrayElement)( ((GLushort *)indices)[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] )); | |||
break; | |||
case GL_UNSIGNED_INT: | |||
for (i = 0 ; i < count ; i++) | |||
GL_CALL(ArrayElement)( ((GLuint *)indices)[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] )); | |||
break; | |||
default: | |||
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); | |||
break; | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode, | |||
@@ -755,7 +756,7 @@ void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode, | |||
if (_mesa_validate_DrawRangeElements( ctx, mode, | |||
start, end, | |||
count, type, indices )) | |||
GL_CALL(DrawElements)( mode, count, type, indices ); | |||
CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices)); | |||
} | |||
/* | |||
@@ -800,11 +801,11 @@ void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) | |||
du = ctx->Eval.MapGrid1du; | |||
u = ctx->Eval.MapGrid1u1 + i1 * du; | |||
GL_CALL(Begin)( prim ); | |||
CALL_Begin(GET_DISPATCH(), (prim)); | |||
for (i=i1;i<=i2;i++,u+=du) { | |||
GL_CALL(EvalCoord1f)( u ); | |||
CALL_EvalCoord1f(GET_DISPATCH(), (u)); | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -839,38 +840,38 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, | |||
switch (mode) { | |||
case GL_POINT: | |||
GL_CALL(Begin)( GL_POINTS ); | |||
CALL_Begin(GET_DISPATCH(), (GL_POINTS)); | |||
for (v=v1,j=j1;j<=j2;j++,v+=dv) { | |||
for (u=u1,i=i1;i<=i2;i++,u+=du) { | |||
GL_CALL(EvalCoord2f)(u, v ); | |||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); | |||
} | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
break; | |||
case GL_LINE: | |||
for (v=v1,j=j1;j<=j2;j++,v+=dv) { | |||
GL_CALL(Begin)( GL_LINE_STRIP ); | |||
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); | |||
for (u=u1,i=i1;i<=i2;i++,u+=du) { | |||
GL_CALL(EvalCoord2f)(u, v ); | |||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
for (u=u1,i=i1;i<=i2;i++,u+=du) { | |||
GL_CALL(Begin)( GL_LINE_STRIP ); | |||
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP)); | |||
for (v=v1,j=j1;j<=j2;j++,v+=dv) { | |||
GL_CALL(EvalCoord2f)(u, v ); | |||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
break; | |||
case GL_FILL: | |||
for (v=v1,j=j1;j<j2;j++,v+=dv) { | |||
GL_CALL(Begin)( GL_TRIANGLE_STRIP ); | |||
CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP)); | |||
for (u=u1,i=i1;i<=i2;i++,u+=du) { | |||
GL_CALL(EvalCoord2f)(u, v ); | |||
GL_CALL(EvalCoord2f)(u, v+dv ); | |||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v)); | |||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv)); | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
break; | |||
default: |
@@ -66,19 +66,19 @@ | |||
#define F stdout | |||
#define DISPATCH(FUNC, ARGS, MESSAGE) \ | |||
fprintf MESSAGE; \ | |||
GL_CALL(FUNC) ARGS; | |||
CALL_ ## FUNC(GET_DISPATCH(), ARGS); | |||
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ | |||
fprintf MESSAGE; \ | |||
return GL_CALL(FUNC) ARGS; | |||
return CALL_ ## FUNC(GET_DISPATCH(), ARGS); | |||
#else | |||
#define DISPATCH(FUNC, ARGS, MESSAGE) \ | |||
GL_CALL(FUNC) ARGS; | |||
CALL_ ## FUNC(GET_DISPATCH(), ARGS); | |||
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ | |||
return GL_CALL(FUNC) ARGS; | |||
return CALL_ ## FUNC(GET_DISPATCH(), ARGS); | |||
#endif /* logging */ | |||
@@ -87,6 +87,7 @@ | |||
#define GLAPIENTRY | |||
#endif | |||
#include "dispatch.h" | |||
#include "glapitemp.h" | |||
#endif /* USE_X86_ASM */ |
@@ -33,7 +33,7 @@ | |||
#include "texstate.h" | |||
#include "mtypes.h" | |||
#include "varray.h" | |||
#include "dispatch.h" | |||
#ifndef GL_BOOLEAN | |||
#define GL_BOOLEAN 0x9999 | |||
@@ -851,7 +851,7 @@ _mesa_MultiDrawArraysEXT( GLenum mode, GLint *first, | |||
for (i = 0; i < primcount; i++) { | |||
if (count[i] > 0) { | |||
(ctx->Exec->DrawArrays)(mode, first[i], count[i]); | |||
CALL_DrawArrays(ctx->Exec, (mode, first[i], count[i])); | |||
} | |||
} | |||
} | |||
@@ -869,7 +869,7 @@ _mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, | |||
for (i = 0; i < primcount; i++) { | |||
if (count[i] > 0) { | |||
(ctx->Exec->DrawElements)(mode, count[i], type, indices[i]); | |||
CALL_DrawElements(ctx->Exec, (mode, count[i], type, indices[i])); | |||
} | |||
} | |||
} | |||
@@ -889,7 +889,7 @@ _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, | |||
for ( i = 0 ; i < primcount ; i++ ) { | |||
if ( count[i] > 0 ) { | |||
GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride)); | |||
(ctx->Exec->DrawArrays)( m, first[i], count[i] ); | |||
CALL_DrawArrays(ctx->Exec, ( m, first[i], count[i] )); | |||
} | |||
} | |||
} | |||
@@ -911,7 +911,7 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, | |||
for ( i = 0 ; i < primcount ; i++ ) { | |||
if ( count[i] > 0 ) { | |||
GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride)); | |||
(ctx->Exec->DrawElements)( m, count[i], type, indices[i] ); | |||
CALL_DrawElements(ctx->Exec, ( m, count[i], type, indices[i] )); | |||
} | |||
} | |||
} |
@@ -56,7 +56,7 @@ | |||
\ | |||
/* Save the swapped function's dispatch entry so it can be */ \ | |||
/* restored later. */ \ | |||
tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC); \ | |||
tnl->Swapped[tnl->SwapCount][0] = (void *)&(GET_ ## FUNC (ctx->Exec)); \ | |||
*(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC); \ | |||
tnl->SwapCount++; \ | |||
\ | |||
@@ -64,7 +64,7 @@ | |||
_mesa_debug(ctx, " swapping gl" #FUNC"...\n" ); \ | |||
\ | |||
/* Install the tnl function pointer. */ \ | |||
ctx->Exec->FUNC = tnl->Current->FUNC; \ | |||
SET_ ## FUNC(ctx->Exec, tnl->Current->FUNC); \ | |||
} | |||
#define TAG(x) neutral_##x | |||
@@ -75,76 +75,76 @@ | |||
static void | |||
install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) | |||
{ | |||
tab->ArrayElement = vfmt->ArrayElement; | |||
tab->Color3f = vfmt->Color3f; | |||
tab->Color3fv = vfmt->Color3fv; | |||
tab->Color4f = vfmt->Color4f; | |||
tab->Color4fv = vfmt->Color4fv; | |||
tab->EdgeFlag = vfmt->EdgeFlag; | |||
tab->EdgeFlagv = vfmt->EdgeFlagv; | |||
tab->EvalCoord1f = vfmt->EvalCoord1f; | |||
tab->EvalCoord1fv = vfmt->EvalCoord1fv; | |||
tab->EvalCoord2f = vfmt->EvalCoord2f; | |||
tab->EvalCoord2fv = vfmt->EvalCoord2fv; | |||
tab->EvalPoint1 = vfmt->EvalPoint1; | |||
tab->EvalPoint2 = vfmt->EvalPoint2; | |||
tab->FogCoordfEXT = vfmt->FogCoordfEXT; | |||
tab->FogCoordfvEXT = vfmt->FogCoordfvEXT; | |||
tab->Indexf = vfmt->Indexf; | |||
tab->Indexfv = vfmt->Indexfv; | |||
tab->Materialfv = vfmt->Materialfv; | |||
tab->MultiTexCoord1fARB = vfmt->MultiTexCoord1fARB; | |||
tab->MultiTexCoord1fvARB = vfmt->MultiTexCoord1fvARB; | |||
tab->MultiTexCoord2fARB = vfmt->MultiTexCoord2fARB; | |||
tab->MultiTexCoord2fvARB = vfmt->MultiTexCoord2fvARB; | |||
tab->MultiTexCoord3fARB = vfmt->MultiTexCoord3fARB; | |||
tab->MultiTexCoord3fvARB = vfmt->MultiTexCoord3fvARB; | |||
tab->MultiTexCoord4fARB = vfmt->MultiTexCoord4fARB; | |||
tab->MultiTexCoord4fvARB = vfmt->MultiTexCoord4fvARB; | |||
tab->Normal3f = vfmt->Normal3f; | |||
tab->Normal3fv = vfmt->Normal3fv; | |||
tab->SecondaryColor3fEXT = vfmt->SecondaryColor3fEXT; | |||
tab->SecondaryColor3fvEXT = vfmt->SecondaryColor3fvEXT; | |||
tab->TexCoord1f = vfmt->TexCoord1f; | |||
tab->TexCoord1fv = vfmt->TexCoord1fv; | |||
tab->TexCoord2f = vfmt->TexCoord2f; | |||
tab->TexCoord2fv = vfmt->TexCoord2fv; | |||
tab->TexCoord3f = vfmt->TexCoord3f; | |||
tab->TexCoord3fv = vfmt->TexCoord3fv; | |||
tab->TexCoord4f = vfmt->TexCoord4f; | |||
tab->TexCoord4fv = vfmt->TexCoord4fv; | |||
tab->Vertex2f = vfmt->Vertex2f; | |||
tab->Vertex2fv = vfmt->Vertex2fv; | |||
tab->Vertex3f = vfmt->Vertex3f; | |||
tab->Vertex3fv = vfmt->Vertex3fv; | |||
tab->Vertex4f = vfmt->Vertex4f; | |||
tab->Vertex4fv = vfmt->Vertex4fv; | |||
tab->CallList = vfmt->CallList; | |||
tab->CallLists = vfmt->CallLists; | |||
tab->Begin = vfmt->Begin; | |||
tab->End = vfmt->End; | |||
tab->VertexAttrib1fNV = vfmt->VertexAttrib1fNV; | |||
tab->VertexAttrib1fvNV = vfmt->VertexAttrib1fvNV; | |||
tab->VertexAttrib2fNV = vfmt->VertexAttrib2fNV; | |||
tab->VertexAttrib2fvNV = vfmt->VertexAttrib2fvNV; | |||
tab->VertexAttrib3fNV = vfmt->VertexAttrib3fNV; | |||
tab->VertexAttrib3fvNV = vfmt->VertexAttrib3fvNV; | |||
tab->VertexAttrib4fNV = vfmt->VertexAttrib4fNV; | |||
tab->VertexAttrib4fvNV = vfmt->VertexAttrib4fvNV; | |||
tab->VertexAttrib1fARB = vfmt->VertexAttrib1fARB; | |||
tab->VertexAttrib1fvARB = vfmt->VertexAttrib1fvARB; | |||
tab->VertexAttrib2fARB = vfmt->VertexAttrib2fARB; | |||
tab->VertexAttrib2fvARB = vfmt->VertexAttrib2fvARB; | |||
tab->VertexAttrib3fARB = vfmt->VertexAttrib3fARB; | |||
tab->VertexAttrib3fvARB = vfmt->VertexAttrib3fvARB; | |||
tab->VertexAttrib4fARB = vfmt->VertexAttrib4fARB; | |||
tab->VertexAttrib4fvARB = vfmt->VertexAttrib4fvARB; | |||
tab->Rectf = vfmt->Rectf; | |||
tab->DrawArrays = vfmt->DrawArrays; | |||
tab->DrawElements = vfmt->DrawElements; | |||
tab->DrawRangeElements = vfmt->DrawRangeElements; | |||
tab->EvalMesh1 = vfmt->EvalMesh1; | |||
tab->EvalMesh2 = vfmt->EvalMesh2; | |||
SET_ArrayElement(tab, vfmt->ArrayElement); | |||
SET_Color3f(tab, vfmt->Color3f); | |||
SET_Color3fv(tab, vfmt->Color3fv); | |||
SET_Color4f(tab, vfmt->Color4f); | |||
SET_Color4fv(tab, vfmt->Color4fv); | |||
SET_EdgeFlag(tab, vfmt->EdgeFlag); | |||
SET_EdgeFlagv(tab, vfmt->EdgeFlagv); | |||
SET_EvalCoord1f(tab, vfmt->EvalCoord1f); | |||
SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv); | |||
SET_EvalCoord2f(tab, vfmt->EvalCoord2f); | |||
SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv); | |||
SET_EvalPoint1(tab, vfmt->EvalPoint1); | |||
SET_EvalPoint2(tab, vfmt->EvalPoint2); | |||
SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); | |||
SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); | |||
SET_Indexf(tab, vfmt->Indexf); | |||
SET_Indexfv(tab, vfmt->Indexfv); | |||
SET_Materialfv(tab, vfmt->Materialfv); | |||
SET_MultiTexCoord1fARB(tab, vfmt->MultiTexCoord1fARB); | |||
SET_MultiTexCoord1fvARB(tab, vfmt->MultiTexCoord1fvARB); | |||
SET_MultiTexCoord2fARB(tab, vfmt->MultiTexCoord2fARB); | |||
SET_MultiTexCoord2fvARB(tab, vfmt->MultiTexCoord2fvARB); | |||
SET_MultiTexCoord3fARB(tab, vfmt->MultiTexCoord3fARB); | |||
SET_MultiTexCoord3fvARB(tab, vfmt->MultiTexCoord3fvARB); | |||
SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB); | |||
SET_MultiTexCoord4fvARB(tab, vfmt->MultiTexCoord4fvARB); | |||
SET_Normal3f(tab, vfmt->Normal3f); | |||
SET_Normal3fv(tab, vfmt->Normal3fv); | |||
SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT); | |||
SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT); | |||
SET_TexCoord1f(tab, vfmt->TexCoord1f); | |||
SET_TexCoord1fv(tab, vfmt->TexCoord1fv); | |||
SET_TexCoord2f(tab, vfmt->TexCoord2f); | |||
SET_TexCoord2fv(tab, vfmt->TexCoord2fv); | |||
SET_TexCoord3f(tab, vfmt->TexCoord3f); | |||
SET_TexCoord3fv(tab, vfmt->TexCoord3fv); | |||
SET_TexCoord4f(tab, vfmt->TexCoord4f); | |||
SET_TexCoord4fv(tab, vfmt->TexCoord4fv); | |||
SET_Vertex2f(tab, vfmt->Vertex2f); | |||
SET_Vertex2fv(tab, vfmt->Vertex2fv); | |||
SET_Vertex3f(tab, vfmt->Vertex3f); | |||
SET_Vertex3fv(tab, vfmt->Vertex3fv); | |||
SET_Vertex4f(tab, vfmt->Vertex4f); | |||
SET_Vertex4fv(tab, vfmt->Vertex4fv); | |||
SET_CallList(tab, vfmt->CallList); | |||
SET_CallLists(tab, vfmt->CallLists); | |||
SET_Begin(tab, vfmt->Begin); | |||
SET_End(tab, vfmt->End); | |||
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); | |||
SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); | |||
SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV); | |||
SET_VertexAttrib2fvNV(tab, vfmt->VertexAttrib2fvNV); | |||
SET_VertexAttrib3fNV(tab, vfmt->VertexAttrib3fNV); | |||
SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV); | |||
SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV); | |||
SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV); | |||
SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB); | |||
SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB); | |||
SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB); | |||
SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB); | |||
SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB); | |||
SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB); | |||
SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB); | |||
SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB); | |||
SET_Rectf(tab, vfmt->Rectf); | |||
SET_DrawArrays(tab, vfmt->DrawArrays); | |||
SET_DrawElements(tab, vfmt->DrawElements); | |||
SET_DrawRangeElements(tab, vfmt->DrawRangeElements); | |||
SET_EvalMesh1(tab, vfmt->EvalMesh1); | |||
SET_EvalMesh2(tab, vfmt->EvalMesh2); | |||
ASSERT(tab->EvalMesh2); | |||
} | |||
@@ -29,313 +29,315 @@ | |||
#define PRE_LOOPBACK( FUNC ) | |||
#endif | |||
#include "dispatch.h" | |||
static void GLAPIENTRY TAG(ArrayElement)( GLint i ) | |||
{ | |||
PRE_LOOPBACK( ArrayElement ); | |||
GL_CALL(ArrayElement)( i ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( i )); | |||
} | |||
static void GLAPIENTRY TAG(Color3f)( GLfloat r, GLfloat g, GLfloat b ) | |||
{ | |||
PRE_LOOPBACK( Color3f ); | |||
GL_CALL(Color3f)( r, g, b ); | |||
CALL_Color3f(GET_DISPATCH(), ( r, g, b )); | |||
} | |||
static void GLAPIENTRY TAG(Color3fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Color3fv ); | |||
GL_CALL(Color3fv)( v ); | |||
CALL_Color3fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) | |||
{ | |||
PRE_LOOPBACK( Color4f ); | |||
GL_CALL(Color4f)( r, g, b, a ); | |||
CALL_Color4f(GET_DISPATCH(), ( r, g, b, a )); | |||
} | |||
static void GLAPIENTRY TAG(Color4fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Color4fv ); | |||
GL_CALL(Color4fv)( v ); | |||
CALL_Color4fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(EdgeFlag)( GLboolean e ) | |||
{ | |||
PRE_LOOPBACK( EdgeFlag ); | |||
GL_CALL(EdgeFlag)( e ); | |||
CALL_EdgeFlag(GET_DISPATCH(), ( e )); | |||
} | |||
static void GLAPIENTRY TAG(EdgeFlagv)( const GLboolean *v ) | |||
{ | |||
PRE_LOOPBACK( EdgeFlagv ); | |||
GL_CALL(EdgeFlagv)( v ); | |||
CALL_EdgeFlagv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(EvalCoord1f)( GLfloat s ) | |||
{ | |||
PRE_LOOPBACK( EvalCoord1f ); | |||
GL_CALL(EvalCoord1f)( s ); | |||
CALL_EvalCoord1f(GET_DISPATCH(), ( s )); | |||
} | |||
static void GLAPIENTRY TAG(EvalCoord1fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( EvalCoord1fv ); | |||
GL_CALL(EvalCoord1fv)( v ); | |||
CALL_EvalCoord1fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(EvalCoord2f)( GLfloat s, GLfloat t ) | |||
{ | |||
PRE_LOOPBACK( EvalCoord2f ); | |||
GL_CALL(EvalCoord2f)( s, t ); | |||
CALL_EvalCoord2f(GET_DISPATCH(), ( s, t )); | |||
} | |||
static void GLAPIENTRY TAG(EvalCoord2fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( EvalCoord2fv ); | |||
GL_CALL(EvalCoord2fv)( v ); | |||
CALL_EvalCoord2fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(EvalPoint1)( GLint i ) | |||
{ | |||
PRE_LOOPBACK( EvalPoint1 ); | |||
GL_CALL(EvalPoint1)( i ); | |||
CALL_EvalPoint1(GET_DISPATCH(), ( i )); | |||
} | |||
static void GLAPIENTRY TAG(EvalPoint2)( GLint i, GLint j ) | |||
{ | |||
PRE_LOOPBACK( EvalPoint2 ); | |||
GL_CALL(EvalPoint2)( i, j ); | |||
CALL_EvalPoint2(GET_DISPATCH(), ( i, j )); | |||
} | |||
static void GLAPIENTRY TAG(FogCoordfEXT)( GLfloat f ) | |||
{ | |||
PRE_LOOPBACK( FogCoordfEXT ); | |||
GL_CALL(FogCoordfEXT)( f ); | |||
CALL_FogCoordfEXT(GET_DISPATCH(), ( f )); | |||
} | |||
static void GLAPIENTRY TAG(FogCoordfvEXT)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( FogCoordfvEXT ); | |||
GL_CALL(FogCoordfvEXT)( v ); | |||
CALL_FogCoordfvEXT(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(Indexf)( GLfloat f ) | |||
{ | |||
PRE_LOOPBACK( Indexf ); | |||
GL_CALL(Indexf)( f ); | |||
CALL_Indexf(GET_DISPATCH(), ( f )); | |||
} | |||
static void GLAPIENTRY TAG(Indexfv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Indexfv ); | |||
GL_CALL(Indexfv)( v ); | |||
CALL_Indexfv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(Materialfv)( GLenum face, GLenum pname, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Materialfv ); | |||
GL_CALL(Materialfv)( face, pname, v ); | |||
CALL_Materialfv(GET_DISPATCH(), ( face, pname, v )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord1fARB)( GLenum target, GLfloat a ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord1fARB ); | |||
GL_CALL(MultiTexCoord1fARB)( target, a ); | |||
CALL_MultiTexCoord1fARB(GET_DISPATCH(), ( target, a )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord1fvARB)( GLenum target, const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord1fvARB ); | |||
GL_CALL(MultiTexCoord1fvARB)( target, tc ); | |||
CALL_MultiTexCoord1fvARB(GET_DISPATCH(), ( target, tc )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord2fARB)( GLenum target, GLfloat s, GLfloat t ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord2fARB ); | |||
GL_CALL(MultiTexCoord2fARB)( target, s, t ); | |||
CALL_MultiTexCoord2fARB(GET_DISPATCH(), ( target, s, t )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord2fvARB)( GLenum target, const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord2fvARB ); | |||
GL_CALL(MultiTexCoord2fvARB)( target, tc ); | |||
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), ( target, tc )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord3fARB)( GLenum target, GLfloat s, | |||
GLfloat t, GLfloat r ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord3fARB ); | |||
GL_CALL(MultiTexCoord3fARB)( target, s, t, r ); | |||
CALL_MultiTexCoord3fARB(GET_DISPATCH(), ( target, s, t, r )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord3fvARB)( GLenum target, const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord3fvARB ); | |||
GL_CALL(MultiTexCoord3fvARB)( target, tc ); | |||
CALL_MultiTexCoord3fvARB(GET_DISPATCH(), ( target, tc )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord4fARB)( GLenum target, GLfloat s, | |||
GLfloat t, GLfloat r, GLfloat q ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord4fARB ); | |||
GL_CALL(MultiTexCoord4fARB)( target, s, t, r, q ); | |||
CALL_MultiTexCoord4fARB(GET_DISPATCH(), ( target, s, t, r, q )); | |||
} | |||
static void GLAPIENTRY TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( MultiTexCoord4fvARB ); | |||
GL_CALL(MultiTexCoord4fvARB)( target, tc ); | |||
CALL_MultiTexCoord4fvARB(GET_DISPATCH(), ( target, tc )); | |||
} | |||
static void GLAPIENTRY TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
PRE_LOOPBACK( Normal3f ); | |||
GL_CALL(Normal3f)( x, y, z ); | |||
CALL_Normal3f(GET_DISPATCH(), ( x, y, z )); | |||
} | |||
static void GLAPIENTRY TAG(Normal3fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Normal3fv ); | |||
GL_CALL(Normal3fv)( v ); | |||
CALL_Normal3fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(SecondaryColor3fEXT)( GLfloat r, GLfloat g, GLfloat b ) | |||
{ | |||
PRE_LOOPBACK( SecondaryColor3fEXT ); | |||
GL_CALL(SecondaryColor3fEXT)( r, g, b ); | |||
CALL_SecondaryColor3fEXT(GET_DISPATCH(), ( r, g, b )); | |||
} | |||
static void GLAPIENTRY TAG(SecondaryColor3fvEXT)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( SecondaryColor3fvEXT ); | |||
GL_CALL(SecondaryColor3fvEXT)( v ); | |||
CALL_SecondaryColor3fvEXT(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord1f)( GLfloat s ) | |||
{ | |||
PRE_LOOPBACK( TexCoord1f ); | |||
GL_CALL(TexCoord1f)( s ); | |||
CALL_TexCoord1f(GET_DISPATCH(), ( s )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord1fv)( const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( TexCoord1fv ); | |||
GL_CALL(TexCoord1fv)( tc ); | |||
CALL_TexCoord1fv(GET_DISPATCH(), ( tc )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord2f)( GLfloat s, GLfloat t ) | |||
{ | |||
PRE_LOOPBACK( TexCoord2f ); | |||
GL_CALL(TexCoord2f)( s, t ); | |||
CALL_TexCoord2f(GET_DISPATCH(), ( s, t )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord2fv)( const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( TexCoord2fv ); | |||
GL_CALL(TexCoord2fv)( tc ); | |||
CALL_TexCoord2fv(GET_DISPATCH(), ( tc )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord3f)( GLfloat s, GLfloat t, GLfloat r ) | |||
{ | |||
PRE_LOOPBACK( TexCoord3f ); | |||
GL_CALL(TexCoord3f)( s, t, r ); | |||
CALL_TexCoord3f(GET_DISPATCH(), ( s, t, r )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord3fv)( const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( TexCoord3fv ); | |||
GL_CALL(TexCoord3fv)( tc ); | |||
CALL_TexCoord3fv(GET_DISPATCH(), ( tc )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord4f)( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) | |||
{ | |||
PRE_LOOPBACK( TexCoord4f ); | |||
GL_CALL(TexCoord4f)( s, t, r, q ); | |||
CALL_TexCoord4f(GET_DISPATCH(), ( s, t, r, q )); | |||
} | |||
static void GLAPIENTRY TAG(TexCoord4fv)( const GLfloat *tc ) | |||
{ | |||
PRE_LOOPBACK( TexCoord4fv ); | |||
GL_CALL(TexCoord4fv)( tc ); | |||
CALL_TexCoord4fv(GET_DISPATCH(), ( tc )); | |||
} | |||
static void GLAPIENTRY TAG(Vertex2f)( GLfloat x, GLfloat y ) | |||
{ | |||
PRE_LOOPBACK( Vertex2f ); | |||
GL_CALL(Vertex2f)( x, y ); | |||
CALL_Vertex2f(GET_DISPATCH(), ( x, y )); | |||
} | |||
static void GLAPIENTRY TAG(Vertex2fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Vertex2fv ); | |||
GL_CALL(Vertex2fv)( v ); | |||
CALL_Vertex2fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
PRE_LOOPBACK( Vertex3f ); | |||
GL_CALL(Vertex3f)( x, y, z ); | |||
CALL_Vertex3f(GET_DISPATCH(), ( x, y, z )); | |||
} | |||
static void GLAPIENTRY TAG(Vertex3fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Vertex3fv ); | |||
GL_CALL(Vertex3fv)( v ); | |||
CALL_Vertex3fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) | |||
{ | |||
PRE_LOOPBACK( Vertex4f ); | |||
GL_CALL(Vertex4f)( x, y, z, w ); | |||
CALL_Vertex4f(GET_DISPATCH(), ( x, y, z, w )); | |||
} | |||
static void GLAPIENTRY TAG(Vertex4fv)( const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( Vertex4fv ); | |||
GL_CALL(Vertex4fv)( v ); | |||
CALL_Vertex4fv(GET_DISPATCH(), ( v )); | |||
} | |||
static void GLAPIENTRY TAG(CallList)( GLuint i ) | |||
{ | |||
PRE_LOOPBACK( CallList ); | |||
GL_CALL(CallList)( i ); | |||
CALL_CallList(GET_DISPATCH(), ( i )); | |||
} | |||
static void GLAPIENTRY TAG(CallLists)( GLsizei sz, GLenum type, const GLvoid *v ) | |||
{ | |||
PRE_LOOPBACK( CallLists ); | |||
GL_CALL(CallLists)( sz, type, v ); | |||
CALL_CallLists(GET_DISPATCH(), ( sz, type, v )); | |||
} | |||
static void GLAPIENTRY TAG(Begin)( GLenum mode ) | |||
{ | |||
PRE_LOOPBACK( Begin ); | |||
GL_CALL(Begin)( mode ); | |||
CALL_Begin(GET_DISPATCH(), ( mode )); | |||
} | |||
static void GLAPIENTRY TAG(End)( void ) | |||
{ | |||
PRE_LOOPBACK( End ); | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
static void GLAPIENTRY TAG(Rectf)( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) | |||
{ | |||
PRE_LOOPBACK( Rectf ); | |||
GL_CALL(Rectf)( x1, y1, x2, y2 ); | |||
CALL_Rectf(GET_DISPATCH(), ( x1, y1, x2, y2 )); | |||
} | |||
static void GLAPIENTRY TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count ) | |||
{ | |||
PRE_LOOPBACK( DrawArrays ); | |||
GL_CALL(DrawArrays)( mode, start, count ); | |||
CALL_DrawArrays(GET_DISPATCH(), ( mode, start, count )); | |||
} | |||
static void GLAPIENTRY TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type, | |||
const GLvoid *indices ) | |||
{ | |||
PRE_LOOPBACK( DrawElements ); | |||
GL_CALL(DrawElements)( mode, count, type, indices ); | |||
CALL_DrawElements(GET_DISPATCH(), ( mode, count, type, indices )); | |||
} | |||
static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start, | |||
@@ -343,117 +345,117 @@ static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start, | |||
GLenum type, const GLvoid *indices ) | |||
{ | |||
PRE_LOOPBACK( DrawRangeElements ); | |||
GL_CALL(DrawRangeElements)( mode, start, end, count, type, indices ); | |||
CALL_DrawRangeElements(GET_DISPATCH(), ( mode, start, end, count, type, indices )); | |||
} | |||
static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 ) | |||
{ | |||
PRE_LOOPBACK( EvalMesh1 ); | |||
GL_CALL(EvalMesh1)( mode, i1, i2 ); | |||
CALL_EvalMesh1(GET_DISPATCH(), ( mode, i1, i2 )); | |||
} | |||
static void GLAPIENTRY TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2, | |||
GLint j1, GLint j2 ) | |||
{ | |||
PRE_LOOPBACK( EvalMesh2 ); | |||
GL_CALL(EvalMesh2)( mode, i1, i2, j1, j2 ); | |||
CALL_EvalMesh2(GET_DISPATCH(), ( mode, i1, i2, j1, j2 )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib1fNV)( GLuint index, GLfloat x ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib1fNV ); | |||
GL_CALL(VertexAttrib1fNV)( index, x ); | |||
CALL_VertexAttrib1fNV(GET_DISPATCH(), ( index, x )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib1fvNV)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib1fvNV ); | |||
GL_CALL(VertexAttrib1fvNV)( index, v ); | |||
CALL_VertexAttrib1fvNV(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib2fNV ); | |||
GL_CALL(VertexAttrib2fNV)( index, x, y ); | |||
CALL_VertexAttrib2fNV(GET_DISPATCH(), ( index, x, y )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib2fvNV)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib2fvNV ); | |||
GL_CALL(VertexAttrib2fvNV)( index, v ); | |||
CALL_VertexAttrib2fvNV(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib3fNV ); | |||
GL_CALL(VertexAttrib3fNV)( index, x, y, z ); | |||
CALL_VertexAttrib3fNV(GET_DISPATCH(), ( index, x, y, z )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib3fvNV)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib3fvNV ); | |||
GL_CALL(VertexAttrib3fvNV)( index, v ); | |||
CALL_VertexAttrib3fvNV(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib4fNV ); | |||
GL_CALL(VertexAttrib4fNV)( index, x, y, z, w ); | |||
CALL_VertexAttrib4fNV(GET_DISPATCH(), ( index, x, y, z, w )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib4fvNV)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib4fvNV ); | |||
GL_CALL(VertexAttrib4fvNV)( index, v ); | |||
CALL_VertexAttrib4fvNV(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib1fARB)( GLuint index, GLfloat x ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib1fARB ); | |||
GL_CALL(VertexAttrib1fARB)( index, x ); | |||
CALL_VertexAttrib1fARB(GET_DISPATCH(), ( index, x )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib1fvARB)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib1fvARB ); | |||
GL_CALL(VertexAttrib1fvARB)( index, v ); | |||
CALL_VertexAttrib1fvARB(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib2fARB ); | |||
GL_CALL(VertexAttrib2fARB)( index, x, y ); | |||
CALL_VertexAttrib2fARB(GET_DISPATCH(), ( index, x, y )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib2fvARB)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib2fvARB ); | |||
GL_CALL(VertexAttrib2fvARB)( index, v ); | |||
CALL_VertexAttrib2fvARB(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib3fARB ); | |||
GL_CALL(VertexAttrib3fARB)( index, x, y, z ); | |||
CALL_VertexAttrib3fARB(GET_DISPATCH(), ( index, x, y, z )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib3fvARB)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib3fvARB ); | |||
GL_CALL(VertexAttrib3fvARB)( index, v ); | |||
CALL_VertexAttrib3fvARB(GET_DISPATCH(), ( index, v )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib4fARB ); | |||
GL_CALL(VertexAttrib4fARB)( index, x, y, z, w ); | |||
CALL_VertexAttrib4fARB(GET_DISPATCH(), ( index, x, y, z, w )); | |||
} | |||
static void GLAPIENTRY TAG(VertexAttrib4fvARB)( GLuint index, const GLfloat *v ) | |||
{ | |||
PRE_LOOPBACK( VertexAttrib4fvARB ); | |||
GL_CALL(VertexAttrib4fvARB)( index, v ); | |||
CALL_VertexAttrib4fvARB(GET_DISPATCH(), ( index, v )); | |||
} | |||
@@ -42,6 +42,8 @@ | |||
#include "arbprogparse.h" | |||
#include "grammar_mesa.h" | |||
#include "dispatch.h" | |||
#ifndef __extension__ | |||
#if !defined(__GNUC__) || (__GNUC__ < 2) || \ | |||
((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) | |||
@@ -3884,7 +3886,8 @@ static int set_reg8 (GLcontext *ctx, grammar id, const byte *name, byte value) | |||
static int extension_is_supported (const GLubyte *ext) | |||
{ | |||
const GLubyte *extensions = GL_CALL(GetString)(GL_EXTENSIONS); | |||
GET_CURRENT_CONTEXT(ctx); | |||
const GLubyte *extensions = CALL_GetString(GET_DISPATCH(), (GL_EXTENSIONS)); | |||
const GLubyte *end = extensions + _mesa_strlen ((const char *) extensions); | |||
const GLint ext_len = (GLint)_mesa_strlen ((const char *) ext); | |||
@@ -43,6 +43,7 @@ | |||
#include "t_save_api.h" | |||
#include "t_context.h" | |||
#include "t_pipeline.h" | |||
#include "dispatch.h" | |||
static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start, | |||
GLsizei count ) | |||
@@ -52,10 +53,10 @@ static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start, | |||
assert(!ctx->CompileFlag); | |||
assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1); | |||
GL_CALL(Begin)(mode); | |||
CALL_Begin(GET_DISPATCH(), (mode)); | |||
for (i = 0; i < count; i++) | |||
GL_CALL(ArrayElement)( start + i ); | |||
GL_CALL(End)(); | |||
CALL_ArrayElement(GET_DISPATCH(), ( start + i )); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -69,11 +70,11 @@ static void fallback_drawelements( GLcontext *ctx, GLenum mode, GLsizei count, | |||
/* Here, indices will already reflect the buffer object if active */ | |||
GL_CALL(Begin)(mode); | |||
CALL_Begin(GET_DISPATCH(), (mode)); | |||
for (i = 0 ; i < count ; i++) { | |||
GL_CALL(ArrayElement)( indices[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( indices[i] )); | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -77,6 +77,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
#include "api_arrayelt.h" | |||
#include "vtxfmt.h" | |||
#include "t_save_api.h" | |||
#include "dispatch.h" | |||
/* | |||
* NOTE: Old 'parity' issue is gone, but copying can still be | |||
@@ -1212,56 +1213,56 @@ static void GLAPIENTRY _save_EvalCoord1f( GLfloat u ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->EvalCoord1f( u ); | |||
CALL_EvalCoord1f(ctx->Save, ( u )); | |||
} | |||
static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->EvalCoord1fv( v ); | |||
CALL_EvalCoord1fv(ctx->Save, ( v )); | |||
} | |||
static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->EvalCoord2f( u, v ); | |||
CALL_EvalCoord2f(ctx->Save, ( u, v )); | |||
} | |||
static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->EvalCoord2fv( v ); | |||
CALL_EvalCoord2fv(ctx->Save, ( v )); | |||
} | |||
static void GLAPIENTRY _save_EvalPoint1( GLint i ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->EvalPoint1( i ); | |||
CALL_EvalPoint1(ctx->Save, ( i )); | |||
} | |||
static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->EvalPoint2( i, j ); | |||
CALL_EvalPoint2(ctx->Save, ( i, j )); | |||
} | |||
static void GLAPIENTRY _save_CallList( GLuint l ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->CallList( l ); | |||
CALL_CallList(ctx->Save, ( l )); | |||
} | |||
static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
FALLBACK(ctx); | |||
ctx->Save->CallLists( n, type, v ); | |||
CALL_CallLists(ctx->Save, ( n, type, v )); | |||
} | |||
@@ -1383,11 +1384,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 ); | |||
GL_CALL(Vertex2f)( x1, y1 ); | |||
GL_CALL(Vertex2f)( x2, y1 ); | |||
GL_CALL(Vertex2f)( x2, y2 ); | |||
GL_CALL(Vertex2f)( x1, y2 ); | |||
GL_CALL(End)(); | |||
CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 )); | |||
CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 )); | |||
CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 )); | |||
CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 )); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -1401,8 +1402,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++) | |||
GL_CALL(ArrayElement)(start + i); | |||
GL_CALL(End)(); | |||
CALL_ArrayElement(GET_DISPATCH(), (start + i)); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
@@ -1420,22 +1421,22 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum | |||
switch (type) { | |||
case GL_UNSIGNED_BYTE: | |||
for (i = 0 ; i < count ; i++) | |||
GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] )); | |||
break; | |||
case GL_UNSIGNED_SHORT: | |||
for (i = 0 ; i < count ; i++) | |||
GL_CALL(ArrayElement)( ((GLushort *)indices)[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] )); | |||
break; | |||
case GL_UNSIGNED_INT: | |||
for (i = 0 ; i < count ; i++) | |||
GL_CALL(ArrayElement)( ((GLuint *)indices)[i] ); | |||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] )); | |||
break; | |||
default: | |||
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" ); | |||
break; | |||
} | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, |
@@ -35,6 +35,7 @@ | |||
#include "mtypes.h" | |||
#include "t_context.h" | |||
#include "t_save_api.h" | |||
#include "dispatch.h" | |||
/* If someone compiles a display list like: | |||
* glBegin(Triangles) | |||
@@ -70,22 +71,22 @@ typedef void (*attr_func)( GLcontext *ctx, GLint target, const GLfloat * ); | |||
/* Wrapper functions in case glVertexAttrib*fvNV doesn't exist */ | |||
static void VertexAttrib1fvNV(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib1fvNV(target, v); | |||
CALL_VertexAttrib1fvNV(ctx->Exec, (target, v)); | |||
} | |||
static void VertexAttrib2fvNV(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib2fvNV(target, v); | |||
CALL_VertexAttrib2fvNV(ctx->Exec, (target, v)); | |||
} | |||
static void VertexAttrib3fvNV(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib3fvNV(target, v); | |||
CALL_VertexAttrib3fvNV(ctx->Exec, (target, v)); | |||
} | |||
static void VertexAttrib4fvNV(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib4fvNV(target, v); | |||
CALL_VertexAttrib4fvNV(ctx->Exec, (target, v)); | |||
} | |||
static attr_func vert_attrfunc[4] = { | |||
@@ -98,22 +99,22 @@ static attr_func vert_attrfunc[4] = { | |||
static void VertexAttrib1fvARB(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib1fvARB(target, v); | |||
CALL_VertexAttrib1fvARB(ctx->Exec, (target, v)); | |||
} | |||
static void VertexAttrib2fvARB(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib2fvARB(target, v); | |||
CALL_VertexAttrib2fvARB(ctx->Exec, (target, v)); | |||
} | |||
static void VertexAttrib3fvARB(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib3fvARB(target, v); | |||
CALL_VertexAttrib3fvARB(ctx->Exec, (target, v)); | |||
} | |||
static void VertexAttrib4fvARB(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
ctx->Exec->VertexAttrib4fvARB(target, v); | |||
CALL_VertexAttrib4fvARB(ctx->Exec, (target, v)); | |||
} | |||
static attr_func vert_attrfunc_arb[4] = { | |||
@@ -133,10 +134,10 @@ static void mat_attr1fv( GLcontext *ctx, GLint target, const GLfloat *v ) | |||
{ | |||
switch (target) { | |||
case _TNL_ATTRIB_MAT_FRONT_SHININESS: | |||
ctx->Exec->Materialfv( GL_FRONT, GL_SHININESS, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_SHININESS, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_BACK_SHININESS: | |||
ctx->Exec->Materialfv( GL_BACK, GL_SHININESS, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_SHININESS, v )); | |||
break; | |||
} | |||
} | |||
@@ -146,10 +147,10 @@ static void mat_attr3fv( GLcontext *ctx, GLint target, const GLfloat *v ) | |||
{ | |||
switch (target) { | |||
case _TNL_ATTRIB_MAT_FRONT_INDEXES: | |||
ctx->Exec->Materialfv( GL_FRONT, GL_COLOR_INDEXES, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_COLOR_INDEXES, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_BACK_INDEXES: | |||
ctx->Exec->Materialfv( GL_BACK, GL_COLOR_INDEXES, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_COLOR_INDEXES, v )); | |||
break; | |||
} | |||
} | |||
@@ -159,28 +160,28 @@ static void mat_attr4fv( GLcontext *ctx, GLint target, const GLfloat *v ) | |||
{ | |||
switch (target) { | |||
case _TNL_ATTRIB_MAT_FRONT_EMISSION: | |||
ctx->Exec->Materialfv( GL_FRONT, GL_EMISSION, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_EMISSION, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_BACK_EMISSION: | |||
ctx->Exec->Materialfv( GL_BACK, GL_EMISSION, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_EMISSION, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_FRONT_AMBIENT: | |||
ctx->Exec->Materialfv( GL_FRONT, GL_AMBIENT, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_AMBIENT, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_BACK_AMBIENT: | |||
ctx->Exec->Materialfv( GL_BACK, GL_AMBIENT, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_AMBIENT, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_FRONT_DIFFUSE: | |||
ctx->Exec->Materialfv( GL_FRONT, GL_DIFFUSE, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_DIFFUSE, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_BACK_DIFFUSE: | |||
ctx->Exec->Materialfv( GL_BACK, GL_DIFFUSE, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_DIFFUSE, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_FRONT_SPECULAR: | |||
ctx->Exec->Materialfv( GL_FRONT, GL_SPECULAR, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_FRONT, GL_SPECULAR, v )); | |||
break; | |||
case _TNL_ATTRIB_MAT_BACK_SPECULAR: | |||
ctx->Exec->Materialfv( GL_BACK, GL_SPECULAR, v ); | |||
CALL_Materialfv(ctx->Exec, ( GL_BACK, GL_SPECULAR, v )); | |||
break; | |||
} | |||
} | |||
@@ -197,13 +198,13 @@ static attr_func mat_attrfunc[4] = { | |||
static void index_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
(void) target; | |||
ctx->Exec->Indexf(v[0]); | |||
CALL_Indexf(ctx->Exec, (v[0])); | |||
} | |||
static void edgeflag_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v) | |||
{ | |||
(void) target; | |||
ctx->Exec->EdgeFlag((GLboolean)(v[0] == 1.0)); | |||
CALL_EdgeFlag(ctx->Exec, ((GLboolean)(v[0] == 1.0))); | |||
} | |||
struct loopback_attr { | |||
@@ -228,7 +229,7 @@ static void loopback_prim( GLcontext *ctx, | |||
GLuint k; | |||
if (prim->mode & PRIM_BEGIN) { | |||
GL_CALL(Begin)( prim->mode & PRIM_MODE_MASK ); | |||
CALL_Begin(GET_DISPATCH(), ( prim->mode & PRIM_MODE_MASK )); | |||
} | |||
else { | |||
assert(i == 0); | |||
@@ -253,7 +254,7 @@ static void loopback_prim( GLcontext *ctx, | |||
} | |||
if (prim->mode & PRIM_END) { | |||
GL_CALL(End)(); | |||
CALL_End(GET_DISPATCH(), ()); | |||
} | |||
else { | |||
assert (i == list->prim_count-1); |
@@ -43,6 +43,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
#include "t_vtx_api.h" | |||
#include "simple_list.h" | |||
#include "dispatch.h" | |||
static void reset_attrfv( TNLcontext *tnl ); | |||
static tnl_attrfv_func choose[_TNL_MAX_ATTR_CODEGEN+1][4]; /* +1 for ERROR_ATTRIB */ | |||
@@ -749,7 +751,7 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode ) | |||
if (!(tnl->Driver.NotifyBegin && | |||
tnl->Driver.NotifyBegin( ctx, mode ))) | |||
ctx->Exec->Begin(mode); | |||
CALL_Begin(ctx->Exec, (mode)); | |||
return; | |||
} | |||
@@ -31,6 +31,7 @@ | |||
#include "macros.h" | |||
#include "math/m_eval.h" | |||
#include "t_vtx_api.h" | |||
#include "dispatch.h" | |||
static void clear_active_eval1( TNLcontext *tnl, GLuint attr ) | |||
@@ -165,9 +166,9 @@ void _tnl_do_EvalCoord1f(GLcontext* ctx, GLfloat u) | |||
map->Order); | |||
if (tnl->vtx.eval.map1[0].sz == 4) | |||
GL_CALL(Vertex4fv)( vertex ); | |||
CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); | |||
else | |||
GL_CALL(Vertex3fv)( vertex ); | |||
CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); | |||
} | |||
} | |||
@@ -244,9 +245,9 @@ void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ) | |||
} | |||
if (tnl->vtx.attrsz[0] == 4) | |||
GL_CALL(Vertex4fv)( vertex ); | |||
CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); | |||
else | |||
GL_CALL(Vertex3fv)( vertex ); | |||
CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); | |||
} | |||
} | |||
@@ -287,12 +287,12 @@ static void TAG(choose_Color3f)( GLfloat r, GLfloat g, GLfloat b ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color3f = TAG(ColorMaterial3f); | |||
SET_Color3f(ctx->Exec, TAG(ColorMaterial3f)); | |||
} else { | |||
ctx->Exec->Color3f = _mesa_noop_Color3f; | |||
SET_Color3f(ctx->Exec, _mesa_noop_Color3f); | |||
} | |||
} else { | |||
ctx->Exec->Color3f = TAG(Color3f); | |||
SET_Color3f(ctx->Exec, TAG(Color3f)); | |||
} | |||
glColor3f( r, g, b ); | |||
} | |||
@@ -303,12 +303,12 @@ static void TAG(choose_Color3fv)( const GLfloat *v ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color3fv = TAG(ColorMaterial3fv); | |||
SET_Color3fv(ctx->Exec, TAG(ColorMaterial3fv)); | |||
} else { | |||
ctx->Exec->Color3fv = _mesa_noop_Color3fv; | |||
SET_Color3fv(ctx->Exec, _mesa_noop_Color3fv); | |||
} | |||
} else { | |||
ctx->Exec->Color3fv = TAG(Color3fv); | |||
SET_Color3fv(ctx->Exec, TAG(Color3fv)); | |||
} | |||
glColor3fv( v ); | |||
} | |||
@@ -319,12 +319,12 @@ static void TAG(choose_Color3ub)( GLubyte r, GLubyte g, GLubyte b ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color3ub = TAG(ColorMaterial3ub); | |||
SET_Color3ub(ctx->Exec, TAG(ColorMaterial3ub)); | |||
} else { | |||
ctx->Exec->Color3ub = _mesa_noop_Color3ub; | |||
SET_Color3ub(ctx->Exec, _mesa_noop_Color3ub); | |||
} | |||
} else { | |||
ctx->Exec->Color3ub = TAG(Color3ub); | |||
SET_Color3ub(ctx->Exec, TAG(Color3ub)); | |||
} | |||
glColor3ub( r, g, b ); | |||
} | |||
@@ -335,12 +335,12 @@ static void TAG(choose_Color3ubv)( const GLubyte *v ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color3ubv = TAG(ColorMaterial3ubv); | |||
SET_Color3ubv(ctx->Exec, TAG(ColorMaterial3ubv)); | |||
} else { | |||
ctx->Exec->Color3ubv = _mesa_noop_Color3ubv; | |||
SET_Color3ubv(ctx->Exec, _mesa_noop_Color3ubv); | |||
} | |||
} else { | |||
ctx->Exec->Color3ubv = TAG(Color3ubv); | |||
SET_Color3ubv(ctx->Exec, TAG(Color3ubv)); | |||
} | |||
glColor3ubv( v ); | |||
} | |||
@@ -351,12 +351,12 @@ static void TAG(choose_Color4f)( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color4f = TAG(ColorMaterial4f); | |||
SET_Color4f(ctx->Exec, TAG(ColorMaterial4f)); | |||
} else { | |||
ctx->Exec->Color4f = _mesa_noop_Color4f; | |||
SET_Color4f(ctx->Exec, _mesa_noop_Color4f); | |||
} | |||
} else { | |||
ctx->Exec->Color4f = TAG(Color4f); | |||
SET_Color4f(ctx->Exec, TAG(Color4f)); | |||
} | |||
glColor4f( r, g, b, a ); | |||
} | |||
@@ -367,12 +367,12 @@ static void TAG(choose_Color4fv)( const GLfloat *v ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color4fv = TAG(ColorMaterial4fv); | |||
SET_Color4fv(ctx->Exec, TAG(ColorMaterial4fv)); | |||
} else { | |||
ctx->Exec->Color4fv = _mesa_noop_Color4fv; | |||
SET_Color4fv(ctx->Exec, _mesa_noop_Color4fv); | |||
} | |||
} else { | |||
ctx->Exec->Color4fv = TAG(Color4fv); | |||
SET_Color4fv(ctx->Exec, TAG(Color4fv)); | |||
} | |||
glColor4fv( v ); | |||
} | |||
@@ -383,12 +383,12 @@ static void TAG(choose_Color4ub)( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color4ub = TAG(ColorMaterial4ub); | |||
SET_Color4ub(ctx->Exec, TAG(ColorMaterial4ub)); | |||
} else { | |||
ctx->Exec->Color4ub = _mesa_noop_Color4ub; | |||
SET_Color4ub(ctx->Exec, _mesa_noop_Color4ub); | |||
} | |||
} else { | |||
ctx->Exec->Color4ub = TAG(Color4ub); | |||
SET_Color4ub(ctx->Exec, TAG(Color4ub)); | |||
} | |||
glColor4ub( r, g, b, a ); | |||
} | |||
@@ -399,12 +399,12 @@ static void TAG(choose_Color4ubv)( const GLubyte *v ) | |||
if ( ctx->Light.Enabled ) { | |||
if ( ctx->Light.ColorMaterialEnabled ) { | |||
ctx->Exec->Color4ubv = TAG(ColorMaterial4ubv); | |||
SET_Color4ubv(ctx->Exec, TAG(ColorMaterial4ubv)); | |||
} else { | |||
ctx->Exec->Color4ubv = _mesa_noop_Color4ubv; | |||
SET_Color4ubv(ctx->Exec, _mesa_noop_Color4ubv); | |||
} | |||
} else { | |||
ctx->Exec->Color4ubv = TAG(Color4ubv); | |||
SET_Color4ubv(ctx->Exec, TAG(Color4ubv)); | |||
} | |||
glColor4ubv( v ); | |||
} |