summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-01-21 16:08:43 +0000
committerIan Romanick <[email protected]>2004-01-21 16:08:43 +0000
commit20a17e42d7fc9fe65aabe612fe1e513c3103d121 (patch)
treeace6f8746d47c9a1f3f397dceebc6ce58e045c0a /src/mesa/drivers/dri
parent4d36f334c9b3ab6b4e6901802e64ee7391a422ef (diff)
Remove dd_function_table::BlendFunc. All drivers now use
dd_function_table:BlendFuncSeparate. If a driver does not actually support EXT_blend_func_separate, it can assume that the RGB and alpha blend functions are the same.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_state.c29
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_state.c10
-rw-r--r--src/mesa/drivers/dri/i810/i810state.c19
-rw-r--r--src/mesa/drivers/dri/i830/i830_state.c113
-rw-r--r--src/mesa/drivers/dri/mga/mgastate.c12
-rw-r--r--src/mesa/drivers/dri/r128/r128_state.c9
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c12
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_state.c18
-rw-r--r--src/mesa/drivers/dri/sis/sis_state.c10
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_state.c15
10 files changed, 40 insertions, 207 deletions
diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c
index ac753b922a1..ddda946f4b0 100644
--- a/src/mesa/drivers/dri/ffb/ffb_state.c
+++ b/src/mesa/drivers/dri/ffb/ffb_state.c
@@ -102,14 +102,19 @@ static void ffbDDBlendEquation(GLcontext *ctx, GLenum mode)
FALLBACK( ctx, (mode != GL_FUNC_ADD_EXT), FFB_BADATTR_BLENDEQN);
}
-static void ffbDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
+static void ffbDDBlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
+ GLenum dfactorRGB, GLenum sfactorA,
+ GLenum dfactorA)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int blendc = 1 << 4;
#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDBlendFunc: sfactor(%s) dfactor(%s)\n",
- _mesa_lookup_enum_by_nr(sfactor), _mesa_lookup_enum_by_nr(dfactor));
+ fprintf(stderr, "ffbDDBlendFuncSeparate: sRGB(%s) dRGB(%s) sA(%s) dA(%s)\n",
+ _mesa_lookup_enum_by_nr(sfactorRGB),
+ _mesa_lookup_enum_by_nr(dfactorRGB),
+ _mesa_lookup_enum_by_nr(sfactorA),
+ _mesa_lookup_enum_by_nr(dfactorA));
#endif
switch (ctx->Color.BlendSrcRGB) {
case GL_ZERO:
@@ -179,21 +184,6 @@ static void ffbDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
}
}
-static void ffbDDBlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA)
-{
-#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDBlendFuncSeparate: sRGB(%s) dRGB(%s) sA(%s) dA(%s)\n",
- _mesa_lookup_enum_by_nr(sfactorRGB),
- _mesa_lookup_enum_by_nr(dfactorRGB),
- _mesa_lookup_enum_by_nr(sfactorA),
- _mesa_lookup_enum_by_nr(dfactorA));
-#endif
-
- ffbDDBlendFunc(ctx, sfactorRGB, dfactorRGB);
-}
-
static void ffbDDDepthFunc(GLcontext *ctx, GLenum func)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
@@ -817,7 +807,7 @@ static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
if (fmesa->ppc != tmp) {
fmesa->ppc = tmp;
FFB_MAKE_DIRTY(fmesa, FFB_STATE_PPC, 1);
- ffbDDBlendFunc(ctx, 0, 0);
+ ffbDDBlendFuncSeparate(ctx, 0, 0, 0, 0 );
}
break;
@@ -1063,7 +1053,6 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.Enable = ffbDDEnable;
ctx->Driver.AlphaFunc = ffbDDAlphaFunc;
ctx->Driver.BlendEquation = ffbDDBlendEquation;
- ctx->Driver.BlendFunc = ffbDDBlendFunc;
ctx->Driver.BlendFuncSeparate = ffbDDBlendFuncSeparate;
ctx->Driver.DepthFunc = ffbDDDepthFunc;
ctx->Driver.DepthMask = ffbDDDepthMask;
diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c
index 8a767206782..519c707a5ab 100644
--- a/src/mesa/drivers/dri/gamma/gamma_state.c
+++ b/src/mesa/drivers/dri/gamma/gamma_state.c
@@ -186,15 +186,6 @@ static void gammaDDBlendEquation( GLcontext *ctx, GLenum mode )
gmesa->new_state |= GAMMA_NEW_ALPHA;
}
-static void gammaDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
-{
- gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
-
- FLUSH_BATCH( gmesa );
-
- gmesa->new_state |= GAMMA_NEW_ALPHA;
-}
-
static void gammaDDBlendFuncSeparate( GLcontext *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA )
@@ -1699,7 +1690,6 @@ void gammaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.AlphaFunc = gammaDDAlphaFunc;
ctx->Driver.BlendEquation = gammaDDBlendEquation;
- ctx->Driver.BlendFunc = gammaDDBlendFunc;
ctx->Driver.BlendFuncSeparate = gammaDDBlendFuncSeparate;
ctx->Driver.ClearDepth = gammaDDClearDepth;
ctx->Driver.CullFace = gammaDDCullFace;
diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c
index 23432b2c072..9249d0841a0 100644
--- a/src/mesa/drivers/dri/i810/i810state.c
+++ b/src/mesa/drivers/dri/i810/i810state.c
@@ -88,7 +88,9 @@ static void i810BlendEquation(GLcontext *ctx, GLenum mode)
ctx->Color.LogicOp != GL_COPY));
}
-static void i810BlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
+static void i810BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
+ GLenum dfactorRGB, GLenum sfactorA,
+ GLenum dfactorA )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
GLuint a = SDM_UPDATE_SRC_BLEND | SDM_UPDATE_DST_BLEND;
@@ -142,20 +144,6 @@ static void i810BlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
}
-/* Shouldn't be called as the extension is disabled.
- */
-static void i810BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- if (dfactorRGB != dfactorA || sfactorRGB != sfactorA) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glBlendEquation (disabled)");
- }
-
- i810BlendFunc( ctx, sfactorRGB, dfactorRGB );
-}
-
-
static void i810DepthFunc(GLcontext *ctx, GLenum func)
{
@@ -974,7 +962,6 @@ void i810InitStateFuncs(GLcontext *ctx)
*/
ctx->Driver.AlphaFunc = i810AlphaFunc;
ctx->Driver.BlendEquation = i810BlendEquation;
- ctx->Driver.BlendFunc = i810BlendFunc;
ctx->Driver.BlendFuncSeparate = i810BlendFuncSeparate;
ctx->Driver.ClearColor = i810ClearColor;
ctx->Driver.ColorMask = i810ColorMask;
diff --git a/src/mesa/drivers/dri/i830/i830_state.c b/src/mesa/drivers/dri/i830/i830_state.c
index 11f0fd79488..9e8952f09b1 100644
--- a/src/mesa/drivers/dri/i830/i830_state.c
+++ b/src/mesa/drivers/dri/i830/i830_state.c
@@ -398,109 +398,6 @@ static void i830BlendEquation(GLcontext *ctx, GLenum mode)
imesa->Setup[I830_CTXREG_STATE1]);
}
-static void i830BlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
-{
- i830ContextPtr imesa = I830_CONTEXT(ctx);
- int func = (ENABLE_SRC_BLND_FACTOR|ENABLE_DST_BLND_FACTOR);
-
- if (I830_DEBUG&DEBUG_DRI)
- fprintf(stderr, "%s %s %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(sfactor),
- _mesa_lookup_enum_by_nr(dfactor));
-
- switch(sfactor) {
- case GL_ZERO:
- func |= SRC_BLND_FACT(BLENDFACT_ZERO);
- break;
- case GL_SRC_ALPHA:
- func |= SRC_BLND_FACT(BLENDFACT_SRC_ALPHA);
- break;
- case GL_ONE:
- func |= SRC_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_DST_COLOR:
- func |= SRC_BLND_FACT(BLENDFACT_DST_COLR);
- break;
- case GL_ONE_MINUS_DST_COLOR:
- func |= SRC_BLND_FACT(BLENDFACT_INV_DST_COLR);
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- func |= SRC_BLND_FACT(BLENDFACT_INV_SRC_ALPHA);
- break;
- case GL_DST_ALPHA:
- func |= SRC_BLND_FACT(BLENDFACT_DST_ALPHA);
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- func |= SRC_BLND_FACT(BLENDFACT_INV_DST_ALPHA);
- break;
- case GL_SRC_ALPHA_SATURATE:
- func |= SRC_BLND_FACT(BLENDFACT_SRC_ALPHA_SATURATE);
- break;
- case GL_CONSTANT_COLOR_EXT:
- func |= SRC_BLND_FACT(BLENDFACT_CONST_COLOR);
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR_EXT:
- func |= SRC_BLND_FACT(BLENDFACT_INV_CONST_COLOR);
- break;
- case GL_CONSTANT_ALPHA_EXT:
- func |= SRC_BLND_FACT(BLENDFACT_CONST_ALPHA);
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA_EXT:
- func |= SRC_BLND_FACT(BLENDFACT_INV_CONST_ALPHA);
- break;
- default:
- return;
- }
-
- switch(dfactor) {
- case GL_SRC_ALPHA:
- func |= DST_BLND_FACT(BLENDFACT_SRC_ALPHA);
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- func |= DST_BLND_FACT(BLENDFACT_INV_SRC_ALPHA);
- break;
- case GL_ZERO:
- func |= DST_BLND_FACT(BLENDFACT_ZERO);
- break;
- case GL_ONE:
- func |= DST_BLND_FACT(BLENDFACT_ONE);
- break;
- case GL_SRC_COLOR:
- func |= DST_BLND_FACT(BLENDFACT_SRC_COLR);
- break;
- case GL_ONE_MINUS_SRC_COLOR:
- func |= DST_BLND_FACT(BLENDFACT_INV_SRC_COLR);
- break;
- case GL_DST_ALPHA:
- func |= DST_BLND_FACT(BLENDFACT_DST_ALPHA);
- break;
- case GL_ONE_MINUS_DST_ALPHA:
- func |= DST_BLND_FACT(BLENDFACT_INV_DST_ALPHA);
- break;
- case GL_CONSTANT_COLOR_EXT:
- func |= DST_BLND_FACT(BLENDFACT_CONST_COLOR);
- break;
- case GL_ONE_MINUS_CONSTANT_COLOR_EXT:
- func |= DST_BLND_FACT(BLENDFACT_INV_CONST_COLOR);
- break;
- case GL_CONSTANT_ALPHA_EXT:
- func |= DST_BLND_FACT(BLENDFACT_CONST_ALPHA);
- break;
- case GL_ONE_MINUS_CONSTANT_ALPHA_EXT:
- func |= DST_BLND_FACT(BLENDFACT_INV_CONST_ALPHA);
- break;
- default:
- return;
- }
-
- I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
- imesa->Setup[I830_CTXREG_IALPHAB] &= ~SRC_DST_ABLEND_MASK;
- imesa->Setup[I830_CTXREG_STATE1] &= ~SRC_DST_BLND_MASK;
- imesa->Setup[I830_CTXREG_STATE1] |= func;
- /* Insure Independant Alpha Blend is really disabled. */
- i830EvalLogicOpBlendState(ctx);
-}
-
static void i830BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
GLenum dfactorRGB, GLenum sfactorA,
GLenum dfactorA )
@@ -680,12 +577,15 @@ static void i830BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
imesa->Setup[I830_CTXREG_IALPHAB] &= ~SRC_DST_ABLEND_MASK;
- imesa->Setup[I830_CTXREG_IALPHAB] |= funcA;
imesa->Setup[I830_CTXREG_STATE1] &= ~SRC_DST_BLND_MASK;
imesa->Setup[I830_CTXREG_STATE1] |= funcRGB;
- /* Insure Independant Alpha Blend is really enabled if
- * Blending is already enabled.
+ if ( (dfactorRGB != dfactorA) || (sfactorRGB != sfactorA) ) {
+ imesa->Setup[I830_CTXREG_IALPHAB] |= funcA;
+ }
+
+ /* Ensure Independant Alpha Blend is really in the correct state (either
+ * enabled or disabled) if blending is already enabled.
*/
i830EvalLogicOpBlendState(ctx);
}
@@ -1744,7 +1644,6 @@ void i830DDInitStateFuncs(GLcontext *ctx)
*/
ctx->Driver.AlphaFunc = i830AlphaFunc;
ctx->Driver.BlendEquation = i830BlendEquation;
- ctx->Driver.BlendFunc = i830BlendFunc;
ctx->Driver.BlendFuncSeparate = i830BlendFuncSeparate;
ctx->Driver.BlendColor = i830BlendColor;
ctx->Driver.ClearColor = i830ClearColor;
diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c
index becb08a2080..6e039182aed 100644
--- a/src/mesa/drivers/dri/mga/mgastate.c
+++ b/src/mesa/drivers/dri/mga/mgastate.c
@@ -129,7 +129,9 @@ static void mgaDDBlendEquation(GLcontext *ctx, GLenum mode)
updateBlendLogicOp( ctx );
}
-static void mgaDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
+static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
+ GLenum dfactorRGB, GLenum sfactorA,
+ GLenum dfactorA )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
GLuint src;
@@ -195,13 +197,6 @@ static void mgaDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
-static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- mgaDDBlendFunc( ctx, sfactorRGB, dfactorRGB );
-}
-
/* =============================================================
* Depth testing
*/
@@ -1199,7 +1194,6 @@ void mgaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.LightModelfv = mgaDDLightModelfv;
ctx->Driver.AlphaFunc = mgaDDAlphaFunc;
ctx->Driver.BlendEquation = mgaDDBlendEquation;
- ctx->Driver.BlendFunc = mgaDDBlendFunc;
ctx->Driver.BlendFuncSeparate = mgaDDBlendFuncSeparate;
ctx->Driver.DepthFunc = mgaDDDepthFunc;
ctx->Driver.DepthMask = mgaDDDepthMask;
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c
index 110a16a8316..0be7b1bfa80 100644
--- a/src/mesa/drivers/dri/r128/r128_state.c
+++ b/src/mesa/drivers/dri/r128/r128_state.c
@@ -211,14 +211,6 @@ static void r128DDBlendEquation( GLcontext *ctx, GLenum mode )
rmesa->new_state |= R128_NEW_ALPHA;
}
-static void r128DDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
-{
- r128ContextPtr rmesa = R128_CONTEXT(ctx);
-
- FLUSH_BATCH( rmesa );
- rmesa->new_state |= R128_NEW_ALPHA;
-}
-
static void r128DDBlendFuncSeparate( GLcontext *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA )
@@ -1196,7 +1188,6 @@ void r128DDInitStateFuncs( GLcontext *ctx )
ctx->Driver.ColorMask = r128DDColorMask;
ctx->Driver.AlphaFunc = r128DDAlphaFunc;
ctx->Driver.BlendEquation = r128DDBlendEquation;
- ctx->Driver.BlendFunc = r128DDBlendFunc;
ctx->Driver.BlendFuncSeparate = r128DDBlendFuncSeparate;
ctx->Driver.ClearDepth = r128DDClearDepth;
ctx->Driver.CullFace = r128DDCullFace;
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index f9501fd62b3..37da564986d 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -144,7 +144,9 @@ static void r200BlendEquation( GLcontext *ctx, GLenum mode )
}
}
-static void r200BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+static void r200BlendFuncSeparate( GLcontext *ctx,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] &
@@ -251,13 +253,6 @@ static void r200BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b;
}
-static void r200BlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- r200BlendFunc( ctx, sfactorRGB, dfactorRGB );
-}
-
/* =============================================================
* Depth testing
@@ -2156,7 +2151,6 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->AlphaFunc = r200AlphaFunc;
functions->BlendEquation = r200BlendEquation;
- functions->BlendFunc = r200BlendFunc;
functions->BlendFuncSeparate = r200BlendFuncSeparate;
functions->ClearColor = r200ClearColor;
functions->ClearDepth = NULL;
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
index 49d98a67e7f..e71f5adf271 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -138,7 +138,9 @@ static void radeonBlendEquation( GLcontext *ctx, GLenum mode )
}
}
-static void radeonBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+static void radeonBlendFuncSeparate( GLcontext *ctx,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] &
@@ -243,13 +245,6 @@ static void radeonBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
}
}
-static void radeonBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- radeonBlendFunc( ctx, sfactorRGB, dfactorRGB );
-}
-
/* =============================================================
* Depth testing
@@ -1686,8 +1681,10 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
*/
if (state) {
ctx->Driver.BlendEquation( ctx, ctx->Color.BlendEquation );
- ctx->Driver.BlendFunc( ctx, ctx->Color.BlendSrcRGB,
- ctx->Color.BlendDstRGB );
+ ctx->Driver.BlendFuncSeparate( ctx, ctx->Color.BlendSrcRGB,
+ ctx->Color.BlendDstRGB,
+ ctx->Color.BlendSrcRGB,
+ ctx->Color.BlendDstRGB );
}
else {
FALLBACK( rmesa, RADEON_FALLBACK_BLEND_FUNC, GL_FALSE );
@@ -2178,7 +2175,6 @@ void radeonInitStateFuncs( GLcontext *ctx )
ctx->Driver.AlphaFunc = radeonAlphaFunc;
ctx->Driver.BlendEquation = radeonBlendEquation;
- ctx->Driver.BlendFunc = radeonBlendFunc;
ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate;
ctx->Driver.ClearColor = radeonClearColor;
ctx->Driver.ClearDepth = radeonClearDepth;
diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c
index 8ff067f56d7..6dc002171d5 100644
--- a/src/mesa/drivers/dri/sis/sis_state.c
+++ b/src/mesa/drivers/dri/sis/sis_state.c
@@ -98,7 +98,9 @@ sisDDAlphaFunc( GLcontext * ctx, GLenum func, GLfloat ref )
}
static void
-sisDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+sisDDBlendFuncSeparate( GLcontext *ctx,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
@@ -109,7 +111,7 @@ sisDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
/* blending enable */
current->hwDstSrcBlend = 0x10000; /* Default destination alpha */
- switch (dfactor)
+ switch (dfactorRGB)
{
case GL_ZERO:
current->hwDstSrcBlend |= SiS_D_ZERO;
@@ -137,7 +139,7 @@ sisDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
break;
}
- switch (sfactor)
+ switch (sfactorRGB)
{
case GL_ZERO:
current->hwDstSrcBlend |= SiS_S_ZERO;
@@ -847,7 +849,7 @@ void sisDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.AlphaFunc = sisDDAlphaFunc;
ctx->Driver.Bitmap = sisDDBitmap;
- ctx->Driver.BlendFunc = sisDDBlendFunc;
+ ctx->Driver.BlendFuncSeparate = sisDDBlendFuncSeparate;
ctx->Driver.ColorMask = sisDDColorMask;
ctx->Driver.CullFace = sisDDCullFace;
ctx->Driver.DepthMask = sisDDDepthMask;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c
index 53e331f69b6..c5c2cdb6f85 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_state.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c
@@ -275,7 +275,9 @@ static void tdfxDDBlendEquation( GLcontext *ctx, GLenum mode )
fxMesa->new_state |= TDFX_NEW_ALPHA;
}
-static void tdfxDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
+static void tdfxDDBlendFuncSeparate( GLcontext *ctx,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
@@ -289,16 +291,6 @@ static void tdfxDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
*/
}
-static void tdfxDDBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
-
- FLUSH_BATCH( fxMesa );
- fxMesa->new_state |= TDFX_NEW_ALPHA;
-}
-
/* =============================================================
* Stipple
*/
@@ -1396,7 +1388,6 @@ void tdfxDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.AlphaFunc = tdfxDDAlphaFunc;
ctx->Driver.BlendEquation = tdfxDDBlendEquation;
- ctx->Driver.BlendFunc = tdfxDDBlendFunc;
ctx->Driver.BlendFuncSeparate = tdfxDDBlendFuncSeparate;
ctx->Driver.ClearDepth = tdfxDDClearDepth;
ctx->Driver.CullFace = tdfxDDCullFace;