From 0c527ab0546eb1de9ee10cc31bc386a40e6b3f98 Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Fri, 19 Apr 2002 10:53:08 +0000 Subject: [PATCH] MMX add blending function added. --- src/mesa/swrast/s_blend.c | 10 ++++++++-- src/mesa/x86/mmx.h | 6 +++++- src/mesa/x86/mmx_blend.S | 17 ++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 9a1f647..0d75e2a 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -1,4 +1,4 @@ -/* $Id: s_blend.c,v 1.20 2002/04/19 10:33:34 jrfonseca Exp $ */ +/* $Id: s_blend.c,v 1.21 2002/04/19 10:53:08 jrfonseca Exp $ */ /* * Mesa 3-D graphics library @@ -656,7 +656,13 @@ void _swrast_choose_blend_func( GLcontext *ctx ) SWRAST_CONTEXT(ctx)->BlendFunc = blend_transparency; } else if (eq==GL_FUNC_ADD_EXT && srcRGB==GL_ONE && dstRGB==GL_ONE) { - SWRAST_CONTEXT(ctx)->BlendFunc = blend_add; +#if defined(USE_MMX_ASM) + if ( cpu_has_mmx ) { + SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_add; + } + else +#endif + SWRAST_CONTEXT(ctx)->BlendFunc = blend_add; } else if (((eq==GL_FUNC_ADD_EXT || eq==GL_FUNC_REVERSE_SUBTRACT_EXT) && (srcRGB==GL_ZERO && dstRGB==GL_SRC_COLOR)) diff --git a/src/mesa/x86/mmx.h b/src/mesa/x86/mmx.h index 205677e..da16388 100644 --- a/src/mesa/x86/mmx.h +++ b/src/mesa/x86/mmx.h @@ -1,4 +1,4 @@ -/* $Id: mmx.h,v 1.7 2002/04/19 10:33:34 jrfonseca Exp $ */ +/* $Id: mmx.h,v 1.8 2002/04/19 10:53:08 jrfonseca Exp $ */ /* * Mesa 3-D graphics library @@ -33,6 +33,10 @@ _mesa_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], GLubyte rgba[][4], const GLubyte dest[][4] ); extern void _ASMAPI +_mesa_mmx_blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], + GLubyte rgba[][4], const GLubyte dest[][4] ); + +extern void _ASMAPI _mesa_mmx_blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[], GLubyte rgba[][4], const GLubyte dest[][4] ); diff --git a/src/mesa/x86/mmx_blend.S b/src/mesa/x86/mmx_blend.S index ce946ec..f346046 100644 --- a/src/mesa/x86/mmx_blend.S +++ b/src/mesa/x86/mmx_blend.S @@ -270,7 +270,22 @@ const_80: #include "mmx_blendtmp.h" -/* modulate +/* add bleding mode + */ + +#define TAG(x) x##_add + +#define INIT + +#define MAIN( rgba, dest ) \ + GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ + PADDUSB ( MM1, MM2 ) ;\ + GMB_STORE( rgba, MM2 ) + +#include "mmx_blendtmp.h" + + +/* modulate blending mode */ #define TAG(x) x##_modulate -- 2.7.4