summaryrefslogtreecommitdiff
path: root/xc/extras
diff options
context:
space:
mode:
authorgareth <gareth>2001-01-06 22:40:21 +0000
committergareth <gareth>2001-01-06 22:40:21 +0000
commit58a7f55466fde1831eae5cdf235a8880f45c6543 (patch)
tree59571f29672659cec471f4e90e9f6a14f1bf1299 /xc/extras
parente390b64259d19fa1341721ceb0a777db821a8aae (diff)
Import latest Mesa code.
Diffstat (limited to 'xc/extras')
-rw-r--r--xc/extras/Mesa/src/OSmesa/osmesa.c9
-rw-r--r--xc/extras/Mesa/src/X/xmesa1.c29
-rw-r--r--xc/extras/Mesa/src/texture.c19
3 files changed, 29 insertions, 28 deletions
diff --git a/xc/extras/Mesa/src/OSmesa/osmesa.c b/xc/extras/Mesa/src/OSmesa/osmesa.c
index 09e6ed0e9..cbb9d0faf 100644
--- a/xc/extras/Mesa/src/OSmesa/osmesa.c
+++ b/xc/extras/Mesa/src/OSmesa/osmesa.c
@@ -2,19 +2,19 @@
/*
* Mesa 3-D graphics library
* Version: 3.3
- *
+ *
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -226,6 +226,7 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist )
gl_extensions_enable(&(osmesa->gl_ctx),"GL_HP_occlusion_test");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_ARB_texture_cube_map");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_EXT_texture_env_combine");
+ gl_extensions_enable(&(osmesa->gl_ctx), "GL_EXT_texture_env_dot3");
osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual,
osmesa->gl_visual->DepthBits > 0,
diff --git a/xc/extras/Mesa/src/X/xmesa1.c b/xc/extras/Mesa/src/X/xmesa1.c
index f7400da4b..5e4722c89 100644
--- a/xc/extras/Mesa/src/X/xmesa1.c
+++ b/xc/extras/Mesa/src/X/xmesa1.c
@@ -2,19 +2,19 @@
/*
* Mesa 3-D graphics library
* Version: 3.4
- *
+ *
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -147,7 +147,7 @@ static short hpcr_rgbTbl[3][256] = {
176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223
-}
+}
};
@@ -783,7 +783,7 @@ noFaultXAllocColor( int client,
subColor.pixel = (unsigned long) bestmatch;
subColor.red = ctable[bestmatch].red;
subColor.green = ctable[bestmatch].green;
- subColor.blue = ctable[bestmatch].blue;
+ subColor.blue = ctable[bestmatch].blue;
subColor.flags = DoRed | DoGreen | DoBlue;
*alloced = 0;
}
@@ -821,7 +821,7 @@ static GLboolean setup_grayscale( int client, XMesaVisual v,
prevBuffer = find_xmesa_buffer(v->display, cmap, buffer);
if (prevBuffer &&
- (buffer->xm_visual->gl_visual->RGBAflag ==
+ (buffer->xm_visual->gl_visual->RGBAflag ==
prevBuffer->xm_visual->gl_visual->RGBAflag)) {
/* Copy colormap stuff from previous XMesaBuffer which uses same
* X colormap. Do this to avoid time spent in noFaultXAllocColor.
@@ -909,7 +909,7 @@ static GLboolean setup_dithered_color( int client, XMesaVisual v,
prevBuffer = find_xmesa_buffer(v->display, cmap, buffer);
if (prevBuffer &&
- (buffer->xm_visual->gl_visual->RGBAflag ==
+ (buffer->xm_visual->gl_visual->RGBAflag ==
prevBuffer->xm_visual->gl_visual->RGBAflag)) {
/* Copy colormap stuff from previous, matching XMesaBuffer.
* Do this to avoid time spent in noFaultXAllocColor.
@@ -982,8 +982,8 @@ static void setup_8bit_hpcr( XMesaVisual v )
int i;
double g;
- g = 1.0 / v->RedGamma;
- for (i=0; i<256; i++) {
+ g = 1.0 / v->RedGamma;
+ for (i=0; i<256; i++) {
GLint red = (GLint) (255.0 * pow( hpcr_rgbTbl[0][i]/255.0, g ) + 0.5);
v->hpcr_rgbTbl[0][i] = CLAMP( red, 16, 239 );
}
@@ -1643,6 +1643,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
gl_extensions_enable(c->gl_ctx, "GL_HP_occlusion_test");
gl_extensions_enable(c->gl_ctx, "GL_ARB_texture_cube_map");
gl_extensions_enable(c->gl_ctx, "GL_EXT_texture_env_combine");
+ gl_extensions_enable(c->gl_ctx, "GL_EXT_texture_env_dot3");
if (CHECK_BYTE_ORDER(v)) {
c->swapbytes = GL_FALSE;
@@ -1839,7 +1840,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
attribs[numAttribs++] = (int) c->gl_ctx;
}
attribs[numAttribs++] = FXMESA_NONE;
-
+
if ((hw = fxQueryHardware())==GR_SSTTYPE_VOODOO) {
b->FXctx = fxMesaCreateBestContext(0, b->width, b->height, attribs);
if ((v->undithered_pf!=PF_INDEX) && (b->backimage)) {
@@ -2271,7 +2272,7 @@ static void FXgetImage( XMesaBuffer b )
/* read row from 3Dfx frame buffer */
grLfbReadRegion( GR_BUFFER_FRONTBUFFER,
0, xmesa->xm_buffer->FXctx->height-(b->height-y),
- b->width, 1,
+ b->width, 1,
0,
pixbuf );
@@ -2290,7 +2291,7 @@ static void FXgetImage( XMesaBuffer b )
/* read row from 3Dfx frame buffer */
grLfbReadRegion( GR_BUFFER_FRONTBUFFER,
0, xmesa->xm_buffer->FXctx->height-(b->height-y),
- b->width, 1,
+ b->width, 1,
0,
pixbuf );
@@ -2623,5 +2624,3 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
}
return 0;
}
-
-
diff --git a/xc/extras/Mesa/src/texture.c b/xc/extras/Mesa/src/texture.c
index 93eddec27..2b8a57668 100644
--- a/xc/extras/Mesa/src/texture.c
+++ b/xc/extras/Mesa/src/texture.c
@@ -2003,6 +2003,7 @@ _mesa_set_texture_sampler( struct gl_texture_object *t )
#define PROD(A,B) ( (GLuint)(A) * ((GLuint)(B)+1) )
+#define S_PROD(A,B) ( (GLint)(A) * ((GLint)(B)+1) )
static INLINE void
_mesa_texture_combine(const GLcontext *ctx,
@@ -2227,15 +2228,15 @@ _mesa_texture_combine(const GLcontext *ctx,
*/
RGBshift = 6;
for (i = 0; i < n; i++) {
- GLuint dot = (PROD(arg0[i][RCOMP] - 128,
- arg1[i][RCOMP] - 128) +
- PROD(arg0[i][GCOMP] - 128,
- arg1[i][GCOMP] - 128) +
- PROD(arg0[i][BCOMP] - 128,
- arg1[i][BCOMP] - 128)) >> RGBshift;
- rgba[i][RCOMP] = (GLubyte) MIN2(dot, 255);
- rgba[i][GCOMP] = (GLubyte) MIN2(dot, 255);
- rgba[i][BCOMP] = (GLubyte) MIN2(dot, 255);
+ GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - 128,
+ (GLint)arg1[i][RCOMP] - 128) +
+ S_PROD((GLint)arg0[i][GCOMP] - 128,
+ (GLint)arg1[i][GCOMP] - 128) +
+ S_PROD((GLint)arg0[i][BCOMP] - 128,
+ (GLint)arg1[i][BCOMP] - 128)) >> RGBshift;
+ rgba[i][RCOMP] = (GLubyte) CLAMP(dot, 0, 255);
+ rgba[i][GCOMP] = (GLubyte) CLAMP(dot, 0, 255);
+ rgba[i][BCOMP] = (GLubyte) CLAMP(dot, 0, 255);
}
}
break;