i965: Disable hardware blending if advanced blending is in use.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 28 Jun 2016 15:24:11 +0000 (08:24 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Aug 2016 02:22:10 +0000 (19:22 -0700)
We'll do blending in the shader in this case, so just disable the
hardware blending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_cc.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_cc.c
src/mesa/drivers/dri/i965/gen8_blend_state.c

index 2e8f0f79e3d09f57f78fb2608ec08dc6ff8abf5c..5c58b448c1fb32f049d990b3d2fe947f50b3a460 100644 (file)
@@ -159,7 +159,7 @@ static void upload_cc_unit(struct brw_context *brw)
    if (ctx->Color.ColorLogicOpEnabled && ctx->Color.LogicOp != GL_COPY) {
       cc->cc2.logicop_enable = 1;
       cc->cc5.logicop_func = intel_translate_logic_op(ctx->Color.LogicOp);
-   } else if (ctx->Color.BlendEnabled) {
+   } else if (ctx->Color.BlendEnabled && !ctx->Color._AdvancedBlendMode) {
       GLenum eqRGB = ctx->Color.Blend[0].EquationRGB;
       GLenum eqA = ctx->Color.Blend[0].EquationA;
       GLenum srcRGB = ctx->Color.Blend[0].SrcRGB;
index e07e8dacacefea0df0c7a908f7ea8b25c2a82d3a..023b1ffbf9db207b3cfffb03cef59b4226ee5c20 100644 (file)
@@ -926,8 +926,8 @@ gen4_update_renderbuffer_surface(struct brw_context *brw,
 
    if (brw->gen < 6) {
       /* _NEW_COLOR */
-      if (!ctx->Color.ColorLogicOpEnabled &&
-         (ctx->Color.BlendEnabled & (1 << unit)))
+      if (!ctx->Color.ColorLogicOpEnabled && !ctx->Color._AdvancedBlendMode &&
+          (ctx->Color.BlendEnabled & (1 << unit)))
         surf[0] |= BRW_SURFACE_BLEND_ENABLED;
 
       if (!ctx->Color.ColorMask[unit][0])
index 69c8ebd0dfb4c1315407ca3b568fec1dcc5ef74e..0c38930ec2bc3efb2819919809a5ff3c4d68efde 100644 (file)
@@ -104,7 +104,8 @@ gen6_upload_blend_state(struct brw_context *brw)
            blend[b].blend1.logic_op_func =
               intel_translate_logic_op(ctx->Color.LogicOp);
         }
-      } else if (ctx->Color.BlendEnabled & (1 << b) && !integer) {
+      } else if (ctx->Color.BlendEnabled & (1 << b) && !integer &&
+                 !ctx->Color._AdvancedBlendMode) {
         GLenum eqRGB = ctx->Color.Blend[b].EquationRGB;
         GLenum eqA = ctx->Color.Blend[b].EquationA;
         GLenum srcRGB = ctx->Color.Blend[b].SrcRGB;
index 99b5e342d6379df4030922cbe9fd2df6f19224dd..4935d82af62aee5b36f77acf393f4b7f698deb97 100644 (file)
@@ -107,7 +107,8 @@ gen8_upload_blend_state(struct brw_context *brw)
             GEN8_BLEND_LOGIC_OP_ENABLE |
             SET_FIELD(intel_translate_logic_op(ctx->Color.LogicOp),
                       GEN8_BLEND_LOGIC_OP_FUNCTION);
-      } else if (ctx->Color.BlendEnabled & (1 << i) && !integer) {
+      } else if (ctx->Color.BlendEnabled & (1 << i) && !integer &&
+                 !ctx->Color._AdvancedBlendMode) {
          GLenum eqRGB = ctx->Color.Blend[i].EquationRGB;
          GLenum eqA = ctx->Color.Blend[i].EquationA;
          GLenum srcRGB = ctx->Color.Blend[i].SrcRGB;