diff options
author | Marek Olšák <[email protected]> | 2018-01-07 18:27:40 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-02-02 15:06:47 +0100 |
commit | 51d36f5e02d7083e52b5617bf44de0105c611db4 (patch) | |
tree | 7b34e45497e7613d11537270ce964962ec437b42 /src/mesa/main/enable.c | |
parent | df1d5174fccc6771e24ef09e0cd77dfa377a7b6a (diff) |
mesa: don't flag _NEW_COLOR for KHR adv.blend if prog constant doesn't change
This only affects drivers that set DriverFlags.NewBlend.
v2: - fix typo advanded -> advanced
- return "enum gl_advanced_blend_mode" from
_mesa_get_advanced_blend_sh_constant
- don't call FLUSH_VERTICES twice
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r-- | src/mesa/main/enable.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 451a9c918f4..bc22410bda4 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -329,7 +329,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) GLbitfield newEnabled = state * ((1 << ctx->Const.MaxDrawBuffers) - 1); if (newEnabled != ctx->Color.BlendEnabled) { - _mesa_flush_vertices_for_blend_state(ctx); + _mesa_flush_vertices_for_blend_adv(ctx, newEnabled, + ctx->Color._AdvancedBlendMode); ctx->Color.BlendEnabled = newEnabled; } } @@ -1198,11 +1199,16 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap, return; } if (((ctx->Color.BlendEnabled >> index) & 1) != state) { - _mesa_flush_vertices_for_blend_state(ctx); + GLbitfield enabled = ctx->Color.BlendEnabled; + if (state) - ctx->Color.BlendEnabled |= (1 << index); + enabled |= (1 << index); else - ctx->Color.BlendEnabled &= ~(1 << index); + enabled &= ~(1 << index); + + _mesa_flush_vertices_for_blend_adv(ctx, enabled, + ctx->Color._AdvancedBlendMode); + ctx->Color.BlendEnabled = enabled; } break; case GL_SCISSOR_TEST: |