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;
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;
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;
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;
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;
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;
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);
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)
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;
}
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);
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);
}
#include "glheader.h"
+#include "blend.h"
#include "clip.h"
#include "context.h"
#include "debug_output.h"
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;
}
}
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:
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:
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:
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;
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
st_user_clip_planes_enabled(ctx))
st->dirty |= ST_NEW_CLIP_STATE;
- if (new_state & _NEW_COLOR)
- st->dirty |= ST_NEW_BLEND;
-
if (new_state & _NEW_PIXEL)
st->dirty |= ST_NEW_PIXEL_TRANSFER;
f->NewScissorRect = ST_NEW_SCISSOR;
f->NewScissorTest = ST_NEW_SCISSOR | ST_NEW_RASTERIZER;
f->NewAlphaTest = ST_NEW_DSA;
+ f->NewBlend = ST_NEW_BLEND;
+ f->NewBlendColor = ST_NEW_BLEND; /* TODO: add an atom for blend color */
+ f->NewColorMask = ST_NEW_BLEND;
f->NewDepth = ST_NEW_DSA;
+ f->NewLogicOp = ST_NEW_BLEND;
f->NewStencil = ST_NEW_DSA;
}