summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-03-08 17:33:33 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-03-08 17:33:33 +0000
commit95e02a210ed339ad20b0c16284dcdcf9af2dc755 (patch)
tree52876be8f56ec94a5f9ad951b59a2d7b8455835e /src/mesa
parent896e8bd2d7eb1385ca89e71b7eac146577320e00 (diff)
do fog interpolation if INTERP_FOG is defined, not when INTERP_Z is defined
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c4
-rw-r--r--src/mesa/drivers/x11/xm_tri.c24
-rw-r--r--src/mesa/swrast/s_lines.c27
-rw-r--r--src/mesa/swrast/s_linetemp.h16
-rw-r--r--src/mesa/swrast/s_triangle.c17
-rw-r--r--src/mesa/swrast/s_tritemp.h29
6 files changed, 80 insertions, 37 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 5b3b942780..0473717a0d 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.49 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: osmesa.c,v 1.50 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1596,7 +1596,6 @@ static void smooth_rgba_z_triangle( GLcontext *ctx,
{ \
GLint i, len = RIGHT-LEFT; \
GLchan *img = PIXELADDR4(LEFT, Y); \
- (void) fffog; \
for (i = 0; i < len; i++, img += 4) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -1638,7 +1637,6 @@ static void flat_rgba_z_triangle( GLcontext *ctx,
{ \
GLint i, len = RIGHT-LEFT; \
GLuint *img = (GLuint *) PIXELADDR4(LEFT, Y); \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 9f152265f7..a6a5346158 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1,4 +1,4 @@
-/* $Id: xm_tri.c,v 1.18 2001/02/06 04:06:36 keithw Exp $ */
+/* $Id: xm_tri.c,v 1.19 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -70,7 +70,6 @@ static void smooth_TRUECOLOR_z_triangle( GLcontext *ctx,
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer, Y); \
GLint len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -106,7 +105,6 @@ static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -140,7 +138,6 @@ static void smooth_8R8G8B_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -174,7 +171,6 @@ static void smooth_8R8G8B24_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -208,7 +204,6 @@ static void smooth_TRUEDITHER_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -244,7 +239,6 @@ static void smooth_5R6G5B_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -279,7 +273,6 @@ static void smooth_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
{ \
GLint i, len = RIGHT-LEFT; \
GLint yy = FLIP(xmesa->xm_buffer, Y); \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -314,7 +307,6 @@ static void smooth_DITHER8_z_triangle( GLcontext *ctx,
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -350,7 +342,6 @@ static void smooth_DITHER_z_triangle( GLcontext *ctx,
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -386,7 +377,6 @@ static void smooth_LOOKUP8_z_triangle( GLcontext *ctx,
{ \
GLint i, len = RIGHT-LEFT; \
LOOKUP_SETUP; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -421,7 +411,6 @@ static void smooth_HPCR_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -456,7 +445,6 @@ static void flat_TRUECOLOR_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -490,7 +478,6 @@ static void flat_8A8B8G8R_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -524,7 +511,6 @@ static void flat_8R8G8B_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -556,7 +542,6 @@ static void flat_8R8G8B24_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -588,7 +573,6 @@ static void flat_TRUEDITHER_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -625,7 +609,6 @@ static void flat_5R6G5B_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -658,7 +641,6 @@ static void flat_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
{ \
GLint i, len = RIGHT-LEFT; \
GLint yy = FLIP(xmesa->xm_buffer, Y); \
- (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -694,7 +676,6 @@ static void flat_DITHER8_z_triangle( GLcontext *ctx,
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, yy)); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -727,7 +708,6 @@ static void flat_DITHER_z_triangle( GLcontext *ctx,
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(yy); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -763,7 +743,6 @@ static void flat_HPCR_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
@@ -800,7 +779,6 @@ static void flat_LOOKUP8_z_triangle( GLcontext *ctx,
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 114ddeb320..9e856d4153 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -1,4 +1,4 @@
-/* $Id: s_lines.c,v 1.12 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_lines.c,v 1.13 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -52,7 +52,6 @@
*/
-
/* Flat, color index line */
static void flat_ci_line( GLcontext *ctx,
const SWvertex *vert0,
@@ -82,6 +81,7 @@ static void flat_ci_z_line( GLcontext *ctx,
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
#include "s_linetemp.h"
@@ -121,6 +121,7 @@ static void flat_rgba_z_line( GLcontext *ctx,
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
#include "s_linetemp.h"
@@ -176,6 +177,7 @@ static void smooth_ci_z_line( GLcontext *ctx,
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define PLOT(X,Y) \
@@ -245,6 +247,7 @@ static void smooth_rgba_z_line( GLcontext *ctx,
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -294,6 +297,7 @@ static void general_smooth_ci_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define WIDE 1
#define STIPPLE 1
@@ -313,6 +317,7 @@ static void general_smooth_ci_line( GLcontext *ctx,
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define XMAJOR_PLOT(X,Y) \
pbx[count] = X; pbx[count+1] = X; \
@@ -336,6 +341,7 @@ static void general_smooth_ci_line( GLcontext *ctx,
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define WIDE 1
#define PLOT(X,Y) \
@@ -373,6 +379,7 @@ static void general_flat_ci_line( GLcontext *ctx,
/* stippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define STIPPLE 1
#define PLOT(X,Y) \
@@ -390,6 +397,7 @@ static void general_flat_ci_line( GLcontext *ctx,
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define XMAJOR_PLOT(X,Y) \
pbx[count] = X; pbx[count+1] = X; \
pby[count] = Y; pby[count+1] = Y+1; \
@@ -410,6 +418,7 @@ static void general_flat_ci_line( GLcontext *ctx,
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define PLOT(X,Y) \
pbx[count] = X; \
@@ -446,6 +455,7 @@ static void general_smooth_rgba_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define WIDE 1
@@ -469,6 +479,7 @@ static void general_smooth_rgba_line( GLcontext *ctx,
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define XMAJOR_PLOT(X,Y) \
@@ -507,6 +518,7 @@ static void general_smooth_rgba_line( GLcontext *ctx,
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define WIDE 1
@@ -542,6 +554,7 @@ static void general_flat_rgba_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define STIPPLE 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
@@ -553,6 +566,7 @@ static void general_flat_rgba_line( GLcontext *ctx,
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define XMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
PB_WRITE_PIXEL(PB, X, Y+1, Z, fog0);
#define YMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
@@ -563,6 +577,7 @@ static void general_flat_rgba_line( GLcontext *ctx,
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
#include "s_linetemp.h"
@@ -595,6 +610,7 @@ static void flat_textured_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_TEX 1
#define WIDE 1
#define STIPPLE 1
@@ -616,6 +632,7 @@ static void flat_textured_line( GLcontext *ctx,
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_TEX 1
#define WIDE 1
#define PLOT(X,Y) \
@@ -661,6 +678,7 @@ static void smooth_textured_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define INTERP_TEX 1
@@ -688,6 +706,7 @@ static void smooth_textured_line( GLcontext *ctx,
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define INTERP_TEX 1
@@ -738,6 +757,7 @@ static void smooth_multitextured_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
@@ -775,6 +795,7 @@ static void smooth_multitextured_line( GLcontext *ctx,
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
@@ -839,6 +860,7 @@ static void flat_multitextured_line( GLcontext *ctx,
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_ALPHA 1
#define INTERP_MULTITEX 1
#define WIDE 1
@@ -874,6 +896,7 @@ static void flat_multitextured_line( GLcontext *ctx,
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_ALPHA 1
#define INTERP_MULTITEX 1
#define WIDE 1
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index e451f44855..dd7d33f8cd 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_linetemp.h,v 1.5 2001/02/07 18:36:52 brianp Exp $ */
+/* $Id: s_linetemp.h,v 1.6 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -32,7 +32,8 @@
*
* The following macros may be defined to indicate what auxillary information
* must be interplated along the line:
- * INTERP_Z - if defined, interpolate Z and FOG values
+ * INTERP_Z - if defined, interpolate Z values
+ * INTERP_FOG - if defined, interpolate FOG values
* INTERP_RGB - if defined, interpolate RGB values
* INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_ALPHA - if defined, interpolate Alpha values
@@ -92,6 +93,8 @@
GLint zPtrXstep, zPtrYstep;
DEPTH_TYPE *zPtr;
# endif
+#endif
+#ifdef INTERP_FOG
GLfixed fog0 = FloatToFixed(vert0->fog);
GLfixed dfog = FloatToFixed(vert1->fog) - fog0;
#endif
@@ -293,6 +296,8 @@
GLint errorDec = error-dx;
#ifdef INTERP_Z
dz = (z1-z0) / dx;
+#endif
+#ifdef INTERP_FOG
dfog /= dx;
#endif
#ifdef INTERP_RGB
@@ -398,6 +403,8 @@
zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrXstep);
# endif
z0 += dz;
+#endif
+#ifdef INTERP_FOG
fog0 += dfog;
#endif
#ifdef INTERP_RGB
@@ -464,6 +471,8 @@
GLint errorDec = error-dy;
#ifdef INTERP_Z
dz = (z1-z0) / dy;
+#endif
+#ifdef INTERP_FOG
dfog /= dy;
#endif
#ifdef INTERP_RGB
@@ -569,6 +578,8 @@
zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrYstep);
# endif
z0 += dz;
+#endif
+#ifdef INTERP_FOG
fog0 += dfog;
#endif
#ifdef INTERP_RGB
@@ -632,6 +643,7 @@
#undef INTERP_XY
#undef INTERP_Z
+#undef INTERP_FOG
#undef INTERP_RGB
#undef INTERP_SPEC
#undef INTERP_ALPHA
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 58609b0f40..fbacc7ddd4 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.16 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: s_triangle.c,v 1.17 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -66,6 +66,7 @@ GLboolean _mesa_cull_triangle( GLcontext *ctx,
}
+
/*
* Render a flat-shaded color index triangle.
*/
@@ -75,6 +76,7 @@ static void flat_ci_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -108,6 +110,7 @@ static void smooth_ci_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -145,6 +148,7 @@ static void flat_rgba_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INNER_LOOP( LEFT, RIGHT, Y ) \
@@ -184,6 +188,7 @@ static void smooth_rgba_triangle( GLcontext *ctx,
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -293,6 +298,7 @@ static void simple_z_textured_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_INT_TEX 1
#define S_SCALE twidth
@@ -360,6 +366,7 @@ static void affine_textured_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -689,6 +696,7 @@ static void near_persp_textured_triangle(GLcontext *ctx,
#define BIAS 4096.0F
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -1420,6 +1428,7 @@ static void lin_persp_textured_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -1595,6 +1604,7 @@ static void general_textured_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -1689,6 +1699,7 @@ static void general_textured_spec_triangle1( GLcontext *ctx,
GLchan spec[MAX_WIDTH][4] )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_SPEC 1
@@ -1793,6 +1804,7 @@ static void lambda_textured_triangle1( GLcontext *ctx,
GLfloat u[MAX_WIDTH] )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -1896,6 +1908,7 @@ static void lambda_textured_spec_triangle1( GLcontext *ctx,
GLfloat u[MAX_WIDTH] )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_SPEC 1
@@ -2012,6 +2025,7 @@ lambda_multitextured_triangle1( GLcontext *ctx,
GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH])
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -2185,6 +2199,7 @@ static void occlusion_zless_triangle( GLcontext *ctx,
#define DO_OCCLUSION_TEST
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 254f0fd2d2..a854b995b8 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_tritemp.h,v 1.12 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.13 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -33,9 +33,10 @@
* The following macros may be defined to indicate what auxillary information
* must be interplated across the triangle:
* INTERP_Z - if defined, interpolate Z values
+ * INTERP_FOG - if defined, interpolate fog values
* INTERP_RGB - if defined, interpolate RGB values
- * INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_ALPHA - if defined, interpolate Alpha values
+ * INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_INDEX - if defined, interpolate color index values
* INTERP_INT_TEX - if defined, interpolate integer ST texcoords
* (fast, simple 2-D texture mapping)
@@ -253,6 +254,8 @@
GLint ltor; /* true if scanning left-to-right */
#ifdef INTERP_Z
GLfloat dzdx, dzdy; GLfixed fdzdx;
+#endif
+#ifdef INTERP_FOG
GLfloat dfogdx, dfogdy; GLfixed fdfogdx;
#endif
#ifdef INTERP_RGB
@@ -332,6 +335,8 @@
else
fdzdx = (GLint) dzdx;
}
+#endif
+#ifdef INTERP_FOG
{
GLfloat eMaj_dfog, eBot_dfog;
eMaj_dfog = (vMax->fog - vMin->fog) * 256;
@@ -579,6 +584,8 @@
int dZRowOuter, dZRowInner; /* offset in bytes */
# endif
GLfixed fz, fdzOuter, fdzInner;
+#endif
+#ifdef INTERP_FOG
GLfixed ffog, fdfogOuter, fdfogInner;
#endif
#ifdef INTERP_RGB
@@ -724,10 +731,11 @@
dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(DEPTH_TYPE);
# endif
}
- {
- ffog = FloatToFixed(vLower->fog * 256 + dfogdx * adjx + dfogdy * adjy) + FIXED_HALF;
- fdfogOuter = SignedFloatToFixed(dfogdy + dxOuter * dfogdx);
- }
+#endif
+#ifdef INTERP_FOG
+ ffog = FloatToFixed(vLower->fog * 256 + dfogdx * adjx
+ + dfogdy * adjy) + FIXED_HALF;
+ fdfogOuter = SignedFloatToFixed(dfogdy + dxOuter * dfogdx);
#endif
#ifdef INTERP_RGB
fr = (GLfixed)(IntToFixed(vLower->color[0])
@@ -841,6 +849,8 @@
dZRowInner = dZRowOuter + sizeof(DEPTH_TYPE);
# endif
fdzInner = fdzOuter + fdzdx;
+#endif
+#ifdef INTERP_FOG
fdfogInner = fdfogOuter + fdfogdx;
#endif
#ifdef INTERP_RGB
@@ -890,6 +900,8 @@
GLint right = FixedToInt(fxRightEdge);
#ifdef INTERP_Z
GLfixed ffz = fz;
+#endif
+#ifdef INTERP_FOG
GLfixed fffog = ffog;
#endif
#ifdef INTERP_RGB
@@ -1050,6 +1062,8 @@
zRow = (DEPTH_TYPE *) ((GLubyte*)zRow + dZRowOuter);
# endif
fz += fdzOuter;
+#endif
+#ifdef INTERP_FOG
ffog += fdfogOuter;
#endif
#ifdef INTERP_RGB
@@ -1096,6 +1110,8 @@
zRow = (DEPTH_TYPE *) ((GLubyte*)zRow + dZRowInner);
# endif
fz += fdzInner;
+#endif
+#ifdef INTERP_FOG
ffog += fdfogInner;
#endif
#ifdef INTERP_RGB
@@ -1149,6 +1165,7 @@
#undef PIXEL_ADDRESS
#undef INTERP_Z
+#undef INTERP_FOG
#undef INTERP_RGB
#undef INTERP_SPEC
#undef INTERP_ALPHA