st/mesa: don't translate blend state when it's disabled for a colorbuffer
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 Jan 2018 23:53:16 +0000 (00:53 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 9 Feb 2018 14:52:22 +0000 (15:52 +0100)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/state_tracker/st_atom_blend.c

index f7327d6838c8493754d4c04d953925161c00ba6b..a5f7edbcfe492d0c6a49876d9a33f187ebeb6c65 100644 (file)
@@ -161,12 +161,13 @@ st_update_blend( struct st_context *st )
    else if (ctx->Color.BlendEnabled && !ctx->Color._AdvancedBlendMode) {
       /* blending enabled */
       for (i = 0, j = 0; i < num_state; i++) {
+         if (!(ctx->Color.BlendEnabled & (1 << i)))
+            continue;
 
-         blend->rt[i].blend_enable = (ctx->Color.BlendEnabled >> i) & 0x1;
-
-         if (ctx->Extensions.ARB_draw_buffers_blend)
+        if (ctx->Extensions.ARB_draw_buffers_blend)
             j = i;
 
+         blend->rt[i].blend_enable = 1;
          blend->rt[i].rgb_func =
             translate_blend(ctx->Color.Blend[j].EquationRGB);