mesa: treat Color._AdvancedBlendMode as enum
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 24 Jun 2020 13:47:01 +0000 (15:47 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 17 Jul 2020 06:19:16 +0000 (06:19 +0000)
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516>

src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/genX_state_upload.c
src/mesa/main/draw_validate.c
src/mesa/state_tracker/st_atom_blend.c

index ae4cdedd5601c461594ad3c9178128ba1cf32313..67b83ac9ca9a8c4333b22233ed2114caadb500dd 100644 (file)
@@ -978,7 +978,8 @@ gen4_update_renderbuffer_surface(struct brw_context *brw,
 
    if (devinfo->gen < 6) {
       /* _NEW_COLOR */
-      if (!ctx->Color.ColorLogicOpEnabled && !ctx->Color._AdvancedBlendMode &&
+      if (!ctx->Color.ColorLogicOpEnabled &&
+          ctx->Color._AdvancedBlendMode == BLEND_NONE &&
           (ctx->Color.BlendEnabled & (1 << unit)))
         surf[0] |= BRW_SURFACE_BLEND_ENABLED;
 
index 153e2532d41f81a5927fd0bda2bd7a6434ba308e..d3508eb54605ec4dfe7f71beb9295f2522418c15 100644 (file)
@@ -2843,7 +2843,8 @@ set_blend_entry_bits(struct brw_context *brw, BLEND_ENTRY_GENXML *entry, int i,
          entry->LogicOpEnable = true;
          entry->LogicOpFunction = ctx->Color._LogicOp;
       }
-   } else if (blend_enabled && !ctx->Color._AdvancedBlendMode
+   } else if (blend_enabled &&
+              ctx->Color._AdvancedBlendMode == BLEND_NONE
               && (GEN_GEN <= 5 || !integer)) {
       GLenum eqRGB = ctx->Color.Blend[i].EquationRGB;
       GLenum eqA = ctx->Color.Blend[i].EquationA;
index 36734c52445666c787d44adbc2fa584ff3755844..09ed37ec5beb1e9f64dc4b5c5df0f162eaf4b11b 100644 (file)
@@ -60,7 +60,8 @@ check_blend_func_error(struct gl_context *ctx)
       }
    }
 
-   if (ctx->Color.BlendEnabled && ctx->Color._AdvancedBlendMode) {
+   if (ctx->Color.BlendEnabled &&
+       ctx->Color._AdvancedBlendMode != BLEND_NONE) {
       /* The KHR_blend_equation_advanced spec says:
        *
        *    "If any non-NONE draw buffer uses a blend equation found in table
index 35c99b9f089575a2842484b3a0bb5cce0daed09c..1c53e34588f7271b30e8ef6c31fe407dd6e97421 100644 (file)
@@ -217,7 +217,8 @@ st_update_blend( struct st_context *st )
       blend->logicop_enable = 1;
       blend->logicop_func = ctx->Color._LogicOp;
    }
-   else if (ctx->Color.BlendEnabled && !ctx->Color._AdvancedBlendMode) {
+   else if (ctx->Color.BlendEnabled &&
+            ctx->Color._AdvancedBlendMode == BLEND_NONE) {
       /* blending enabled */
       for (i = 0, j = 0; i < num_state; i++) {
          if (!(ctx->Color.BlendEnabled & (1 << i)) ||