summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-12-15 18:04:17 +0000
committerBrian Paul <[email protected]>2003-12-15 18:04:17 +0000
commit63f4e198b41ad5a25200db3d126a6320d6cf8dcc (patch)
tree14e16f838a9ba329206dee4efa61af0f2ac8f9ec /src/mesa
parentb3b725b1e6044d29fb5f484979766d1ef8a7fa9f (diff)
fix GL_MIN/MAX w/ glBlendFuncSeparate bug (Ian Romanick)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/swrast/s_blend.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index 6d522ffd870..124d389b302 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -685,9 +685,6 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
}
-
-
-
/*
* Analyze current blending parameters to pick fastest blending function.
* Result: the ctx->Color.BlendFunc pointer is updated.
@@ -700,7 +697,27 @@ void _swrast_choose_blend_func( GLcontext *ctx )
const GLenum srcA = ctx->Color.BlendSrcA;
const GLenum dstA = ctx->Color.BlendDstA;
- if (srcRGB != srcA || dstRGB != dstA) {
+ if (eq==GL_MIN_EXT) {
+ /* Note: GL_MIN ignores the blending weight factors */
+#if defined(USE_MMX_ASM)
+ if ( cpu_has_mmx ) {
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_min;
+ }
+ else
+#endif
+ SWRAST_CONTEXT(ctx)->BlendFunc = blend_min;
+ }
+ else if (eq==GL_MAX_EXT) {
+ /* Note: GL_MAX ignores the blending weight factors */
+#if defined(USE_MMX_ASM)
+ if ( cpu_has_mmx ) {
+ SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_max;
+ }
+ else
+#endif
+ SWRAST_CONTEXT(ctx)->BlendFunc = blend_max;
+ }
+ else if (srcRGB != srcA || dstRGB != dstA) {
SWRAST_CONTEXT(ctx)->BlendFunc = blend_general;
}
else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_SRC_ALPHA
@@ -735,24 +752,6 @@ void _swrast_choose_blend_func( GLcontext *ctx )
#endif
SWRAST_CONTEXT(ctx)->BlendFunc = blend_modulate;
}
- else if (eq==GL_MIN_EXT) {
-#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_min;
- }
- else
-#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_min;
- }
- else if (eq==GL_MAX_EXT) {
-#if defined(USE_MMX_ASM)
- if ( cpu_has_mmx ) {
- SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_max;
- }
- else
-#endif
- SWRAST_CONTEXT(ctx)->BlendFunc = blend_max;
- }
else if (eq==GL_FUNC_ADD_EXT && srcRGB == GL_ZERO && dstRGB == GL_ONE) {
SWRAST_CONTEXT(ctx)->BlendFunc = blend_noop;
}