summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-01-27 18:52:40 +0000
committerIan Romanick <[email protected]>2004-01-27 18:52:40 +0000
commitc93105eb9e2499efb237fd89dba0cebd48f18375 (patch)
treee105eeceae3f57be1b583e51957d6f39038fed34 /src/mesa/drivers/dri
parentdd9e6e7e37fbb8c30c8085ed784539d94110aa3e (diff)
Added support for EXT_blend_equation_separate / ATI_blend_equation_separate.
The internal driver interface was also changed to use BlendEquationSeparate instead of BlendEquation.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_state.c11
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_state.c6
-rw-r--r--src/mesa/drivers/dri/i810/i810state.c10
-rw-r--r--src/mesa/drivers/dri/i830/i830_state.c11
-rw-r--r--src/mesa/drivers/dri/mga/mgastate.c6
-rw-r--r--src/mesa/drivers/dri/r128/r128_state.c8
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c9
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_state.c13
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_state.c6
9 files changed, 53 insertions, 27 deletions
diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c
index ddda946f4b0..eef7af4e5d3 100644
--- a/src/mesa/drivers/dri/ffb/ffb_state.c
+++ b/src/mesa/drivers/dri/ffb/ffb_state.c
@@ -93,13 +93,16 @@ static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
}
}
-static void ffbDDBlendEquation(GLcontext *ctx, GLenum mode)
+static void ffbDDBlendEquationSeparate(GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA)
{
#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDBlendEquation: mode(%s)\n", _mesa_lookup_enum_by_nr(mode));
+ fprintf(stderr, "ffbDDBlendEquation: mode(%s)\n",
+ _mesa_lookup_enum_by_nr(modeRGB));
#endif
- FALLBACK( ctx, (mode != GL_FUNC_ADD_EXT), FFB_BADATTR_BLENDEQN);
+ assert( modeRGB == modeA );
+ FALLBACK( ctx, (modeRGB != GL_FUNC_ADD), FFB_BADATTR_BLENDEQN);
}
static void ffbDDBlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB,
@@ -1052,7 +1055,7 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.Enable = ffbDDEnable;
ctx->Driver.AlphaFunc = ffbDDAlphaFunc;
- ctx->Driver.BlendEquation = ffbDDBlendEquation;
+ ctx->Driver.BlendEquationSeparate = ffbDDBlendEquationSeparate;
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 519c707a5ab..813ced474b3 100644
--- a/src/mesa/drivers/dri/gamma/gamma_state.c
+++ b/src/mesa/drivers/dri/gamma/gamma_state.c
@@ -177,10 +177,12 @@ static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
gmesa->new_state |= GAMMA_NEW_ALPHA;
}
-static void gammaDDBlendEquation( GLcontext *ctx, GLenum mode )
+static void gammaDDBlendEquationSeparate( GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
+ assert( modeRGB == modeA );
FLUSH_BATCH( gmesa );
gmesa->new_state |= GAMMA_NEW_ALPHA;
@@ -1689,7 +1691,7 @@ void gammaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.ColorMask = gammaDDColorMask;
ctx->Driver.AlphaFunc = gammaDDAlphaFunc;
- ctx->Driver.BlendEquation = gammaDDBlendEquation;
+ ctx->Driver.BlendEquationSeparate = gammaDDBlendEquationSeparate;
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 9249d0841a0..e00af656f01 100644
--- a/src/mesa/drivers/dri/i810/i810state.c
+++ b/src/mesa/drivers/dri/i810/i810state.c
@@ -75,10 +75,14 @@ static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
imesa->Setup[I810_CTXREG_ZA] |= a;
}
-static void i810BlendEquation(GLcontext *ctx, GLenum mode)
+static void i810BlendEquationSeparate(GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA)
{
+ assert( modeRGB == modeA );
+
/* Can only do GL_ADD equation in hardware */
- FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_BLEND_EQ, mode != GL_FUNC_ADD_EXT);
+ FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_BLEND_EQ,
+ modeRGB != GL_FUNC_ADD);
/* BlendEquation sets ColorLogicOpEnabled in an unexpected
* manner.
@@ -961,7 +965,7 @@ void i810InitStateFuncs(GLcontext *ctx)
/* API callbacks
*/
ctx->Driver.AlphaFunc = i810AlphaFunc;
- ctx->Driver.BlendEquation = i810BlendEquation;
+ ctx->Driver.BlendEquationSeparate = i810BlendEquationSeparate;
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 9e8952f09b1..7c80e8b7d27 100644
--- a/src/mesa/drivers/dri/i830/i830_state.c
+++ b/src/mesa/drivers/dri/i830/i830_state.c
@@ -359,19 +359,22 @@ static void i830BlendColor(GLcontext *ctx, const GLfloat color[4])
b);
}
-static void i830BlendEquation(GLcontext *ctx, GLenum mode)
+static void i830BlendEquationSeparate(GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
int func = ENABLE_ALPHA_BLENDFUNC;
if (I830_DEBUG&DEBUG_DRI)
fprintf(stderr, "%s %s\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_lookup_enum_by_nr(modeRGB));
+
+ assert( modeRGB == modeA );
/* This will catch a logicop blend equation */
i830EvalLogicOpBlendState(ctx);
- switch(mode) {
+ switch(modeRGB) {
case GL_FUNC_ADD_EXT:
func |= BLENDFUNC_ADD;
break;
@@ -1643,7 +1646,7 @@ void i830DDInitStateFuncs(GLcontext *ctx)
/* API callbacks
*/
ctx->Driver.AlphaFunc = i830AlphaFunc;
- ctx->Driver.BlendEquation = i830BlendEquation;
+ ctx->Driver.BlendEquationSeparate = i830BlendEquationSeparate;
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 6e039182aed..47c425d7ca3 100644
--- a/src/mesa/drivers/dri/mga/mgastate.c
+++ b/src/mesa/drivers/dri/mga/mgastate.c
@@ -124,8 +124,10 @@ static void updateBlendLogicOp(GLcontext *ctx)
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
-static void mgaDDBlendEquation(GLcontext *ctx, GLenum mode)
+static void mgaDDBlendEquationSeparate(GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA)
{
+ assert( modeRGB == modeA );
updateBlendLogicOp( ctx );
}
@@ -1193,7 +1195,7 @@ void mgaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.Enable = mgaDDEnable;
ctx->Driver.LightModelfv = mgaDDLightModelfv;
ctx->Driver.AlphaFunc = mgaDDAlphaFunc;
- ctx->Driver.BlendEquation = mgaDDBlendEquation;
+ ctx->Driver.BlendEquationSeparate = mgaDDBlendEquationSeparate;
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 0be7b1bfa80..8ed63dafe9a 100644
--- a/src/mesa/drivers/dri/r128/r128_state.c
+++ b/src/mesa/drivers/dri/r128/r128_state.c
@@ -191,10 +191,12 @@ static void r128DDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
rmesa->new_state |= R128_NEW_ALPHA;
}
-static void r128DDBlendEquation( GLcontext *ctx, GLenum mode )
+static void r128DDBlendEquationSeparate( GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
+ assert( modeRGB == modeA );
FLUSH_BATCH( rmesa );
/* BlendEquation sets ColorLogicOpEnabled in an unexpected
@@ -206,7 +208,7 @@ static void r128DDBlendEquation( GLcontext *ctx, GLenum mode )
/* Can only do blend addition, not min, max, subtract, etc. */
FALLBACK( R128_CONTEXT(ctx), R128_FALLBACK_BLEND_EQ,
- mode != GL_FUNC_ADD_EXT);
+ modeRGB != GL_FUNC_ADD);
rmesa->new_state |= R128_NEW_ALPHA;
}
@@ -1187,7 +1189,7 @@ void r128DDInitStateFuncs( GLcontext *ctx )
ctx->Driver.IndexMask = NULL;
ctx->Driver.ColorMask = r128DDColorMask;
ctx->Driver.AlphaFunc = r128DDAlphaFunc;
- ctx->Driver.BlendEquation = r128DDBlendEquation;
+ ctx->Driver.BlendEquationSeparate = r128DDBlendEquationSeparate;
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 2326c75dbdc..2b61098cc9a 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -104,12 +104,15 @@ static void r200AlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc;
}
-static void r200BlendEquation( GLcontext *ctx, GLenum mode )
+static void r200BlendEquationSeparate( GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] & ~R200_COMB_FCN_MASK;
- switch ( mode ) {
+ assert( modeRGB == modeA );
+
+ switch ( modeRGB ) {
case GL_FUNC_ADD:
case GL_LOGIC_OP:
b |= R200_COMB_FCN_ADD_CLAMP;
@@ -2186,7 +2189,7 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->ReadBuffer = r200ReadBuffer;
functions->AlphaFunc = r200AlphaFunc;
- functions->BlendEquation = r200BlendEquation;
+ functions->BlendEquationSeparate = r200BlendEquationSeparate;
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 74e918fd001..25aa3fadfe9 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -102,13 +102,16 @@ static void radeonAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc;
}
-static void radeonBlendEquation( GLcontext *ctx, GLenum mode )
+static void radeonBlendEquationSeparate( GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] & ~RADEON_COMB_FCN_MASK;
GLboolean fallback = GL_FALSE;
- switch ( mode ) {
+ assert( modeRGB == modeA );
+
+ switch ( modeRGB ) {
case GL_FUNC_ADD:
case GL_LOGIC_OP:
b |= RADEON_COMB_FCN_ADD_CLAMP;
@@ -1693,7 +1696,9 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
/* Catch a possible fallback:
*/
if (state) {
- ctx->Driver.BlendEquation( ctx, ctx->Color.BlendEquation );
+ ctx->Driver.BlendEquationSeparate( ctx,
+ ctx->Color.BlendEquationRGB,
+ ctx->Color.BlendEquationA );
ctx->Driver.BlendFuncSeparate( ctx, ctx->Color.BlendSrcRGB,
ctx->Color.BlendDstRGB,
ctx->Color.BlendSrcRGB,
@@ -2186,7 +2191,7 @@ void radeonInitStateFuncs( GLcontext *ctx )
ctx->Driver.ReadBuffer = radeonReadBuffer;
ctx->Driver.AlphaFunc = radeonAlphaFunc;
- ctx->Driver.BlendEquation = radeonBlendEquation;
+ ctx->Driver.BlendEquationSeparate = radeonBlendEquationSeparate;
ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate;
ctx->Driver.ClearColor = radeonClearColor;
ctx->Driver.ClearDepth = radeonClearDepth;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c
index 61306981cca..7ef088ca690 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_state.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c
@@ -267,10 +267,12 @@ static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
fxMesa->new_state |= TDFX_NEW_ALPHA;
}
-static void tdfxDDBlendEquation( GLcontext *ctx, GLenum mode )
+static void tdfxDDBlendEquationSeparate( GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
+ assert( modeRGB == modeA );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_ALPHA;
}
@@ -1387,7 +1389,7 @@ void tdfxDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.ColorMask = tdfxDDColorMask;
ctx->Driver.AlphaFunc = tdfxDDAlphaFunc;
- ctx->Driver.BlendEquation = tdfxDDBlendEquation;
+ ctx->Driver.BlendEquationSeparate = tdfxDDBlendEquationSeparate;
ctx->Driver.BlendFuncSeparate = tdfxDDBlendFuncSeparate;
ctx->Driver.ClearDepth = tdfxDDClearDepth;
ctx->Driver.CullFace = tdfxDDCullFace;