diff options
author | Kendall Bennett <[email protected]> | 1999-11-12 04:56:54 +0000 |
---|---|---|
committer | Kendall Bennett <[email protected]> | 1999-11-12 04:56:54 +0000 |
commit | e312cf26ea1ae0445926df20c43e80363d453cb5 (patch) | |
tree | 6e13b3e4f76081cc0edc61e5941b1b140c771e3a /src/mesa/main | |
parent | b95d252c347e14825cd61b28223040cfc5d0e7de (diff) |
. Updates to get X86, MXX and 3DNow assembler code working with Watcom
C++ and NASM. This includes lots of _ASMAPI macros to ensure that
assembler functions are prototyped as __cdecl, as Watcom C++ uses
register calling conventions by default.
. Misc fixes to files to remove warnings generated by Watcom C++.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/Imakefile | 1 | ||||
-rw-r--r-- | src/mesa/main/blend.c | 48 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 4 | ||||
-rw-r--r-- | src/mesa/main/varray.c | 4 |
4 files changed, 30 insertions, 27 deletions
diff --git a/src/mesa/main/Imakefile b/src/mesa/main/Imakefile index 115f16c8c35..443e83c8f30 100644 --- a/src/mesa/main/Imakefile +++ b/src/mesa/main/Imakefile @@ -124,4 +124,3 @@ LINTLIBS = DependTarget()
-
\ No newline at end of file diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 4dac9a4f6a7..0790d65256c 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,4 @@ -/* $Id: blend.c,v 1.8 1999/11/11 01:22:25 brianp Exp $ */ +/* $Id: blend.c,v 1.9 1999/11/12 04:56:55 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -264,12 +264,16 @@ _mesa_BlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ctx->Color.BlendColor[3] = CLAMP( alpha, 0.0F, 1.0F ); } - +#ifdef USE_MMX_ASM +#define _BLENDAPI _ASMAPI +#else +#define _BLENDAPI +#endif /* * Common transparency blending mode. */ -static void blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], +static void _BLENDAPI blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], GLubyte rgba[][4], CONST GLubyte dest[][4] ) { GLuint i; @@ -314,7 +318,7 @@ static void blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], /* * Add src and dest. */ -static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], +static void _BLENDAPI blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], GLubyte rgba[][4], CONST GLubyte dest[][4] ) { GLuint i; @@ -333,7 +337,7 @@ static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], rgba[i][GCOMP] = (GLubyte) MIN2( g, 255 ); rgba[i][BCOMP] = (GLubyte) MIN2( b, 255 ); rgba[i][ACOMP] = (GLubyte) MIN2( a, 255 ); - } + } } } @@ -342,20 +346,20 @@ static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], /* * Blend min function (for GL_EXT_blend_minmax) */ -static void blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], CONST GLubyte dest[][4] ) +static void _BLENDAPI blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[], + GLubyte rgba[][4], CONST GLubyte dest[][4] ) { GLuint i; ASSERT(ctx->Color.BlendEquation==GL_MIN_EXT); (void) ctx; for (i=0;i<n;i++) { - if (mask[i]) { - rgba[i][RCOMP] = (GLubyte) MIN2( rgba[i][RCOMP], dest[i][RCOMP] ); - rgba[i][GCOMP] = (GLubyte) MIN2( rgba[i][GCOMP], dest[i][GCOMP] ); - rgba[i][BCOMP] = (GLubyte) MIN2( rgba[i][BCOMP], dest[i][BCOMP] ); - rgba[i][ACOMP] = (GLubyte) MIN2( rgba[i][ACOMP], dest[i][ACOMP] ); - } + if (mask[i]) { + rgba[i][RCOMP] = (GLubyte) MIN2( rgba[i][RCOMP], dest[i][RCOMP] ); + rgba[i][GCOMP] = (GLubyte) MIN2( rgba[i][GCOMP], dest[i][GCOMP] ); + rgba[i][BCOMP] = (GLubyte) MIN2( rgba[i][BCOMP], dest[i][BCOMP] ); + rgba[i][ACOMP] = (GLubyte) MIN2( rgba[i][ACOMP], dest[i][ACOMP] ); + } } } @@ -364,7 +368,7 @@ static void blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[], /* * Blend max function (for GL_EXT_blend_minmax) */ -static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[], +static void _BLENDAPI blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[], GLubyte rgba[][4], CONST GLubyte dest[][4] ) { GLuint i; @@ -374,10 +378,10 @@ static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[], for (i=0;i<n;i++) { if (mask[i]) { rgba[i][RCOMP] = (GLubyte) MAX2( rgba[i][RCOMP], dest[i][RCOMP] ); - rgba[i][GCOMP] = (GLubyte) MAX2( rgba[i][GCOMP], dest[i][GCOMP] ); - rgba[i][BCOMP] = (GLubyte) MAX2( rgba[i][BCOMP], dest[i][BCOMP] ); - rgba[i][ACOMP] = (GLubyte) MAX2( rgba[i][ACOMP], dest[i][ACOMP] ); - } + rgba[i][GCOMP] = (GLubyte) MAX2( rgba[i][GCOMP], dest[i][GCOMP] ); + rgba[i][BCOMP] = (GLubyte) MAX2( rgba[i][BCOMP], dest[i][BCOMP] ); + rgba[i][ACOMP] = (GLubyte) MAX2( rgba[i][ACOMP], dest[i][ACOMP] ); + } } } @@ -386,8 +390,8 @@ static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[], /* * Modulate: result = src * dest */ -static void blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], CONST GLubyte dest[][4] ) +static void _BLENDAPI blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[], + GLubyte rgba[][4], CONST GLubyte dest[][4] ) { GLuint i; (void) ctx; @@ -415,8 +419,8 @@ static void blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[], * In/Out: rgba - the incoming and modified pixels * Input: dest - the pixels from the dest color buffer */ -static void blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], CONST GLubyte dest[][4] ) +static void _BLENDAPI blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], + GLubyte rgba[][4], CONST GLubyte dest[][4] ) { GLfloat rscale = 1.0F / 255.0F; GLfloat gscale = 1.0F / 255.0F; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index fae67d4fc7c..0abe6036eb1 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.8 1999/11/11 01:22:28 brianp Exp $ */ +/* $Id: texobj.c,v 1.9 1999/11/12 04:57:04 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -422,7 +422,7 @@ _mesa_BindTexture( GLenum target, GLuint texName ) dim = (GLuint) (target - GL_TEXTURE_1D); - if (dim < 0 || dim > 2) { + if (dim > 2) { gl_error( ctx, GL_INVALID_ENUM, "glBindTexture" ); return; } diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 8fcc63b9e72..c22be597594 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1,4 +1,4 @@ -/* $Id: varray.c,v 1.14 1999/11/11 01:22:28 brianp Exp $ */ +/* $Id: varray.c,v 1.15 1999/11/12 04:57:05 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -799,7 +799,7 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indice return; } - if (mode < 0 || mode > GL_POLYGON) { + if (mode > GL_POLYGON) { gl_error( ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" ); return; } |