diff options
author | Marek Olšák <[email protected]> | 2018-01-31 00:53:16 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-02-09 15:52:22 +0100 |
commit | c446dd7927477e68e9a961acb1727ff53fb7ea4f (patch) | |
tree | 75d7de9dc4cc8fa2cff4c84f8b9adf9ad56f3630 /src/mesa | |
parent | 3d06c8afb5543cce88e331278d92823d88aac7b6 (diff) |
st/mesa: don't translate blend state when color writes are disabled
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_atom_blend.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index a5f7edbcfe4..2a8da75f360 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -153,6 +153,10 @@ st_update_blend( struct st_context *st ) num_state = ctx->Const.MaxDrawBuffers; blend->independent_blend_enable = 1; } + + for (i = 0; i < num_state; i++) + blend->rt[i].colormask = GET_COLORMASK(ctx->Color.ColorMask, i); + if (ctx->Color.ColorLogicOpEnabled) { /* logicop enabled */ blend->logicop_enable = 1; @@ -161,7 +165,8 @@ 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))) + if (!(ctx->Color.BlendEnabled & (1 << i)) || + !blend->rt[i].colormask) continue; if (ctx->Extensions.ARB_draw_buffers_blend) @@ -205,9 +210,6 @@ st_update_blend( struct st_context *st ) /* no blending / logicop */ } - for (i = 0; i < num_state; i++) - blend->rt[i].colormask = GET_COLORMASK(ctx->Color.ColorMask, i); - blend->dither = ctx->Color.DitherFlag; if (_mesa_is_multisample_enabled(ctx) && |