summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/common/meta.c8
-rw-r--r--src/mesa/drivers/common/meta.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 89d7a157ce4..604bc218b72 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -505,6 +505,11 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
_mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, GL_FALSE);
}
+ if (state & MESA_META_DITHER) {
+ save->DitherFlag = ctx->Color.DitherFlag;
+ _mesa_set_enable(ctx, GL_DITHER, GL_TRUE);
+ }
+
if (state & MESA_META_COLOR_MASK) {
memcpy(save->ColorMask, ctx->Color.ColorMask,
sizeof(ctx->Color.ColorMask));
@@ -875,6 +880,9 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, save->ColorLogicOpEnabled);
}
+ if (state & MESA_META_DITHER)
+ _mesa_set_enable(ctx, GL_DITHER, save->DitherFlag);
+
if (state & MESA_META_COLOR_MASK) {
GLuint i;
for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 765f8dfe4a2..b8d992ce96f 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -59,6 +59,7 @@
#define MESA_META_FRAMEBUFFER_SRGB 0x200000
#define MESA_META_OCCLUSION_QUERY 0x400000
#define MESA_META_DRAW_BUFFERS 0x800000
+#define MESA_META_DITHER 0x1000000
/**\}*/
/**
@@ -84,6 +85,9 @@ struct save_state
GLbitfield BlendEnabled;
GLboolean ColorLogicOpEnabled;
+ /** MESA_META_DITHER */
+ GLboolean DitherFlag;
+
/** MESA_META_COLOR_MASK */
GLubyte ColorMask[MAX_DRAW_BUFFERS][4];