summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/api_arrayelt.c28
-rw-r--r--src/mesa/main/vtxfmt.c6
-rw-r--r--src/mesa/main/vtxfmt_tmp.h1
3 files changed, 33 insertions, 2 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 71becd3533b..41adc1d1d29 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -145,6 +145,19 @@ static const int NormalFuncs[8] = {
_gloffset_Normal3dv,
};
+#if defined(IN_DRI_DRIVER)
+static int SecondaryColorFuncs[8];
+static int FogCoordFuncs[8] = {
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ 0,
+ 0,
+};
+#else
static const int SecondaryColorFuncs[8] = {
_gloffset_SecondaryColor3bvEXT,
_gloffset_SecondaryColor3ubvEXT,
@@ -166,6 +179,7 @@ static const int FogCoordFuncs[8] = {
_gloffset_FogCoordfvEXT,
_gloffset_FogCoorddvEXT
};
+#endif
/**********************************************************************/
@@ -608,6 +622,20 @@ GLboolean _ae_create_context( GLcontext *ctx )
if (ctx->aelt_context)
return GL_TRUE;
+#if defined(IN_DRI_DRIVER)
+ SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT;
+ SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT;
+ SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT;
+ SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT;
+ SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT;
+ SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT;
+ SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT;
+ SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT;
+
+ FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
+ FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
+#endif
+
ctx->aelt_context = MALLOC( sizeof(AEcontext) );
if (!ctx->aelt_context)
return GL_FALSE;
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index dcb684837c8..b3c63982911 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -48,14 +48,16 @@
#define PRE_LOOPBACK( FUNC ) \
{ \
GET_CURRENT_CONTEXT(ctx); \
- struct gl_tnl_module *tnl = &(ctx->TnlModule); \
+ struct gl_tnl_module * const tnl = &(ctx->TnlModule); \
+ const int tmp_offset = _gloffset_ ## FUNC ; \
\
ASSERT( tnl->Current ); \
ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \
+ ASSERT( tmp_offset >= 0 ); \
\
/* Save the swapped function's dispatch entry so it can be */ \
/* restored later. */ \
- tnl->Swapped[tnl->SwapCount].location = (_glapi_proc *) & (GET_ ## FUNC (ctx->Exec)); \
+ tnl->Swapped[tnl->SwapCount].location = & (((_glapi_proc *)ctx->Exec)[tmp_offset]); \
tnl->Swapped[tnl->SwapCount].function = (_glapi_proc)TAG(FUNC); \
tnl->SwapCount++; \
\
diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h
index 4c9691fc0e6..2a0fdde4665 100644
--- a/src/mesa/main/vtxfmt_tmp.h
+++ b/src/mesa/main/vtxfmt_tmp.h
@@ -30,6 +30,7 @@
#endif
#include "dispatch.h"
+#include "glapioffsets.h"
static void GLAPIENTRY TAG(ArrayElement)( GLint i )
{