summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2007-04-25 08:40:39 +0200
committerJulien Cristau <jcristau@debian.org>2007-04-25 08:40:39 +0200
commitdee1b0d5bbe91f83854813cbbcd3090327bcb5c2 (patch)
tree3c4a99f1c8f0c8f623a9bf1e9ac6c1a989e216e5
parent6f2b0fe4638cf838cbcc852777abc35794154399 (diff)
parentc233aa27684cd0c6c44200c3afcf4a9d5863a947 (diff)
Merge remote branch 'upstream/master' into debian-experimental
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vb.c2
-rw-r--r--src/mesa/swrast/s_aaline.c6
-rw-r--r--src/mesa/swrast/s_aalinetemp.h8
-rw-r--r--src/mesa/swrast/s_aatriangle.c4
-rw-r--r--src/mesa/swrast/s_aatritemp.h18
-rw-r--r--src/mesa/swrast/s_lines.c41
-rw-r--r--src/mesa/swrast/s_linetemp.h34
-rw-r--r--src/mesa/swrast/s_points.c10
-rw-r--r--src/mesa/swrast/s_pointtemp.h12
-rw-r--r--src/mesa/swrast/s_triangle.c54
-rw-r--r--src/mesa/swrast/s_tritemp.h19
-rw-r--r--src/mesa/tnl_dd/t_dd_vb.c2
12 files changed, 66 insertions, 144 deletions
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
index 519ec81e548..81bcf802c71 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
@@ -81,7 +81,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
dst->specular[2] = ((GLubyte *)p)[0];
dst->specular[1] = ((GLubyte *)p)[1];
dst->specular[0] = ((GLubyte *)p)[2];
- dst->fog = ((GLubyte *)p)[3];
+ dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3];
p++;
case TINY_VERTEX_FORMAT:
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index c81095163b0..3bb53dc2d7f 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -67,7 +67,7 @@ struct LineInfo
GLfloat iPlane[4];
/* DO_SPEC */
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
- /* DO_TEXVAR */
+ /* DO_ATTRIBS */
GLfloat sPlane[FRAG_ATTRIB_MAX][4];
GLfloat tPlane[FRAG_ATTRIB_MAX][4];
GLfloat uPlane[FRAG_ATTRIB_MAX][4];
@@ -499,7 +499,7 @@ segment(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#include "s_aalinetemp.h"
@@ -507,7 +507,7 @@ segment(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#define DO_SPEC
#include "s_aalinetemp.h"
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index ef26e9edc8b..402d64b9f75 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -80,7 +80,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
line->span.array->spec[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane);
line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane);
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
GLfloat invQ;
@@ -202,7 +202,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
constant_plane(v1->index, line.iPlane);
}
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
{
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
@@ -225,7 +225,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
line.texWidth[attr] = (GLfloat) texImage->Width;
- line.texHeight[attr] = (GLfloat) texImage->Height;
+ line.texHeight[attr] = (GLfloat) texImage->Height;
}
ATTRIB_LOOP_END
}
@@ -290,5 +290,5 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
#undef DO_RGBA
#undef DO_INDEX
#undef DO_SPEC
-#undef DO_TEXVAR
+#undef DO_ATTRIBS
#undef NAME
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c
index 5e3059af93b..0d95f06a9de 100644
--- a/src/mesa/swrast/s_aatriangle.c
+++ b/src/mesa/swrast/s_aatriangle.c
@@ -408,7 +408,7 @@ tex_aa_tri(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#include "s_aatritemp.h"
}
@@ -422,7 +422,7 @@ spec_tex_aa_tri(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#define DO_SPEC
#include "s_aatritemp.h"
}
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 8ff52cb932b..39456cc192b 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -36,7 +36,7 @@
* DO_RGBA - if defined, compute RGBA values
* DO_INDEX - if defined, compute color index values
* DO_SPEC - if defined, compute specular RGB values
- * DO_TEXVAR - if defined, compute texcoords, varying
+ * DO_ATTRIBS - if defined, compute texcoords, varying, etc.
*/
/*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
@@ -70,7 +70,7 @@
#ifdef DO_SPEC
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
GLfloat sPlane[FRAG_ATTRIB_MAX][4]; /* texture S */
GLfloat tPlane[FRAG_ATTRIB_MAX][4]; /* texture T */
GLfloat uPlane[FRAG_ATTRIB_MAX][4]; /* texture R */
@@ -181,7 +181,7 @@
}
span.arrayMask |= SPAN_SPEC;
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
{
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
@@ -283,7 +283,7 @@
array->spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]);
array->attribs[attr][count][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
@@ -375,7 +375,7 @@
array->spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]);
array->attribs[attr][ix][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
@@ -426,13 +426,13 @@
array->attribs[FRAG_ATTRIB_FOGC][j][0]
= array->attribs[FRAG_ATTRIB_FOGC][j + left][0];
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
array->lambda[0][j] = array->lambda[0][j + left];
#endif
array->coverage[j] = array->coverage[j + left];
}
}
-#ifdef DO_TEXVAR
+#ifdef DO_ATTRIBS
/* shift texcoords, varying */
{
SWspanarrays *array = span.array;
@@ -482,8 +482,8 @@
#undef DO_SPEC
#endif
-#ifdef DO_TEXVAR
-#undef DO_TEXVAR
+#ifdef DO_ATTRIBS
+#undef DO_ATTRIBS
#endif
#ifdef DO_OCCLUSION_TEST
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 7b2a52b4ffa..80702e41a3c 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 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"),
@@ -171,34 +171,13 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
#include "s_linetemp.h"
-/* Single-texture line, w/ fog, Z, specular, etc. */
+/* General-purpose textured line (any/all features). */
#define NAME textured_line
#define INTERP_RGBA
-#define INTERP_Z
-#define INTERP_FOG
-#define INTERP_TEX
-#define RENDER_SPAN(span) \
- if (ctx->Line.StippleFlag) { \
- span.arrayMask |= SPAN_MASK; \
- compute_stipple_mask(ctx, span.end, span.array->mask); \
- } \
- if (ctx->Line._Width > 1.0) { \
- draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
- } \
- else { \
- _swrast_write_rgba_span(ctx, &span); \
- }
-#include "s_linetemp.h"
-
-
-/* Multi-texture or separate specular line, w/ fog, Z, specular, etc. */
-#define NAME multitextured_line
-#define INTERP_RGBA
#define INTERP_SPEC
#define INTERP_Z
#define INTERP_FOG
-#define INTERP_MULTITEX
-#define INTERP_VARYING
+#define INTERP_ATTRIBS
#define RENDER_SPAN(span) \
if (ctx->Line.StippleFlag) { \
span.arrayMask |= SPAN_MASK; \
@@ -251,8 +230,6 @@ _mesa_print_line_function(GLcontext *ctx)
_mesa_printf("general_rgba_line\n");
else if (swrast->Line == textured_line)
_mesa_printf("textured_line\n");
- else if (swrast->Line == multitextured_line)
- _mesa_printf("multitextured_line\n");
else
_mesa_printf("Driver func %p\n", (void *(*)()) swrast->Line);
}
@@ -302,15 +279,7 @@ _swrast_choose_line( GLcontext *ctx )
else if (ctx->Texture._EnabledCoordUnits
|| ctx->FragmentProgram._Current) {
/* textured lines */
- if (ctx->Texture._EnabledCoordUnits > 0x1
- || NEED_SECONDARY_COLOR(ctx)
- || ctx->FragmentProgram._Current) {
- /* multi-texture and/or separate specular color */
- USE(multitextured_line);
- }
- else {
- USE(textured_line);
- }
+ USE(textured_line);
}
else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0
|| ctx->Line.StippleFlag) {
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 76da4467104..b6e8f287f45 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -35,9 +35,7 @@
* INTERP_RGBA - if defined, interpolate RGBA values
* INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_INDEX - if defined, interpolate color index values
- * INTERP_TEX - if defined, interpolate unit 0 texcoords
- * INTERP_MULTITEX - if defined, interpolate multi-texcoords
- * INTERP_VARYING - if defined, interpolate GLSL varyings
+ * INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc)
*
* When one can directly address pixels in the color buffer the following
* macros can be defined and used to directly compute pixel addresses during
@@ -284,32 +282,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0]
- vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels;
#endif
-#ifdef INTERP_TEX
- interpFlags |= SPAN_TEXTURE;
- {
- const GLfloat invw0 = vert0->win[3];
- const GLfloat invw1 = vert1->win[3];
- const GLfloat invLen = 1.0F / numPixels;
- GLfloat ds, dt, dr, dq;
- span.attrStart[FRAG_ATTRIB_TEX0][0] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][0];
- span.attrStart[FRAG_ATTRIB_TEX0][1] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][1];
- span.attrStart[FRAG_ATTRIB_TEX0][2] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][2];
- span.attrStart[FRAG_ATTRIB_TEX0][3] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][3];
- ds = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][0]) - span.attrStart[FRAG_ATTRIB_TEX0][0];
- dt = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][1]) - span.attrStart[FRAG_ATTRIB_TEX0][1];
- dr = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][2]) - span.attrStart[FRAG_ATTRIB_TEX0][2];
- dq = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][3]) - span.attrStart[FRAG_ATTRIB_TEX0][3];
- span.attrStepX[FRAG_ATTRIB_TEX0][0] = ds * invLen;
- span.attrStepX[FRAG_ATTRIB_TEX0][1] = dt * invLen;
- span.attrStepX[FRAG_ATTRIB_TEX0][2] = dr * invLen;
- span.attrStepX[FRAG_ATTRIB_TEX0][3] = dq * invLen;
- span.attrStepY[FRAG_ATTRIB_TEX0][0] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_TEX0][1] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_TEX0][2] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_TEX0][3] = 0.0F;
- }
-#endif
-#if defined(INTERP_MULTITEX) || defined(INTERP_VARYING)
+#if defined(INTERP_ATTRIBS)
interpFlags |= (SPAN_TEXTURE | SPAN_VARYING);
{
const GLfloat invLen = 1.0F / numPixels;
@@ -443,8 +416,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
#undef INTERP_FOG
#undef INTERP_RGBA
#undef INTERP_SPEC
-#undef INTERP_TEX
-#undef INTERP_MULTITEX
+#undef INTERP_ATTRIBS
#undef INTERP_INDEX
#undef PIXEL_ADDRESS
#undef PIXEL_TYPE
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 5879bccf1e3..1401b772caf 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -38,7 +38,7 @@
#define RGBA 0x1
#define INDEX 0x2
#define SMOOTH 0x4
-#define TEXTURE 0x8
+#define ATTRIBS 0x8
#define SPECULAR 0x10
#define LARGE 0x20
#define ATTENUATE 0x40
@@ -104,7 +104,7 @@
/*
* Textured RGBA points.
*/
-#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR)
#define NAME textured_rgba_point
#include "s_pointtemp.h"
@@ -112,7 +112,7 @@
/*
* Antialiased points with texture mapping.
*/
-#define FLAGS (RGBA | SMOOTH | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR)
#define NAME antialiased_tex_rgba_point
#include "s_pointtemp.h"
@@ -128,7 +128,7 @@
/*
* Distance attenuated, textured RGBA points.
*/
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR)
#define NAME atten_textured_rgba_point
#include "s_pointtemp.h"
@@ -136,7 +136,7 @@
/*
* Distance attenuated, antialiased points with or without texture mapping.
*/
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH)
+#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH)
#define NAME atten_antialiased_rgba_point
#include "s_pointtemp.h"
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index 500b3fef9df..d118a532a45 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -39,14 +39,14 @@
*
* RGBA = do rgba instead of color index
* SMOOTH = do antialiasing
- * TEXTURE = do texture coords
+ * ATTRIBS = general attributes (texcoords, etc)
* SPECULAR = do separate specular color
* LARGE = do points with diameter > 1 pixel
* ATTENUATE = compute point size attenuation
* SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite
*
* Notes: LARGE and ATTENUATE are exclusive of each other.
- * TEXTURE requires RGBA
+ * ATTRIBS requires RGBA
*/
@@ -86,7 +86,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
#if FLAGS & INDEX
const GLuint colorIndex = (GLuint) vert->index; /* XXX round? */
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */
#endif
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -117,7 +117,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
#if FLAGS & INDEX
span->arrayMask |= SPAN_INDEX;
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
if (ctx->FragmentProgram._Active) {
/* Don't divide texture s,t,r by q (use TXP to do that) */
@@ -272,7 +272,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
#if FLAGS & INDEX
span->array->index[count] = colorIndex;
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
ATTRIB_LOOP_BEGIN
COPY_4V(span->array->attribs[attr][count], attrib[attr]);
if (attr < FRAG_ATTRIB_VAR0) {
@@ -397,7 +397,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
#if FLAGS & INDEX
span->array->index[count] = colorIndex;
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
ATTRIB_LOOP_BEGIN
COPY_4V(span->array->attribs[attr][count], attribs[attr]);
ATTRIB_LOOP_END
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 3b7960bf80f..fc9d29bbf7f 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -67,24 +67,9 @@ _swrast_culltriangle( GLcontext *ctx,
/*
- * Render a flat-shaded color index triangle.
+ * Render a smooth or flat-shaded color index triangle.
*/
-#define NAME flat_ci_triangle
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define SETUP_CODE \
- span.interpMask |= SPAN_INDEX; \
- span.index = FloatToFixed(v2->index);\
- span.indexStep = 0;
-#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span);
-#include "s_tritemp.h"
-
-
-
-/*
- * Render a smooth-shaded color index triangle.
- */
-#define NAME smooth_ci_triangle
+#define NAME ci_triangle
#define INTERP_Z 1
#define INTERP_FOG 1
#define INTERP_INDEX 1
@@ -139,7 +124,7 @@ _swrast_culltriangle( GLcontext *ctx,
* Render an RGB, GL_DECAL, textured triangle.
* Interpolate S,T only w/out mipmapping or perspective correction.
*
- * No fog.
+ * No fog. No depth testing.
*/
#define NAME simple_textured_triangle
#define INTERP_INT_TEX 1
@@ -803,7 +788,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span,
#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
-#define INTERP_TEX 1
+#define INTERP_ATTRIBS 1
#define SETUP_CODE \
struct persp_info info; \
@@ -865,16 +850,16 @@ fast_persp_span(GLcontext *ctx, SWspan *span,
/*
- * Render a smooth-shaded, textured, RGBA triangle.
+ * Render an RGBA triangle with arbitrary attributes.
*/
-#define NAME general_textured_triangle
+#define NAME general_triangle
#define INTERP_Z 1
#define INTERP_W 1
#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
-#define INTERP_TEX 1
+#define INTERP_ATTRIBS 1
#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
#include "s_tritemp.h"
@@ -1054,6 +1039,11 @@ _swrast_choose_triangle( GLcontext *ctx )
}
}
+ if (!rgbmode) {
+ USE(ci_triangle);
+ return;
+ }
+
if (ctx->Texture._EnabledCoordUnits ||
ctx->FragmentProgram._Current ||
ctx->ATIFragmentShader._Enabled) {
@@ -1102,7 +1092,7 @@ _swrast_choose_triangle( GLcontext *ctx )
}
else {
#if (CHAN_BITS == 16 || CHAN_BITS == 32)
- USE(general_textured_triangle);
+ USE(general_triangle);
#else
USE(affine_textured_triangle);
#endif
@@ -1110,7 +1100,7 @@ _swrast_choose_triangle( GLcontext *ctx )
}
else {
#if (CHAN_BITS == 16 || CHAN_BITS == 32)
- USE(general_textured_triangle);
+ USE(general_triangle);
#else
USE(persp_textured_triangle);
#endif
@@ -1118,28 +1108,18 @@ _swrast_choose_triangle( GLcontext *ctx )
}
else {
/* general case textured triangles */
- USE(general_textured_triangle);
+ USE(general_triangle);
}
}
else {
ASSERT(!ctx->Texture._EnabledCoordUnits);
if (ctx->Light.ShadeModel==GL_SMOOTH) {
/* smooth shaded, no texturing, stippled or some raster ops */
- if (rgbmode) {
- USE(smooth_rgba_triangle);
- }
- else {
- USE(smooth_ci_triangle);
- }
+ USE(smooth_rgba_triangle);
}
else {
/* flat shaded, no texturing, stippled or some raster ops */
- if (rgbmode) {
- USE(flat_rgba_triangle);
- }
- else {
- USE(flat_ci_triangle);
- }
+ USE(flat_rgba_triangle);
}
}
}
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 97c79428c06..b8601bd5b4b 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -38,7 +38,8 @@
* INTERP_INDEX - if defined, interpolate color index values
* INTERP_INT_TEX - if defined, interpolate integer ST texcoords
* (fast, simple 2-D texture mapping)
- * INTERP_TEX - if defined, interpolate texcoords and varying vars
+ * INTERP_ATTRIBS - if defined, interpolate arbitrary attribs (texcoords,
+ * varying vars, etc)
* NOTE: OpenGL STRQ = Mesa STUV (R was taken for red)
*
* When one can directly address pixels in the color buffer the following
@@ -601,7 +602,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][1]);
}
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
span.interpMask |= (SPAN_TEXTURE | SPAN_VARYING);
{
/* win[3] is 1/W */
@@ -719,7 +720,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
GLfixed sLeft=0, dsOuter=0, dsInner;
GLfixed tLeft=0, dtOuter=0, dtInner;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
GLfloat sLeft[FRAG_ATTRIB_MAX];
GLfloat tLeft[FRAG_ATTRIB_MAX];
GLfloat uLeft[FRAG_ATTRIB_MAX];
@@ -986,7 +987,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]);
}
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
const GLfloat invW = vLower->win[3];
const GLfloat s0 = vLower->attrib[attr][0] * invW;
@@ -1057,7 +1058,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
dsInner = dsOuter + span.intTexStep[0];
dtInner = dtOuter + span.intTexStep[1];
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
dsInner[attr] = dsOuter[attr] + span.attrStepX[attr][0];
dtInner[attr] = dtOuter[attr] + span.attrStepX[attr][1];
@@ -1106,7 +1107,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
span.intTex[1] = tLeft;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
span.attrStart[attr][0] = sLeft[attr];
span.attrStart[attr][1] = tLeft[attr];
@@ -1194,7 +1195,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
sLeft += dsOuter;
tLeft += dtOuter;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
sLeft[attr] += dsOuter[attr];
tLeft[attr] += dtOuter[attr];
@@ -1239,7 +1240,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
sLeft += dsInner;
tLeft += dtInner;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
sLeft[attr] += dsInner[attr];
tLeft[attr] += dtInner[attr];
@@ -1276,7 +1277,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#undef INTERP_SPEC
#undef INTERP_INDEX
#undef INTERP_INT_TEX
-#undef INTERP_TEX
+#undef INTERP_ATTRIBS
#undef TEX_UNIT_LOOP
#undef VARYING_LOOP
diff --git a/src/mesa/tnl_dd/t_dd_vb.c b/src/mesa/tnl_dd/t_dd_vb.c
index 629f328a4d1..6cdd1bc0313 100644
--- a/src/mesa/tnl_dd/t_dd_vb.c
+++ b/src/mesa/tnl_dd/t_dd_vb.c
@@ -135,7 +135,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
dst->specular[1] = src->v.specular.green;
dst->specular[2] = src->v.specular.blue;
- dst->fog = src->v.specular.alpha/255.0;
+ dst->attrib[FRAG_ATTRIB_FOGC][0] = src->v.specular.alpha/255.0;
if (HAVE_PTEX_VERTICES &&
((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||