summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-11-12 15:27:52 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-11-12 15:27:52 +0000
commit57857ca0925116d6d254fef7e705cfe0b650d77f (patch)
tree64d4b8ed52bafda589d9abf66a460402f92c97a4 /src/mesa/main
parent80ee4b1e9dbf62f9aa86c3b8531615d14f077dd9 (diff)
Ville Syrjala's logic op patch
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/blend.c6
-rw-r--r--src/mesa/main/enable.c15
-rw-r--r--src/mesa/main/mtypes.h1
3 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index e3cdbffcd1..e5032bf1bb 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -334,8 +334,9 @@ _mesa_BlendEquation( GLenum mode )
/* This is needed to support 1.1's RGB logic ops AND
* 1.0's blending logicops.
*/
- ctx->Color.ColorLogicOpEnabled = (mode==GL_LOGIC_OP &&
- ctx->Color.BlendEnabled);
+ ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled ||
+ (ctx->Color.BlendEnabled &&
+ mode == GL_LOGIC_OP));
if (ctx->Driver.BlendEquation)
(*ctx->Driver.BlendEquation)( ctx, mode );
@@ -572,6 +573,7 @@ void _mesa_init_color( GLcontext * ctx )
ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
ctx->Color.IndexLogicOpEnabled = GL_FALSE;
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
+ ctx->Color._LogicOpEnabled = GL_FALSE;
ctx->Color.LogicOp = GL_COPY;
ctx->Color.DitherFlag = GL_TRUE;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index f882f94fd2..a882cf4580 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -231,9 +231,12 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.BlendEnabled = state;
- /* The following needed to accomodate 1.0 RGB logic op blending */
- ctx->Color.ColorLogicOpEnabled =
- (ctx->Color.BlendEquation == GL_LOGIC_OP && state);
+ /* This is needed to support 1.1's RGB logic ops AND
+ * 1.0's blending logicops.
+ */
+ ctx->Color._LogicOpEnabled =
+ (ctx->Color.ColorLogicOpEnabled ||
+ (state && ctx->Color.BlendEquation == GL_LOGIC_OP));
break;
#if FEATURE_userclip
case GL_CLIP_PLANE0:
@@ -383,6 +386,12 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.ColorLogicOpEnabled = state;
+ /* This is needed to support 1.1's RGB logic ops AND
+ * 1.0's blending logicops.
+ */
+ ctx->Color._LogicOpEnabled =
+ (state || (ctx->Color.BlendEnabled &&
+ ctx->Color.BlendEquation == GL_LOGIC_OP));
break;
case GL_MAP1_COLOR_4:
if (ctx->Eval.Map1Color4 == state)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ea8ae2dc41..0a5c99546d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -430,6 +430,7 @@ struct gl_colorbuffer_attrib {
GLenum LogicOp; /**< Logic operator */
GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */
GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */
+ GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */
/*@}*/
GLboolean DitherFlag; /**< Dither enable flag */