From: Erik Faye-Lund Date: Wed, 24 Jun 2020 13:47:01 +0000 (+0200) Subject: mesa: treat Color._AdvancedBlendMode as enum X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=30f4ccff5bd7304a623d2909aaf8de35727ce03d;p=mesa.git mesa: treat Color._AdvancedBlendMode as enum Signed-off-by: Elie Tournier Reviewed-by: Gert Wollny Reviewed-by: Dave Airlie Part-of: --- 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)) ||