aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.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/blend.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/blend.c')
-rw-r--r--src/mesa/main/blend.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index e042b5e8e6a..881e9c8a79f 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -259,7 +259,8 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
return;
}
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
for (buf = 0; buf < numBuffers; buf++) {
ctx->Color.Blend[buf].SrcRGB = sfactorRGB;
@@ -331,7 +332,8 @@ blend_func_separatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
return;
}
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
ctx->Color.Blend[buf].SrcRGB = sfactorRGB;
ctx->Color.Blend[buf].DstRGB = dfactorRGB;
@@ -477,7 +479,7 @@ _mesa_BlendEquation( GLenum mode )
return;
}
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ _mesa_flush_vertices_for_blend_state(ctx);
for (buf = 0; buf < numBuffers; buf++) {
ctx->Color.Blend[buf].EquationRGB = mode;
@@ -519,7 +521,7 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
ctx->Color.Blend[buf].EquationA == mode)
return; /* no change */
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ _mesa_flush_vertices_for_blend_state(ctx);
ctx->Color.Blend[buf].EquationRGB = mode;
ctx->Color.Blend[buf].EquationA = mode;
ctx->Color._BlendEquationPerBuffer = GL_TRUE;
@@ -585,7 +587,7 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
return;
}
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ _mesa_flush_vertices_for_blend_state(ctx);
for (buf = 0; buf < numBuffers; buf++) {
ctx->Color.Blend[buf].EquationRGB = modeRGB;
@@ -607,7 +609,7 @@ blend_equation_separatei(struct gl_context *ctx, GLuint buf, GLenum modeRGB,
ctx->Color.Blend[buf].EquationA == modeA)
return; /* no change */
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ _mesa_flush_vertices_for_blend_state(ctx);
ctx->Color.Blend[buf].EquationRGB = modeRGB;
ctx->Color.Blend[buf].EquationA = modeA;
ctx->Color._BlendEquationPerBuffer = GL_TRUE;
@@ -691,7 +693,8 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
if (TEST_EQ_4V(tmp, ctx->Color.BlendColorUnclamped))
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlendColor ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewBlendColor;
COPY_4FV( ctx->Color.BlendColorUnclamped, tmp );
ctx->Color.BlendColor[0] = CLAMP(tmp[0], 0.0F, 1.0F);
@@ -796,7 +799,8 @@ _mesa_LogicOp( GLenum opcode )
if (ctx->Color.LogicOp == opcode)
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
ctx->Color.LogicOp = opcode;
if (ctx->Driver.LogicOpcode)
@@ -812,7 +816,8 @@ _mesa_IndexMask( GLuint mask )
if (ctx->Color.IndexMask == mask)
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewColorMask ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
ctx->Color.IndexMask = mask;
}
@@ -856,7 +861,8 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
if (!TEST_EQ_4V(tmp, ctx->Color.ColorMask[i])) {
if (!flushed) {
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewColorMask ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
}
flushed = GL_TRUE;
COPY_4UBV(ctx->Color.ColorMask[i], tmp);
@@ -898,7 +904,8 @@ _mesa_ColorMaski( GLuint buf, GLboolean red, GLboolean green,
if (TEST_EQ_4V(tmp, ctx->Color.ColorMask[buf]))
return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewColorMask ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
COPY_4UBV(ctx->Color.ColorMask[buf], tmp);
}