-/* $Id: s_context.c,v 1.26 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_context.c,v 1.27 2002/01/10 16:54:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
static void
_swrast_validate_texture_sample( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
-/* $Id: s_context.h,v 1.13 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_context.h,v 1.14 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
*/
typedef void (*TextureSampleFunc)( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] );
-/* $Id: s_copypix.c,v 1.26 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.27 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
if (ctx->Texture._ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
- GLfloat s[MAX_WIDTH], t[MAX_WIDTH], r[MAX_WIDTH], q[MAX_WIDTH];
- GLfloat texcoord[MAX_WIDTH][3];
GLchan primary_rgba[MAX_WIDTH][4];
GLuint unit;
+ DEFMARRAY(GLfloat, texcoord, MAX_WIDTH, 4); /* mac 32k limitation */
+ CHECKARRAY(texcoord, return); /* mac 32k limitation */
+
/* XXX not sure how multitexture is supposed to work here */
MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- GLint i;
_mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
- s, t, r, q);
- /* this is an ugly work-around. s,t,r has to be copied to
- texcoords, because the functions need different
- input. */
- for (i=0; i<width; i++) {
- texcoord[i][0] = s[i],
- texcoord[i][1] = t[i],
- texcoord[i][2] = r[i];
- }
+ texcoord);
_old_swrast_texture_fragments( ctx, unit, width, texcoord, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
+ (CONST GLchan (*)[4]) primary_rgba,
+ rgba);
}
+ UNDEFARRAY(texcoord); /* mac 32k limitation */
}
/* write row to framebuffer */
if (ctx->Texture._ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
GLuint unit;
GLchan primary_rgba[MAX_WIDTH][4];
- GLfloat texcoord[MAX_WIDTH][3];
- DEFARRAY(GLfloat, s, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, t, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, r, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, q, MAX_WIDTH); /* mac 32k limitation */
- CHECKARRAY(s, return); /* mac 32k limitation */
- CHECKARRAY(t, return);
- CHECKARRAY(r, return);
- CHECKARRAY(q, return);
+ DEFMARRAY(GLfloat, texcoord, MAX_WIDTH, 4); /* mac 32k limitation */
+ CHECKARRAY(texcoord, return); /* mac 32k limitation */
/* XXX not sure how multitexture is supposed to work here */
MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
_mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
- s, t, r, q);
- /* this is an ugly work-around. s,t,r has to be copied to
- texcoords, because the functions need different
- input. */
- for (i=0; i<width; i++) {
- texcoord[i][0] = s[i],
- texcoord[i][1] = t[i],
- texcoord[i][2] = r[i];
- }
+ texcoord);
_old_swrast_texture_fragments( ctx, unit, width, texcoord, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
+ (CONST GLchan (*)[4]) primary_rgba,
+ rgba);
}
- UNDEFARRAY(s); /* mac 32k limitation */
- UNDEFARRAY(t);
- UNDEFARRAY(r);
- UNDEFARRAY(q);
+ UNDEFARRAY(texcoord); /* mac 32k limitation */
}
if (quick_draw && dy >= 0 && dy < ctx->DrawBuffer->Height) {
-/* $Id: s_drawpix.c,v 1.23 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.24 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
if (ctx->Texture._ReallyEnabled && ctx->Pixel.PixelTextureEnabled) {
GLchan primary_rgba[MAX_WIDTH][4];
GLuint unit;
- GLfloat texcoord[MAX_WIDTH][3];
- DEFARRAY(GLfloat, s, MAX_WIDTH); /* mac 32k limitation */
- DEFARRAY(GLfloat, t, MAX_WIDTH);
- DEFARRAY(GLfloat, r, MAX_WIDTH);
- DEFARRAY(GLfloat, q, MAX_WIDTH);
- CHECKARRAY(s, return); /* mac 32k limitation */
- CHECKARRAY(t, return);
- CHECKARRAY(r, return);
- CHECKARRAY(q, return);
+
+ DEFMARRAY(GLfloat, texcoord, MAX_WIDTH, 4);/* mac 32k limitation */
+ CHECKARRAY(texcoord, return); /* mac 32k limitation */
/* XXX not sure how multitexture is supposed to work here */
MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
- GLint i;
_mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
- s, t, r, q);
- /* this is an ugly work-around. s,t,r has to be
- copied to texcoords, because the functions need
- different input. */
- for (i=0; i<width; i++) {
- texcoord[i][0] = s[i],
- texcoord[i][1] = t[i],
- texcoord[i][2] = r[i];
- }
+ texcoord);
_old_swrast_texture_fragments( ctx, unit, width,
texcoord, NULL,
(CONST GLchan (*)[4]) primary_rgba,
rgba);
}
}
- UNDEFARRAY(s); /* mac 32k limitation */
- UNDEFARRAY(t);
- UNDEFARRAY(r);
- UNDEFARRAY(q);
+ UNDEFARRAY(texcoord); /* mac 32k limitation */
}
if (quickDraw) {
-/* $Id: s_pixeltex.c,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
+/* $Id: s_pixeltex.c,v 1.4 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
*/
void
_mesa_pixeltexgen(GLcontext *ctx, GLuint n, const GLchan rgba[][4],
- GLfloat s[], GLfloat t[], GLfloat r[], GLfloat q[])
+ GLfloat texcoord[][4])
{
if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_COLOR) {
GLuint i;
for (i = 0; i < n; i++) {
- s[i] = ctx->Current.RasterColor[RCOMP];
- t[i] = ctx->Current.RasterColor[GCOMP];
- r[i] = ctx->Current.RasterColor[BCOMP];
+ texcoord[i][0] = ctx->Current.RasterColor[RCOMP];
+ texcoord[i][1] = ctx->Current.RasterColor[GCOMP];
+ texcoord[i][2] = ctx->Current.RasterColor[BCOMP];
}
}
else {
GLuint i;
ASSERT(ctx->Pixel.FragmentRgbSource == GL_PIXEL_GROUP_COLOR_SGIS);
for (i = 0; i < n; i++) {
- s[i] = CHAN_TO_FLOAT(rgba[i][RCOMP]);
- t[i] = CHAN_TO_FLOAT(rgba[i][GCOMP]);
- r[i] = CHAN_TO_FLOAT(rgba[i][BCOMP]);
+ texcoord[i][0] = CHAN_TO_FLOAT(rgba[i][RCOMP]);
+ texcoord[i][1] = CHAN_TO_FLOAT(rgba[i][GCOMP]);
+ texcoord[i][2] = CHAN_TO_FLOAT(rgba[i][BCOMP]);
}
}
if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_COLOR) {
GLuint i;
for (i = 0; i < n; i++) {
- q[i] = ctx->Current.RasterColor[ACOMP];
+ texcoord[i][3] = ctx->Current.RasterColor[ACOMP];
}
}
else {
GLuint i;
ASSERT(ctx->Pixel.FragmentAlphaSource == GL_PIXEL_GROUP_COLOR_SGIS);
for (i = 0; i < n; i++) {
- q[i] = CHAN_TO_FLOAT(rgba[i][ACOMP]);
+ texcoord[i][3] = CHAN_TO_FLOAT(rgba[i][ACOMP]);
}
}
}
-/* $Id: s_pixeltex.h,v 1.3 2001/03/12 00:48:42 gareth Exp $ */
+/* $Id: s_pixeltex.h,v 1.4 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
extern void
_mesa_pixeltexgen(GLcontext *ctx, GLuint n, const GLchan rgba[][4],
- GLfloat s[], GLfloat t[], GLfloat r[], GLfloat q[]);
+ GLfloat texcoord[][4]);
#endif
-/* $Id: s_span.c,v 1.20 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_span.c,v 1.21 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
void
_old_write_texture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLdepth z[], const GLfloat fog[],
- GLfloat texcoord[][3],
+ GLfloat texcoord[][4],
GLfloat lambda[],
GLchan rgbaIn[][4], GLchan spec[][4],
const GLfloat coverage[], GLenum primitive )
void
_old_write_multitexture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLdepth z[], const GLfloat fog[],
- GLfloat texcoord[MAX_TEXTURE_UNITS][MAX_WIDTH][3],
+ GLfloat texcoord[MAX_TEXTURE_UNITS][MAX_WIDTH][4],
GLfloat lambda[][MAX_WIDTH],
GLchan rgbaIn[MAX_TEXTURE_UNITS][4],
GLchan spec[MAX_TEXTURE_UNITS][4],
-/* $Id: s_span.h,v 1.8 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_span.h,v 1.9 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
extern void
_old_write_texture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLdepth z[], const GLfloat fog[],
- GLfloat texcoord[][3], GLfloat lambda[],
+ GLfloat texcoord[][4], GLfloat lambda[],
GLchan rgba[][4], GLchan spec[][4],
const GLfloat coverage[], GLenum primitive );
extern void
_old_write_multitexture_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
- const GLdepth z[], const GLfloat fog[],
- GLfloat texcoord[MAX_TEXTURE_UNITS][MAX_WIDTH][3],
- GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH],
- GLchan rgba[][4], GLchan spec[][4],
- const GLfloat coverage[], GLenum primitive );
+ const GLdepth z[], const GLfloat fog[],
+ GLfloat texcoord[MAX_TEXTURE_UNITS][MAX_WIDTH][4],
+ GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH],
+ GLchan rgba[][4], GLchan spec[][4],
+ const GLfloat coverage[], GLenum primitive );
extern void
-/* $Id: s_texture.c,v 1.44 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_texture.c,v 1.45 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
static void
sample_nearest_1d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4] )
{
GLuint i;
static void
sample_linear_1d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4] )
{
GLuint i;
static void
sample_lambda_1d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3],
+ GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
GLfloat MinMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
static void
sample_nearest_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3],
+ GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
static void
sample_linear_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3],
+ GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
static void
opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
const GLfloat lambda[],
GLchan rgba[][4] )
{
static void
opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
const GLfloat lambda[],
GLchan rgba[][4] )
{
static void
sample_lambda_2d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
const GLfloat lambda[],
GLchan rgba[][4] )
{
static void
sample_nearest_3d(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
GLuint i;
static void
sample_linear_3d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3],
+ GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
static void
sample_lambda_3d( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4] )
{
GLuint i;
static void
sample_nearest_cube(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
GLuint i;
static void
sample_linear_cube(GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3],
+ GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
static void
sample_lambda_cube( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
GLfloat MinMagThresh = SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit];
static void
null_sample_func( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj, GLuint n,
- GLfloat texcoords[][3], const GLfloat lambda[],
+ GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
}
static void
sample_depth_texture(const GLcontext *ctx,
const struct gl_texture_unit *texUnit,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
GLchan texel[][4])
{
const struct gl_texture_object *texObj = texUnit->_Current;
static void
sample_depth_texture2(const GLcontext *ctx,
const struct gl_texture_unit *texUnit,
- GLuint n, GLfloat texcoords[][3],
+ GLuint n, GLfloat texcoords[][4],
GLchan texel[][4])
{
const struct gl_texture_object *texObj = texUnit->_Current;
*/
void
_old_swrast_texture_fragments( GLcontext *ctx, GLuint texUnit, GLuint n,
- GLfloat texcoords[][3], GLfloat lambda[],
+ GLfloat texcoords[][4], GLfloat lambda[],
CONST GLchan primary_rgba[][4],
GLchan rgba[][4] )
{
-/* $Id: s_texture.h,v 1.7 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: s_texture.h,v 1.8 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
extern void
_old_swrast_texture_fragments( GLcontext *ctx, GLuint texSet, GLuint n,
- GLfloat texcoords[][3], GLfloat lambda[],
+ GLfloat texcoords[][4], GLfloat lambda[],
CONST GLchan primary_rgba[][4], GLchan rgba[][4] );
-/* $Id: swrast.h,v 1.13 2001/12/17 04:54:35 brianp Exp $ */
+/* $Id: swrast.h,v 1.14 2002/01/10 16:54:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 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"),
} color;
GLchan specular[MAX_WIDTH][4];
GLint itexcoords[MAX_WIDTH][2]; /* s, t */
- GLfloat texcoords[MAX_TEXTURE_UNITS][MAX_WIDTH][3]; /* s, t, r */
+ GLfloat texcoords[MAX_TEXTURE_UNITS][MAX_WIDTH][4]; /* s, t, r */
GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH];
GLfloat coverage[MAX_WIDTH];
GLubyte mask[MAX_WIDTH];