Mesa (master): mesa: treat Color._AdvancedBlendMode as enum

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 17 06:37:07 UTC 2020


Module: Mesa
Branch: master
Commit: 30f4ccff5bd7304a623d2909aaf8de35727ce03d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=30f4ccff5bd7304a623d2909aaf8de35727ce03d

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Jun 24 15:47:01 2020 +0200

mesa: treat Color._AdvancedBlendMode as enum

Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516>

---

 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 ++-
 src/mesa/drivers/dri/i965/genX_state_upload.c    | 3 ++-
 src/mesa/main/draw_validate.c                    | 3 ++-
 src/mesa/state_tracker/st_atom_blend.c           | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index ae4cdedd560..67b83ac9ca9 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -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;
 
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 153e2532d41..d3508eb5460 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -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;
diff --git a/src/mesa/main/draw_validate.c b/src/mesa/main/draw_validate.c
index 36734c52445..09ed37ec5be 100644
--- a/src/mesa/main/draw_validate.c
+++ b/src/mesa/main/draw_validate.c
@@ -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
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c
index 35c99b9f089..1c53e34588f 100644
--- a/src/mesa/state_tracker/st_atom_blend.c
+++ b/src/mesa/state_tracker/st_atom_blend.c
@@ -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)) ||



More information about the mesa-commit mailing list