summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_copypix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_copypix.c')
-rw-r--r--src/mesa/swrast/s_copypix.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index f4d08f8f85a..c28a6f78b1f 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -1,4 +1,4 @@
-/* $Id: s_copypix.c,v 1.25 2001/12/14 02:50:57 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.26 2001/12/17 04:54:35 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -268,6 +268,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
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;
/* XXX not sure how multitexture is supposed to work here */
@@ -275,11 +276,20 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
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);
- _swrast_texture_fragments(ctx, unit, width, s, t, r, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
+ /* 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];
+ }
+ _old_swrast_texture_fragments( ctx, unit, width, texcoord, NULL,
+ (CONST GLchan (*)[4]) primary_rgba,
+ rgba);
}
}
@@ -295,7 +305,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
(const GLchan (*)[4])rgba, desty);
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
+ _old_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
NULL, GL_BITMAP );
}
}
@@ -530,6 +540,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
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 */
@@ -545,9 +556,17 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
_mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
s, t, r, q);
- _swrast_texture_fragments(ctx, unit, width, s, t, r, NULL,
- (CONST GLchan (*)[4]) primary_rgba,
- rgba);
+ /* 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];
+ }
+ _old_swrast_texture_fragments( ctx, unit, width, texcoord, NULL,
+ (CONST GLchan (*)[4]) primary_rgba,
+ rgba);
}
UNDEFARRAY(s); /* mac 32k limitation */
@@ -565,7 +584,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
(const GLchan (*)[4])rgba, desty);
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
+ _old_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
NULL, GL_BITMAP );
}
}
@@ -689,7 +708,7 @@ static void copy_ci_pixels( GLcontext *ctx,
indexes, desty );
}
else {
- _mesa_write_index_span(ctx, width, destx, dy, zspan, fogSpan, indexes,
+ _old_write_index_span(ctx, width, destx, dy, zspan, fogSpan, indexes,
NULL, GL_BITMAP);
}
}
@@ -819,7 +838,7 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
fogSpan, (const GLchan (*)[4])rgba, desty );
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
+ _old_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
(GLchan (*)[4])rgba, NULL, GL_BITMAP);
}
}
@@ -829,7 +848,7 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
zspan, fogSpan, indexes, desty );
}
else {
- _mesa_write_index_span( ctx, width, destx, dy,
+ _old_write_index_span( ctx, width, destx, dy,
zspan, fogSpan, indexes, NULL, GL_BITMAP );
}
}