driver->AlphaFunc = NULL;
driver->BlendColor = NULL;
driver->BlendEquation = NULL;
- driver->BlendFunc = NULL;
driver->BlendFuncSeparate = NULL;
driver->ClearColor = NULL;
driver->ClearDepth = NULL;
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:
}
}
-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);
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;
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;
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 )
ctx->Driver.AlphaFunc = gammaDDAlphaFunc;
ctx->Driver.BlendEquation = gammaDDBlendEquation;
- ctx->Driver.BlendFunc = gammaDDBlendFunc;
ctx->Driver.BlendFuncSeparate = gammaDDBlendFuncSeparate;
ctx->Driver.ClearDepth = gammaDDClearDepth;
ctx->Driver.CullFace = gammaDDCullFace;
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;
}
-/* 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)
{
*/
ctx->Driver.AlphaFunc = i810AlphaFunc;
ctx->Driver.BlendEquation = i810BlendEquation;
- ctx->Driver.BlendFunc = i810BlendFunc;
ctx->Driver.BlendFuncSeparate = i810BlendFuncSeparate;
ctx->Driver.ClearColor = i810ClearColor;
ctx->Driver.ColorMask = i810ColorMask;
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 )
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);
}
*/
ctx->Driver.AlphaFunc = i830AlphaFunc;
ctx->Driver.BlendEquation = i830BlendEquation;
- ctx->Driver.BlendFunc = i830BlendFunc;
ctx->Driver.BlendFuncSeparate = i830BlendFuncSeparate;
ctx->Driver.BlendColor = i830BlendColor;
ctx->Driver.ClearColor = i830ClearColor;
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;
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
*/
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;
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 )
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;
}
}
-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] &
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
functions->AlphaFunc = r200AlphaFunc;
functions->BlendEquation = r200BlendEquation;
- functions->BlendFunc = r200BlendFunc;
functions->BlendFuncSeparate = r200BlendFuncSeparate;
functions->ClearColor = r200ClearColor;
functions->ClearDepth = NULL;
}
}
-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] &
}
}
-static void radeonBlendFuncSeparate( GLcontext *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA )
-{
- radeonBlendFunc( ctx, sfactorRGB, dfactorRGB );
-}
-
/* =============================================================
* Depth testing
*/
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 );
ctx->Driver.AlphaFunc = radeonAlphaFunc;
ctx->Driver.BlendEquation = radeonBlendEquation;
- ctx->Driver.BlendFunc = radeonBlendFunc;
ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate;
ctx->Driver.ClearColor = radeonClearColor;
ctx->Driver.ClearDepth = radeonClearDepth;
}
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);
/* blending enable */
current->hwDstSrcBlend = 0x10000; /* Default destination alpha */
- switch (dfactor)
+ switch (dfactorRGB)
{
case GL_ZERO:
current->hwDstSrcBlend |= SiS_D_ZERO;
break;
}
- switch (sfactor)
+ switch (sfactorRGB)
{
case GL_ZERO:
current->hwDstSrcBlend |= SiS_S_ZERO;
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;
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 );
*/
}
-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
*/
ctx->Driver.AlphaFunc = tdfxDDAlphaFunc;
ctx->Driver.BlendEquation = tdfxDDBlendEquation;
- ctx->Driver.BlendFunc = tdfxDDBlendFunc;
ctx->Driver.BlendFuncSeparate = tdfxDDBlendFuncSeparate;
ctx->Driver.ClearDepth = tdfxDDClearDepth;
ctx->Driver.CullFace = tdfxDDCullFace;
ctx->Driver.IsTextureResident = fxDDIsTextureResident;
ctx->Driver.UpdateTexturePalette = fxDDTexPalette;
ctx->Driver.AlphaFunc = fxDDAlphaFunc;
- ctx->Driver.BlendFunc = fxDDBlendFunc;
ctx->Driver.BlendFuncSeparate = fxDDBlendFuncSeparate;
ctx->Driver.BlendEquation = fxDDBlendEquation;
ctx->Driver.DepthFunc = fxDDDepthFunc;
extern void fxDDEnable(GLcontext *, GLenum, GLboolean);
extern void fxDDAlphaFunc(GLcontext *, GLenum, GLfloat);
-extern void fxDDBlendFunc(GLcontext *, GLenum, GLenum);
extern void fxDDBlendFuncSeparate(GLcontext *, GLenum, GLenum, GLenum, GLenum);
extern void fxDDBlendEquation(GLcontext *, GLenum);
extern void fxDDDepthMask(GLcontext *, GLboolean);
}
void
-fxDDBlendFunc(GLcontext * ctx, GLenum sfactor, GLenum dfactor)
-{
- fxDDBlendFuncSeparate(ctx, sfactor, dfactor, sfactor, dfactor);
-}
-
-void
fxDDBlendEquation(GLcontext * ctx, GLenum mode)
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
* \param sfactor source factor operator.
* \param dfactor destination factor operator.
*
- * \sa glBlendFunc().
- *
- * Verifies the parameters and updates gl_colorbuffer_attrib. On a change,
- * flushes the vertices and notifies the driver via
- * dd_function_table::BlendFunc callback.
+ * \sa glBlendFunc, glBlendFuncSeparateEXT
+ *
+ * Swizzles the inputs and calls \c glBlendFuncSeparateEXT. This is done
+ * using the \c CurrentDispatch table in the context, so this same function
+ * can be used while compiling display lists. Therefore, there is no need
+ * for the display list code to save and restore this function.
*/
void GLAPIENTRY
_mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
{
-
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glBlendFunc %s %s\n",
- _mesa_lookup_enum_by_nr(sfactor),
- _mesa_lookup_enum_by_nr(dfactor));
-
- switch (sfactor) {
- case GL_SRC_COLOR:
- case GL_ONE_MINUS_SRC_COLOR:
- if (!ctx->Extensions.NV_blend_square) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glBlendFunc(sfactor)" );
- return;
- }
- /* fall-through */
- case GL_ZERO:
- case GL_ONE:
- case GL_DST_COLOR:
- case GL_ONE_MINUS_DST_COLOR:
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA:
- case GL_DST_ALPHA:
- case GL_ONE_MINUS_DST_ALPHA:
- case GL_SRC_ALPHA_SATURATE:
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glBlendFunc(sfactor)" );
- return;
- }
-
- switch (dfactor) {
- case GL_DST_COLOR:
- case GL_ONE_MINUS_DST_COLOR:
- if (!ctx->Extensions.NV_blend_square) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glBlendFunc(dfactor)" );
- return;
- }
- /* fall-through */
- case GL_ZERO:
- case GL_ONE:
- case GL_SRC_COLOR:
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA:
- case GL_DST_ALPHA:
- case GL_ONE_MINUS_DST_ALPHA:
- case GL_CONSTANT_COLOR:
- case GL_ONE_MINUS_CONSTANT_COLOR:
- case GL_CONSTANT_ALPHA:
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glBlendFunc(dfactor)" );
- return;
- }
- if (ctx->Color.BlendDstRGB == dfactor &&
- ctx->Color.BlendSrcRGB == sfactor &&
- ctx->Color.BlendDstA == dfactor &&
- ctx->Color.BlendSrcA == sfactor)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.BlendDstRGB = ctx->Color.BlendDstA = dfactor;
- ctx->Color.BlendSrcRGB = ctx->Color.BlendSrcA = sfactor;
-
- if (ctx->Driver.BlendFunc)
- ctx->Driver.BlendFunc( ctx, sfactor, dfactor );
+ (*ctx->CurrentDispatch->BlendFuncSeparateEXT)( sfactor, dfactor,
+ sfactor, dfactor );
}
-#if _HAVE_FULL_GL
-
/**
* Process GL_EXT_blend_func_separate().
*
}
+#if _HAVE_FULL_GL
+
/* This is really an extension function! */
void GLAPIENTRY
_mesa_BlendEquation( GLenum mode )
/** Set the blend equation */
void (*BlendEquation)(GLcontext *ctx, GLenum mode);
/** Specify pixel arithmetic */
- void (*BlendFunc)(GLcontext *ctx, GLenum sfactor, GLenum dfactor);
void (*BlendFuncSeparate)(GLcontext *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
OPCODE_BITMAP,
OPCODE_BLEND_COLOR,
OPCODE_BLEND_EQUATION,
- OPCODE_BLEND_FUNC,
OPCODE_BLEND_FUNC_SEPARATE,
OPCODE_CALL_LIST,
OPCODE_CALL_LIST_OFFSET,
InstSize[OPCODE_BITMAP] = 8;
InstSize[OPCODE_BLEND_COLOR] = 5;
InstSize[OPCODE_BLEND_EQUATION] = 2;
- InstSize[OPCODE_BLEND_FUNC] = 3;
InstSize[OPCODE_BLEND_FUNC_SEPARATE] = 5;
InstSize[OPCODE_CALL_LIST] = 2;
InstSize[OPCODE_CALL_LIST_OFFSET] = 3;
}
-static void GLAPIENTRY save_BlendFunc( GLenum sfactor, GLenum dfactor )
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BLEND_FUNC, 2 );
- if (n) {
- n[1].e = sfactor;
- n[2].e = dfactor;
- }
- if (ctx->ExecuteFlag) {
- (*ctx->Exec->BlendFunc)( sfactor, dfactor );
- }
-}
-
-
static void GLAPIENTRY save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA)
{
case OPCODE_BLEND_EQUATION:
(*ctx->Exec->BlendEquation)( n[1].e );
break;
- case OPCODE_BLEND_FUNC:
- (*ctx->Exec->BlendFunc)( n[1].e, n[2].e );
- break;
case OPCODE_BLEND_FUNC_SEPARATE:
(*ctx->Exec->BlendFuncSeparateEXT)(n[1].e, n[2].e, n[3].e, n[4].e);
break;
table->Accum = save_Accum;
table->AlphaFunc = save_AlphaFunc;
table->Bitmap = save_Bitmap;
- table->BlendFunc = save_BlendFunc;
table->CallList = _mesa_save_CallList;
table->CallLists = _mesa_save_CallLists;
table->Clear = save_Clear;