aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2020-06-24 15:47:01 +0200
committerMarge Bot <[email protected]>2020-07-17 06:19:16 +0000
commit30f4ccff5bd7304a623d2909aaf8de35727ce03d (patch)
tree20979cb8bbe257f4d6de4c841f0b7cf161587e09
parent6ffa0e925495bf8104a2d7e6984b50b5c3584c67 (diff)
mesa: treat Color._AdvancedBlendMode as enum
Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Gert Wollny <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516>
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/genX_state_upload.c3
-rw-r--r--src/mesa/main/draw_validate.c3
-rw-r--r--src/mesa/state_tracker/st_atom_blend.c3
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)) ||