aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-10 01:46:34 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commit581d77315bdb2338e97133a05fa8c354352f5fd8 (patch)
tree4b92a067c861b25dad5174bf68b9a8185ca21f79 /src/mesa/main/enable.c
parentb677e96078889140ad1549cb7b94b0a33c10f7ba (diff)
mesa: don't flag _NEW_COLOR for st/mesa if possible
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 9dccf759ca1..d33fc8b3dda 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -29,6 +29,7 @@
#include "glheader.h"
+#include "blend.h"
#include "clip.h"
#include "context.h"
#include "debug_output.h"
@@ -311,7 +312,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
GLbitfield newEnabled =
state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
if (newEnabled != ctx->Color.BlendEnabled) {
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ _mesa_flush_vertices_for_blend_state(ctx);
ctx->Color.BlendEnabled = newEnabled;
}
}
@@ -378,7 +379,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
case GL_DITHER:
if (ctx->Color.DitherFlag == state)
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
ctx->Color.DitherFlag = state;
break;
case GL_FOG:
@@ -440,7 +442,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Color.IndexLogicOpEnabled == state)
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
ctx->Color.IndexLogicOpEnabled = state;
break;
case GL_CONSERVATIVE_RASTERIZATION_INTEL:
@@ -458,7 +461,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Color.ColorLogicOpEnabled == state)
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
ctx->Color.ColorLogicOpEnabled = state;
break;
case GL_MAP1_COLOR_4:
@@ -1040,7 +1044,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
CHECK_EXTENSION(KHR_blend_equation_advanced_coherent, cap);
if (ctx->Color.BlendCoherent == state)
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
ctx->Color.BlendCoherent = state;
break;
@@ -1106,7 +1111,7 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap,
return;
}
if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ _mesa_flush_vertices_for_blend_state(ctx);
if (state)
ctx->Color.BlendEnabled |= (1 << index);
else