[Mesa-dev] [PATCH 3/5] st/mesa: don't translate blend state when it's disabled for a colorbuffer
Marek Olšák
maraeo at gmail.com
Wed Jan 31 19:55:13 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/state_tracker/st_atom_blend.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c
index 8f644ba..62042a6 100644
--- a/src/mesa/state_tracker/st_atom_blend.c
+++ b/src/mesa/state_tracker/st_atom_blend.c
@@ -154,22 +154,24 @@ st_update_blend( struct st_context *st )
blend->independent_blend_enable = 1;
}
if (ctx->Color.ColorLogicOpEnabled) {
/* logicop enabled */
blend->logicop_enable = 1;
blend->logicop_func = ctx->Color._LogicOp;
}
else if (ctx->Color.BlendEnabled && !ctx->Color._AdvancedBlendMode) {
/* blending enabled */
for (i = 0; i < num_state; i++) {
- blend->rt[i].blend_enable = (ctx->Color.BlendEnabled >> i) & 0x1;
+ if (!(ctx->Color.BlendEnabled & (1 << i)))
+ continue;
+ blend->rt[i].blend_enable = 1;
blend->rt[i].rgb_func =
translate_blend(ctx->Color.Blend[i].EquationRGB);
if (ctx->Color.Blend[i].EquationRGB == GL_MIN ||
ctx->Color.Blend[i].EquationRGB == GL_MAX) {
/* Min/max are special */
blend->rt[i].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
blend->rt[i].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
}
else {
--
2.7.4
More information about the mesa-dev
mailing list