From 10f30eb43835c57c00783390a02d72daf4f78e26 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 17 Dec 2001 04:54:35 +0000 Subject: first checkpoint commit of Klaus's new span code (struct sw_span) --- src/mesa/swrast/s_copypix.c | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'src/mesa/swrast/s_copypix.c') diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index f4d08f8..c28a6f7 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; iTexture._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