Use RGBA_LOGICOP_ENABLED() instead of ctx->Color._LogicOpEnabled since we often
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 2 Nov 2006 17:51:04 +0000 (17:51 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 2 Nov 2006 17:51:04 +0000 (17:51 +0000)
need to check for this condition before the later field has been computed.
Fixes logicop bug #8860.

src/mesa/drivers/dri/i915/i830_state.c
src/mesa/drivers/dri/i915/i915_state.c
src/mesa/drivers/dri/i915tex/i830_state.c
src/mesa/drivers/dri/i915tex/i915_state.c
src/mesa/drivers/dri/i915tex/i915_vtbl.c
src/mesa/drivers/dri/mga/mgastate.c
src/mesa/drivers/dri/r300/r300_state.c

index ec9dca6231e6e229a46c0050e43ab1513d3ab2f4..9512519010830a7996351ccaec889605fd559249 100644 (file)
@@ -225,7 +225,7 @@ static void i830EvalLogicOpBlendState(GLcontext *ctx)
 
    I830_STATECHANGE(i830, I830_UPLOAD_CTX);
 
-   if (ctx->Color._LogicOpEnabled) {
+   if (RGBA_LOGICOP_ENABLED(ctx)) {
       i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
                                               ENABLE_LOGIC_OP_MASK);
       i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
index db5bb9ddc78271d4ad3c7f21d17bc3849c0dd25d..3cec6a2ddfc300d6fba7a7bad9157ab933465060 100644 (file)
@@ -141,7 +141,7 @@ static void i915EvalLogicOpBlendState(GLcontext *ctx)
 
    I915_STATECHANGE(i915, I915_UPLOAD_CTX);
 
-   if (ctx->Color._LogicOpEnabled) {
+   if (RGBA_LOGICOP_ENABLED(ctx)) {
       i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE;
       i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
    } else {
index 83d82882a6545ad73461ac02c7b154b6bfe1bd19..c0673363f32a23527ba6b6a7f125ddf6f9b2f4a2 100644 (file)
@@ -231,7 +231,7 @@ i830EvalLogicOpBlendState(GLcontext * ctx)
 
    I830_STATECHANGE(i830, I830_UPLOAD_CTX);
 
-   if (ctx->Color._LogicOpEnabled) {
+   if (RGBA_LOGICOP_ENABLED(ctx)) {
       i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
                                                   ENABLE_LOGIC_OP_MASK);
       i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
index d68801d3f94b246d59ef7f5a0f371c92f567f324..2f5a30787ee182721ccadb8f22c3b0829767dcb6 100644 (file)
@@ -144,7 +144,7 @@ i915EvalLogicOpBlendState(GLcontext * ctx)
 
    I915_STATECHANGE(i915, I915_UPLOAD_CTX);
 
-   if (ctx->Color._LogicOpEnabled) {
+   if (RGBA_LOGICOP_ENABLED(ctx)) {
       i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE;
       i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
    }
index 827990d2cfbd19ba8bf09385df6034384816415a..52db9a95e6b5e41408736d643d62384a5d80fa77 100644 (file)
@@ -314,6 +314,7 @@ i915_emit_state(struct intel_context *intel)
    if (dirty & I915_UPLOAD_CTX) {
       if (INTEL_DEBUG & DEBUG_STATE)
          fprintf(stderr, "I915_UPLOAD_CTX:\n");
+
       emit(intel, state->Ctx, sizeof(state->Ctx));
    }
 
index 71a1150d0262ad8e7bac3ba6fb5d38b5af4a56f7..3cbffdde7d1496145f05643a4c2da103f894d202 100644 (file)
@@ -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
index 9fd769f32174a6ee2a2dbde48d22afb83964a1eb..b06336457de7e11e6b870292179b9c35431790e2 100644 (file)
@@ -206,7 +206,7 @@ static void r300_set_blend_state(GLcontext * ctx)
            (R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT);
        int eqnA = R300_COMB_FCN_ADD_CLAMP;
 
-       if (ctx->Color._LogicOpEnabled || !ctx->Color.BlendEnabled) {
+       if (RGBA_LOGICOP_ENABLED(ctx) || !ctx->Color.BlendEnabled) {
                r300_set_blend_cntl(r300,
                        func, eqn, 0,
                        func, eqn);