summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/blend.c3
-rw-r--r--src/mesa/main/enable.c2
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/state_tracker/st_context.c4
4 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 8c763ed34e5..e042b5e8e6a 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -735,7 +735,8 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
case GL_NOTEQUAL:
case GL_GEQUAL:
case GL_ALWAYS:
- FLUSH_VERTICES(ctx, _NEW_COLOR);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewAlphaTest ? 0 : _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest;
ctx->Color.AlphaFunc = func;
ctx->Color.AlphaRefUnclamped = ref;
ctx->Color.AlphaRef = CLAMP(ref, 0.0F, 1.0F);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 5a37770d009..9dccf759ca1 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -293,7 +293,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
goto invalid_enum_error;
if (ctx->Color.AlphaEnabled == state)
return;
+ /* AlphaEnabled is used by the fixed-func fragment program */
FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest;
ctx->Color.AlphaEnabled = state;
break;
case GL_AUTO_NORMAL:
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index e78554bd0b0..4e870359dc8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4475,6 +4475,9 @@ struct gl_driver_flags
/** gl_context::Scissor::ScissorArray */
uint64_t NewScissorRect;
+ /** gl_context::Color::Alpha* */
+ uint64_t NewAlphaTest;
+
/** gl_context::Depth */
uint64_t NewDepth;
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index dff40c67604..cdcc4ddaf48 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -237,8 +237,7 @@ st_invalidate_state(struct gl_context * ctx)
st->dirty |= ST_NEW_CLIP_STATE;
if (new_state & _NEW_COLOR)
- st->dirty |= ST_NEW_BLEND |
- ST_NEW_DSA;
+ st->dirty |= ST_NEW_BLEND;
if (new_state & _NEW_PIXEL)
st->dirty |= ST_NEW_PIXEL_TRANSFER;
@@ -519,6 +518,7 @@ static void st_init_driver_flags(struct st_context *st)
f->NewFramebufferSRGB = ST_NEW_FB_STATE;
f->NewScissorRect = ST_NEW_SCISSOR;
f->NewScissorTest = ST_NEW_SCISSOR | ST_NEW_RASTERIZER;
+ f->NewAlphaTest = ST_NEW_DSA;
f->NewDepth = ST_NEW_DSA;
f->NewStencil = ST_NEW_DSA;
}