diff options
Diffstat (limited to 'src/mesa/swrast/s_triangle.c')
-rw-r--r-- | src/mesa/swrast/s_triangle.c | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 1819e4430fc..d268b2e754d 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1,4 +1,4 @@ -/* $Id: s_triangle.c,v 1.10 2001/01/29 18:51:25 brianp Exp $ */ +/* $Id: s_triangle.c,v 1.11 2001/02/06 21:42:49 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -243,14 +243,12 @@ static void simple_textured_triangle( GLcontext *ctx, GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ GLfloat theight = (GLfloat) obj->Image[b]->Height; \ GLint twidth_log2 = obj->Image[b]->WidthLog2; \ - GLchan *texture = obj->Image[b]->Data; \ + const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \ GLint smask = obj->Image[b]->Width - 1; \ GLint tmask = obj->Image[b]->Height - 1; \ if (!texture) { \ - if (!_mesa_get_teximages_from_driver(ctx, obj)) \ - return; \ - texture = obj->Image[b]->Data; \ - ASSERT(texture); \ + /* this shouldn't happen */ \ + return; \ } #define INNER_LOOP( LEFT, RIGHT, Y ) \ @@ -304,14 +302,12 @@ static void simple_z_textured_triangle( GLcontext *ctx, GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ GLfloat theight = (GLfloat) obj->Image[b]->Height; \ GLint twidth_log2 = obj->Image[b]->WidthLog2; \ - GLchan *texture = obj->Image[b]->Data; \ + const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \ GLint smask = obj->Image[b]->Width - 1; \ GLint tmask = obj->Image[b]->Height - 1; \ if (!texture) { \ - if (!_mesa_get_teximages_from_driver(ctx, obj)) \ - return; \ - texture = obj->Image[b]->Data; \ - ASSERT(texture); \ + /* this shouldn't happen */ \ + return; \ } #define INNER_LOOP( LEFT, RIGHT, Y ) \ @@ -376,7 +372,7 @@ static void affine_textured_triangle( GLcontext *ctx, GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ GLfloat theight = (GLfloat) obj->Image[b]->Height; \ GLint twidth_log2 = obj->Image[b]->WidthLog2; \ - GLchan *texture = obj->Image[b]->Data; \ + const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \ GLint smask = obj->Image[b]->Width - 1; \ GLint tmask = obj->Image[b]->Height - 1; \ GLint format = obj->Image[b]->Format; \ @@ -386,10 +382,8 @@ static void affine_textured_triangle( GLcontext *ctx, GLfixed er, eg, eb, ea; \ GLint tr, tg, tb, ta; \ if (!texture) { \ - if (!_mesa_get_teximages_from_driver(ctx, obj)) \ - return; \ - texture = obj->Image[b]->Data; \ - ASSERT(texture); \ + /* this shouldn't happen */ \ + return; \ } \ if (envmode == GL_BLEND || envmode == GL_ADD) { \ /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \ @@ -499,7 +493,7 @@ static void affine_textured_triangle( GLcontext *ctx, GLint s = FixedToInt(ffs) & smask; \ GLint t = FixedToInt(fft) & tmask; \ GLint pos = (t << twidth_log2) + s; \ - GLchan *tex00 = texture + COMP * pos; \ + const GLchan *tex00 = texture + COMP * pos; \ zspan[i] = FixedToDepth(ffz); \ fogspan[i] = fffog / 256; \ DO_TEX; \ @@ -523,10 +517,10 @@ static void affine_textured_triangle( GLcontext *ctx, GLint si = FIXED_FRAC_MASK - sf; \ GLint ti = FIXED_FRAC_MASK - tf; \ GLint pos = (t << twidth_log2) + s; \ - GLchan *tex00 = texture + COMP * pos; \ - GLchan *tex10 = tex00 + tbytesline; \ - GLchan *tex01 = tex00 + COMP; \ - GLchan *tex11 = tex10 + COMP; \ + const GLchan *tex00 = texture + COMP * pos; \ + const GLchan *tex10 = tex00 + tbytesline; \ + const GLchan *tex01 = tex00 + COMP; \ + const GLchan *tex11 = tex10 + COMP; \ if (t == tmask) { \ tex10 -= tsize; \ tex11 -= tsize; \ @@ -705,7 +699,7 @@ static void near_persp_textured_triangle(GLcontext *ctx, const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ const GLfloat theight = (GLfloat) obj->Image[b]->Height; \ const GLint twidth_log2 = obj->Image[b]->WidthLog2; \ - GLchan *texture = obj->Image[b]->Data; \ + const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \ const GLint smask = (obj->Image[b]->Width - 1); \ const GLint tmask = (obj->Image[b]->Height - 1); \ const GLint format = obj->Image[b]->Format; \ @@ -714,10 +708,8 @@ static void near_persp_textured_triangle(GLcontext *ctx, GLfixed er, eg, eb, ea; \ GLint tr, tg, tb, ta; \ if (!texture) { \ - if (!_mesa_get_teximages_from_driver(ctx, obj)) \ - return; \ - texture = obj->Image[b]->Data; \ - ASSERT(texture); \ + /* this shouldn't happen */ \ + return; \ } \ if (envmode == GL_BLEND || envmode == GL_ADD) { \ er = FloatToFixed(unit->EnvColor[0]); \ @@ -1448,10 +1440,7 @@ static void lin_persp_textured_triangle( GLcontext *ctx, GLfixed er, eg, eb, ea; \ GLint tr, tg, tb, ta; \ if (!texture) { \ - if (!_mesa_get_teximages_from_driver(ctx, obj)) \ - return; \ - texture = obj->Image[b]->Data; \ - ASSERT(texture); \ + return; \ } \ if (envmode == GL_BLEND || envmode == GL_ADD) { \ er = FloatToFixed(unit->EnvColor[0]); \ @@ -2304,6 +2293,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && ((image = current2Dtex->Image[current2Dtex->BaseLevel]) != 0) /* correct! */ && image->Border==0 && ((format = image->Format)==GL_RGB || format==GL_RGBA) + && image->Type == CHAN_TYPE && (filter = current2Dtex->MinFilter)==current2Dtex->MagFilter /* ==> current2Dtex->MinFilter != GL_XXX_MIPMAP_XXX */ && ctx->Light.Model.ColorControl==GL_SINGLE_COLOR |