[Mesa-dev] [PATCH 13/16] i965: Disable hardware blending if advanced blending is in use.

Kenneth Graunke kenneth at whitecape.org
Sat Aug 13 03:13:05 UTC 2016


We'll do blending in the shader in this case, so just disable the
hardware blending.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/gen8_blend_state.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/gen8_blend_state.c b/src/mesa/drivers/dri/i965/gen8_blend_state.c
index 99b5e34..f81e8ca 100644
--- a/src/mesa/drivers/dri/i965/gen8_blend_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_blend_state.c
@@ -101,13 +101,16 @@ gen8_upload_blend_state(struct brw_context *brw)
       */
       bool integer = rb_type == GL_INT || rb_type == GL_UNSIGNED_INT;
 
+      const bool blend_enable = (1 << i) &
+         ctx->Color.BlendEnabled & ~ctx->Color._AdvancedBlendEnabled;
+
       /* _NEW_COLOR */
       if (ctx->Color.ColorLogicOpEnabled) {
          blend[1 + 2*i+1] |=
             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 (blend_enable && !integer) {
          GLenum eqRGB = ctx->Color.Blend[i].EquationRGB;
          GLenum eqA = ctx->Color.Blend[i].EquationA;
          GLenum srcRGB = ctx->Color.Blend[i].SrcRGB;
-- 
2.9.0



More information about the mesa-dev mailing list