From 7a9c7c1133d5cf17d032c8568e8f040a7c171a72 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 2 Nov 2006 17:51:04 +0000 Subject: Use RGBA_LOGICOP_ENABLED() instead of ctx->Color._LogicOpEnabled since we often need to check for this condition before the later field has been computed. Fixes logicop bug #8860. --- src/mesa/drivers/dri/mga/mgastate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/mga/mgastate.c') diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index 71a1150d02..3cbffdde7d 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -113,14 +113,15 @@ static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) static void updateBlendLogicOp(GLcontext *ctx) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); + GLboolean logicOp = RGBA_LOGICOP_ENABLED(ctx); MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); mmesa->hw.blend_func_enable = - (ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled) ? ~0 : 0; + (ctx->Color.BlendEnabled && !logicOp) ? ~0 : 0; FALLBACK( ctx, MGA_FALLBACK_BLEND, - ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled && + ctx->Color.BlendEnabled && !logicOp && mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } @@ -195,7 +196,7 @@ static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, mmesa->hw.blend_func = (src | dst); FALLBACK( ctx, MGA_FALLBACK_BLEND, - ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled && + ctx->Color.BlendEnabled && !RGBA_LOGICOP_ENALBED(ctx) && mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } @@ -965,7 +966,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa ) ? mmesa->hw.zmode : (DC_zmode_nozcmp | DC_atype_i); mmesa->setup.dwgctl &= DC_bop_MASK; - mmesa->setup.dwgctl |= (ctx->Color._LogicOpEnabled) + mmesa->setup.dwgctl |= RGBA_LOGICOP_ENABLED(ctx) ? mmesa->hw.rop : mgarop_NoBLK[ GL_COPY & 0x0f ]; mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK -- cgit v1.2.3