From 96385fa15569e25cd0977e678c0ff3bdab6ef316 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 14 Jul 2001 17:53:04 +0000 Subject: more work on float colors (still not finished) --- src/mesa/swrast/s_texture.c | 164 +++++++++++++++++++++------------------- src/mesa/swrast/s_triangle.c | 71 ++++++++++-------- src/mesa/swrast/s_trispan.h | 12 ++- src/mesa/swrast/s_tritemp.h | 175 +++++++++++++++++++++++++++++++++---------- 4 files changed, 277 insertions(+), 145 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index f659eaa8184..fa450db3fdb 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.33 2001/07/13 20:07:37 brianp Exp $ */ +/* $Id: s_texture.c,v 1.34 2001/07/14 17:53:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -324,7 +324,7 @@ sample_1d_linear(GLcontext *ctx, { const GLfloat a = FRAC(u); -#if CHAN_BITS == 32 +#if CHAN_TYPE == GL_FLOAT const GLfloat w0 = (1.0F-a); const GLfloat w1 = a ; #else /* CHAN_BITS == 8 || CHAN_BITS == 16 */ @@ -354,7 +354,7 @@ sample_1d_linear(GLcontext *ctx, } } -#if CHAN_BITS == 32 +#if CHAN_TYPE == GL_FLOAT rgba[0] = w0 * t0[0] + w1 * t1[0]; rgba[1] = w0 * t0[1] + w1 * t1[1]; rgba[2] = w0 * t0[2] + w1 * t1[2]; @@ -395,6 +395,16 @@ sample_1d_linear_mipmap_nearest(GLcontext *ctx, +/* + * This is really just needed in order to prevent warnings with some compilers. + */ +#if CHAN_TYPE == GL_FLOAT +#define INTCAST +#else +#define INTCAST (GLint) +#endif + + static void sample_1d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, @@ -413,10 +423,10 @@ sample_1d_nearest_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_1d_nearest(ctx, tObj, tObj->Image[level ], s, t0); sample_1d_nearest(ctx, tObj, tObj->Image[level+1], s, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -440,10 +450,10 @@ sample_1d_linear_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_1d_linear(ctx, tObj, tObj->Image[level ], s, t0); sample_1d_linear(ctx, tObj, tObj->Image[level+1], s, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -637,7 +647,7 @@ sample_2d_linear(GLcontext *ctx, const GLfloat a = FRAC(u); const GLfloat b = FRAC(v); -#if CHAN_BITS == 32 +#if CHAN_TYPE == GL_FLOAT const GLfloat w00 = (1.0F-a) * (1.0F-b); const GLfloat w10 = a * (1.0F-b); const GLfloat w01 = (1.0F-a) * b ; @@ -691,7 +701,7 @@ sample_2d_linear(GLcontext *ctx, palette_sample(ctx, tObj, t11[0], t11); } } -#if CHAN_BITS == 32 +#if CHAN_TYPE == GL_FLOAT rgba[0] = w00 * t00[0] + w10 * t10[0] + w01 * t01[0] + w11 * t11[0]; rgba[1] = w00 * t00[1] + w10 * t10[1] + w01 * t01[1] + w11 * t11[1]; rgba[2] = w00 * t00[2] + w10 * t10[2] + w01 * t01[2] + w11 * t11[2]; @@ -753,10 +763,10 @@ sample_2d_nearest_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_2d_nearest(ctx, tObj, tObj->Image[level ], s, t, t0); sample_2d_nearest(ctx, tObj, tObj->Image[level+1], s, t, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -780,10 +790,10 @@ sample_2d_linear_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_2d_linear(ctx, tObj, tObj->Image[level ], s, t, t0); sample_2d_linear(ctx, tObj, tObj->Image[level+1], s, t, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -1082,7 +1092,7 @@ sample_3d_linear(GLcontext *ctx, const GLfloat b = FRAC(v); const GLfloat c = FRAC(w); -#if CHAN_BITS == 32 +#if CHAN_TYPE == GL_FLOAT /* compute sample weights in fixed point in [0,WEIGHT_SCALE] */ GLfloat w000 = (1.0F-a) * (1.0F-b) * (1.0F-c); GLfloat w100 = a * (1.0F-b) * (1.0F-c); @@ -1181,7 +1191,7 @@ sample_3d_linear(GLcontext *ctx, } } -#if CHAN_BITS == 32 +#if CHAN_TYPE == GL_FLOAT rgba[0] = w000*t000[0] + w010*t010[0] + w001*t001[0] + w011*t011[0] + w100*t100[0] + w110*t110[0] + w101*t101[0] + w111*t111[0]; rgba[1] = w000*t000[1] + w010*t010[1] + w001*t001[1] + w011*t011[1] + @@ -1257,10 +1267,10 @@ sample_3d_nearest_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_3d_nearest(ctx, tObj, tObj->Image[level ], s, t, r, t0); sample_3d_nearest(ctx, tObj, tObj->Image[level+1], s, t, r, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -1283,10 +1293,10 @@ sample_3d_linear_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_3d_linear(ctx, tObj, tObj->Image[level ], s, t, r, t0); sample_3d_linear(ctx, tObj, tObj->Image[level+1], s, t, r, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -1562,10 +1572,10 @@ sample_cube_nearest_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_2d_nearest(ctx, tObj, images[level ], newS, newT, t0); sample_2d_nearest(ctx, tObj, images[level+1], newS, newT, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -1592,10 +1602,10 @@ sample_cube_linear_mipmap_linear(GLcontext *ctx, const GLfloat f = FRAC(lambda); sample_2d_linear(ctx, tObj, images[level ], newS, newT, t0); sample_2d_linear(ctx, tObj, images[level+1], newS, newT, t1); - rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); - rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); - rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); - rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); + rgba[RCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); + rgba[GCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); + rgba[BCOMP] = (GLchan) INTCAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); + rgba[ACOMP] = (GLchan) INTCAST ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); } } @@ -1676,6 +1686,7 @@ sample_lambda_cube( GLcontext *ctx, GLuint texUnit, } } + static void null_sample_func( GLcontext *ctx, GLuint texUnit, const struct gl_texture_object *tObj, GLuint n, @@ -1685,6 +1696,8 @@ null_sample_func( GLcontext *ctx, GLuint texUnit, { } + + /**********************************************************************/ /* Texture Sampling Setup */ /**********************************************************************/ @@ -1936,17 +1949,17 @@ texture_combine(const GLcontext *ctx, if (RGBshift) { for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan r = arg0[i][RCOMP] * RGBmult; - GLchan g = arg0[i][GCOMP] * RGBmult; - GLchan b = arg0[i][BCOMP] * RGBmult; + rgba[i][RCOMP] = arg0[i][RCOMP] * RGBmult; + rgba[i][GCOMP] = arg0[i][GCOMP] * RGBmult; + rgba[i][BCOMP] = arg0[i][BCOMP] * RGBmult; #else GLuint r = (GLuint) arg0[i][RCOMP] << RGBshift; GLuint g = (GLuint) arg0[i][GCOMP] << RGBshift; GLuint b = (GLuint) arg0[i][BCOMP] << RGBshift; -#endif rgba[i][RCOMP] = MIN2(r, CHAN_MAX); rgba[i][GCOMP] = MIN2(g, CHAN_MAX); rgba[i][BCOMP] = MIN2(b, CHAN_MAX); +#endif } } else { @@ -1967,17 +1980,17 @@ texture_combine(const GLcontext *ctx, #endif for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan r = arg0[i][RCOMP] * arg1[i][RCOMP] * RGBmult; - GLuint g = arg0[i][GCOMP] * arg1[i][GCOMP] * RGBmult; - GLuint b = arg0[i][BCOMP] * arg1[i][BCOMP] * RGBmult; + rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * RGBmult; + rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * RGBmult; + rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * RGBmult; #else GLuint r = PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift; GLuint g = PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift; GLuint b = PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift; -#endif rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); +#endif } } break; @@ -1987,17 +2000,17 @@ texture_combine(const GLcontext *ctx, const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan r = (arg0[i][RCOMP] + arg1[i][RCOMP]) * RGBmult; - GLchan g = (arg0[i][GCOMP] + arg1[i][GCOMP]) * RGBmult; - GLchan b = (arg0[i][BCOMP] + arg1[i][BCOMP]) * RGBmult; + rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * RGBmult; #else GLint r = ((GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP]) << RGBshift; GLint g = ((GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP]) << RGBshift; GLint b = ((GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP]) << RGBshift; -#endif rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); +#endif } } break; @@ -2007,9 +2020,9 @@ texture_combine(const GLcontext *ctx, const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan r = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * RGBmult; - GLchan g = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult; - GLchan b = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult; + rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * RGBmult; + rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult; + rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult; #else GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] -half; GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] -half; @@ -2017,10 +2030,10 @@ texture_combine(const GLcontext *ctx, r = (r < 0) ? 0 : r << RGBshift; g = (g < 0) ? 0 : g << RGBshift; b = (b < 0) ? 0 : b << RGBshift; -#endif rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); +#endif } } break; @@ -2034,11 +2047,11 @@ texture_combine(const GLcontext *ctx, #endif for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan r = (arg0[i][RCOMP] * arg2[i][RCOMP] + + rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] + arg1[i][RCOMP] * (CHAN_MAXF - arg2[i][RCOMP])) * RGBmult; - GLchan g = (arg0[i][GCOMP] * arg2[i][GCOMP] + + rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] + arg1[i][GCOMP] * (CHAN_MAXF - arg2[i][GCOMP])) * RGBmult; - GLchan b = (arg0[i][BCOMP] * arg2[i][BCOMP] + + rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] + arg1[i][BCOMP] * (CHAN_MAXF - arg2[i][BCOMP])) * RGBmult; #else GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) @@ -2050,10 +2063,10 @@ texture_combine(const GLcontext *ctx, GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) + PROD(arg1[i][BCOMP], CHAN_MAX - arg2[i][BCOMP])) >> shift; -#endif rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); +#endif } } break; @@ -2063,17 +2076,17 @@ texture_combine(const GLcontext *ctx, const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan r = (arg0[i][RCOMP] - arg1[i][RCOMP]) * RGBmult; - GLchan g = (arg0[i][GCOMP] - arg1[i][GCOMP]) * RGBmult; - GLchan b = (arg0[i][BCOMP] - arg1[i][BCOMP]) * RGBmult; + rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * RGBmult; #else GLint r = ((GLint) arg0[i][RCOMP] - (GLint) arg1[i][RCOMP]) << RGBshift; GLint g = ((GLint) arg0[i][GCOMP] - (GLint) arg1[i][GCOMP]) << RGBshift; GLint b = ((GLint) arg0[i][BCOMP] - (GLint) arg1[i][BCOMP]) << RGBshift; -#endif rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); +#endif } } break; @@ -2141,11 +2154,11 @@ texture_combine(const GLcontext *ctx, #endif for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan a = arg0[i][ACOMP] * arg1[i][ACOMP] * Amult; + rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * Amult; #else GLuint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift); -#endif rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); +#endif } } break; @@ -2155,8 +2168,7 @@ texture_combine(const GLcontext *ctx, const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan a = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAXF); + rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult; #else GLint a = ((GLint) arg0[i][ACOMP] + arg1[i][ACOMP]) << Ashift; rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); @@ -2170,12 +2182,12 @@ texture_combine(const GLcontext *ctx, const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan a = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * Amult; + rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * Amult; #else GLint a = (GLint) arg0[i][ACOMP] + (GLint) arg1[i][ACOMP] -half; a = (a < 0) ? 0 : a << Ashift; -#endif rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); +#endif } } break; @@ -2189,15 +2201,15 @@ texture_combine(const GLcontext *ctx, #endif for (i=0; i> shift; -#endif rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); +#endif } } break; @@ -2207,11 +2219,11 @@ texture_combine(const GLcontext *ctx, const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { #if CHAN_TYPE == GL_FLOAT - GLchan a = (arg0[i][ACOMP] - arg1[i][ACOMP]) * Amult; + rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * Amult; #else GLint a = ((GLint) arg0[i][ACOMP] - (GLint) arg1[i][ACOMP]) << RGBshift; -#endif rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); +#endif } } break; @@ -2503,6 +2515,8 @@ apply_texture( const GLcontext *ctx, } break; + /* XXX don't clamp results if GLchan is float??? */ + case GL_ADD: /* GL_EXT_texture_add_env */ switch (format) { case GL_ALPHA: diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 231801fbc23..98e09d47372 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.33 2001/07/13 20:07:37 brianp Exp $ */ +/* $Id: s_triangle.c,v 1.34 2001/07/14 17:53:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -186,10 +186,10 @@ static void smooth_rgba_triangle( GLcontext *ctx, GLfloat fogSpan[MAX_WIDTH]; \ GLuint i; \ for (i = 0; i < span.count; i++) { \ - rgbaSpan[i][RCOMP] = FixedToInt(span.red); \ - rgbaSpan[i][GCOMP] = FixedToInt(span.green); \ - rgbaSpan[i][BCOMP] = FixedToInt(span.blue); \ - rgbaSpan[i][ACOMP] = FixedToInt(span.alpha); \ + rgbaSpan[i][RCOMP] = FixedToChan(span.red); \ + rgbaSpan[i][GCOMP] = FixedToChan(span.green); \ + rgbaSpan[i][BCOMP] = FixedToChan(span.blue); \ + rgbaSpan[i][ACOMP] = FixedToChan(span.alpha); \ span.red += span.redStep; \ span.green += span.greenStep; \ span.blue += span.blueStep; \ @@ -683,7 +683,6 @@ static void affine_textured_triangle( GLcontext *ctx, } -#endif /* CHAN_BITS != GL_FLOAT */ struct persp_info @@ -984,6 +983,8 @@ static void persp_textured_triangle( GLcontext *ctx, } +#endif /* CHAN_BITS != GL_FLOAT */ + /* * Generate arrays of fragment colors, z, fog, texcoords, etc from a @@ -1023,16 +1024,23 @@ rasterize_span(GLcontext *ctx, const struct triangle_span *span) CHECKARRAY(mLambda, return); if (span->activeMask & SPAN_RGBA) { +#if CHAN_TYPE == GL_FLOAT + GLfloat r = span->red; + GLfloat g = span->green; + GLfloat b = span->blue; + GLfloat a = span->alpha; +#else GLfixed r = span->red; GLfixed g = span->green; GLfixed b = span->blue; GLfixed a = span->alpha; +#endif GLuint i; for (i = 0; i < span->count; i++) { - rgba[i][RCOMP] = FixedToInt(r); - rgba[i][GCOMP] = FixedToInt(g); - rgba[i][BCOMP] = FixedToInt(b); - rgba[i][ACOMP] = FixedToInt(a); + rgba[i][RCOMP] = FixedToChan(r); + rgba[i][GCOMP] = FixedToChan(g); + rgba[i][BCOMP] = FixedToChan(b); + rgba[i][ACOMP] = FixedToChan(a); r += span->redStep; g += span->greenStep; b += span->blueStep; @@ -1040,14 +1048,20 @@ rasterize_span(GLcontext *ctx, const struct triangle_span *span) } } if (span->activeMask & SPAN_SPEC) { +#if CHAN_TYPE == GL_FLOAT + GLfloat r = span->specRed; + GLfloat g = span->specGreen; + GLfloat b = span->specBlue; +#else GLfixed r = span->specRed; GLfixed g = span->specGreen; GLfixed b = span->specBlue; +#endif GLuint i; for (i = 0; i < span->count; i++) { - spec[i][RCOMP] = FixedToInt(r); - spec[i][GCOMP] = FixedToInt(g); - spec[i][BCOMP] = FixedToInt(b); + spec[i][RCOMP] = FixedToChan(r); + spec[i][GCOMP] = FixedToChan(g); + spec[i][BCOMP] = FixedToChan(b); r += span->specRedStep; g += span->specGreenStep; b += span->specBlueStep; @@ -1315,10 +1329,10 @@ static void general_textured_triangle( GLcontext *ctx, span.z += span.zStep; \ fogSpan[i] = span.fog; \ span.fog += span.fogStep; \ - rgbaSpan[i][RCOMP] = FixedToInt(span.red); \ - rgbaSpan[i][GCOMP] = FixedToInt(span.green); \ - rgbaSpan[i][BCOMP] = FixedToInt(span.blue); \ - rgbaSpan[i][ACOMP] = FixedToInt(span.alpha); \ + rgbaSpan[i][RCOMP] = FixedToChan(span.red); \ + rgbaSpan[i][GCOMP] = FixedToChan(span.green); \ + rgbaSpan[i][BCOMP] = FixedToChan(span.blue); \ + rgbaSpan[i][ACOMP] = FixedToChan(span.alpha); \ span.red += span.redStep; \ span.green += span.greenStep; \ span.blue += span.blueStep; \ @@ -1736,24 +1750,19 @@ _swrast_choose_triangle( GLcontext *ctx ) } } else { -#if CHAN_TYPE != GL_FLOAT - if (ctx->Texture.Unit[0].EnvMode != GL_ADD) { - USE(affine_textured_triangle); - } - else +#if CHAN_TYPE == GL_FLOAT + USE(general_textured_triangle); +#else + USE(affine_textured_triangle); #endif - { - USE(general_textured_triangle); - } } } else { - if (ctx->Texture.Unit[0].EnvMode==GL_ADD) { - USE(general_textured_triangle); - } - else { - USE(persp_textured_triangle); - } +#if CHAN_TYPE == GL_FLOAT + USE(general_textured_triangle); +#else + USE(persp_textured_triangle); +#endif } } else { diff --git a/src/mesa/swrast/s_trispan.h b/src/mesa/swrast/s_trispan.h index cd577f51ca6..2ac3c4d17a8 100644 --- a/src/mesa/swrast/s_trispan.h +++ b/src/mesa/swrast/s_trispan.h @@ -1,4 +1,4 @@ -/* $Id: s_trispan.h,v 1.1 2001/05/14 16:23:04 brianp Exp $ */ +/* $Id: s_trispan.h,v 1.2 2001/07/14 17:53:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -58,6 +58,15 @@ struct triangle_span { GLint x, y; GLuint count; GLuint activeMask; /* OR of the SPAN_* flags */ +#if CHAN_TYPE == GL_FLOAT + GLfloat red, redStep; + GLfloat green, greenStep; + GLfloat blue, blueStep; + GLfloat alpha, alphaStep; + GLfloat specRed, specRedStep; + GLfloat specGreen, specGreenStep; + GLfloat specBlue, specBlueStep; +#else GLfixed red, redStep; GLfixed green, greenStep; GLfixed blue, blueStep; @@ -65,6 +74,7 @@ struct triangle_span { GLfixed specRed, specRedStep; GLfixed specGreen, specGreenStep; GLfixed specBlue, specBlueStep; +#endif GLfixed index, indexStep; GLfixed z, zStep; GLfloat fog, fogStep; diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 57c3c26c5b6..0c0c5956eab 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.21 2001/07/14 16:05:44 brianp Exp $ */ +/* $Id: s_tritemp.h,v 1.22 2001/07/14 17:53:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -45,6 +45,8 @@ * INTERP_MULTITEX - if defined, interpolate N units of STRQ texcoords * INTERP_LAMBDA - if defined, compute lambda value (for mipmapping) * a lambda value for every texture unit + * INTERP_FLOAT_RGBA - if defined, interpolate RGBA with floating point + * INTERP_FLOAT_SPEC - if defined, interpolate specular with floating point * * When one can directly address pixels in the color buffer the following * macros can be defined and used to compute pixel addresses during @@ -70,6 +72,27 @@ * Inspired by triangle rasterizer code written by Allen Akin. Thanks Allen! */ + +/* + * This is a bit of a hack, but it's a centralized place to enable floating- + * point color interpolation when GLchan is actually floating point. + */ +#if CHAN_TYPE == GL_FLOAT + +#if defined(INTERP_RGB) +#undef INTERP_RGB +#undef INTERP_ALPHA +#define INTERP_FLOAT_RGBA +#endif + +#if defined(INTERP_SPEC) +#undef INTERP_SPEC +#define INTERP_FLOAT_SPEC +#endif + +#endif + + /*void triangle( GLcontext *ctx, SWvertex *v0, SWvertex *v1, SWvertex *v2 )*/ { typedef struct { @@ -264,15 +287,15 @@ #ifdef INTERP_FOG GLfloat dfogdy; #endif -#ifdef INTERP_RGB +#if defined(INTERP_RGB) || defined(INTERP_FLOAT_RGBA) GLfloat drdx, drdy; GLfloat dgdx, dgdy; GLfloat dbdx, dbdy; #endif -#ifdef INTERP_ALPHA +#if defined(INTERP_ALPHA) || defined(INTERP_FLOAT_RGBA) GLfloat dadx, dady; #endif -#ifdef INTERP_SPEC +#if defined(INTERP_SPEC) || defined(INTERP_FLOAT_SPEC) GLfloat dsrdx, dsrdy; GLfloat dsgdx, dsgdy; GLfloat dsbdx, dsbdy; @@ -376,33 +399,82 @@ dady = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); } #endif +#ifdef INTERP_FLOAT_RGBA + span.activeMask |= SPAN_RGBA; + { + GLfloat eMaj_dr, eBot_dr; + GLfloat eMaj_dg, eBot_dg; + GLfloat eMaj_db, eBot_db; + GLfloat eMaj_da, eBot_da; + eMaj_dr = (GLint) vMax->color[0] - (GLint) vMin->color[0]; + eBot_dr = (GLint) vMid->color[0] - (GLint) vMin->color[0]; + drdx = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr); + span.redStep = drdx; + drdy = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx); + eMaj_dg = (GLint) vMax->color[1] - (GLint) vMin->color[1]; + eBot_dg = (GLint) vMid->color[1] - (GLint) vMin->color[1]; + dgdx = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg); + span.greenStep = dgdx; + dgdy = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx); + eMaj_db = (GLint) vMax->color[2] - (GLint) vMin->color[2]; + eBot_db = (GLint) vMid->color[2] - (GLint) vMin->color[2]; + dbdx = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db); + span.blueStep = dbdx; + dbdy = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx); + eMaj_da = (GLint) vMax->color[3] - (GLint) vMin->color[3]; + eBot_da = (GLint) vMid->color[3] - (GLint) vMin->color[3]; + dadx = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); + span.alphaStep = dadx; + dady = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); + } +#endif #ifdef INTERP_SPEC span.activeMask |= SPAN_SPEC; { GLfloat eMaj_dsr, eBot_dsr; + GLfloat eMaj_dsg, eBot_dsg; + GLfloat eMaj_dsb, eBot_dsb; eMaj_dsr = (GLint) vMax->specular[0] - (GLint) vMin->specular[0]; eBot_dsr = (GLint) vMid->specular[0] - (GLint) vMin->specular[0]; dsrdx = oneOverArea * (eMaj_dsr * eBot.dy - eMaj.dy * eBot_dsr); span.specRedStep = SignedFloatToFixed(dsrdx); dsrdy = oneOverArea * (eMaj.dx * eBot_dsr - eMaj_dsr * eBot.dx); - } - { - GLfloat eMaj_dsg, eBot_dsg; eMaj_dsg = (GLint) vMax->specular[1] - (GLint) vMin->specular[1]; eBot_dsg = (GLint) vMid->specular[1] - (GLint) vMin->specular[1]; dsgdx = oneOverArea * (eMaj_dsg * eBot.dy - eMaj.dy * eBot_dsg); span.specGreenStep = SignedFloatToFixed(dsgdx); dsgdy = oneOverArea * (eMaj.dx * eBot_dsg - eMaj_dsg * eBot.dx); + eMaj_dsb = (GLint) vMax->specular[2] - (GLint) vMin->specular[2]; + eBot_dsb = (GLint) vMid->specular[2] - (GLint) vMin->specular[2]; + dsbdx = oneOverArea * (eMaj_dsb * eBot.dy - eMaj.dy * eBot_dsb); + span.specBlueStep = SignedFloatToFixed(dsbdx); + dsbdy = oneOverArea * (eMaj.dx * eBot_dsb - eMaj_dsb * eBot.dx); } +#endif +#ifdef INTERP_FLOAT_SPEC + span.activeMask |= SPAN_SPEC; { + GLfloat eMaj_dsr, eBot_dsr; + GLfloat eMaj_dsg, eBot_dsg; GLfloat eMaj_dsb, eBot_dsb; + eMaj_dsr = (GLint) vMax->specular[0] - (GLint) vMin->specular[0]; + eBot_dsr = (GLint) vMid->specular[0] - (GLint) vMin->specular[0]; + dsrdx = oneOverArea * (eMaj_dsr * eBot.dy - eMaj.dy * eBot_dsr); + span.specRedStep = dsrdx; + dsrdy = oneOverArea * (eMaj.dx * eBot_dsr - eMaj_dsr * eBot.dx); + eMaj_dsg = (GLint) vMax->specular[1] - (GLint) vMin->specular[1]; + eBot_dsg = (GLint) vMid->specular[1] - (GLint) vMin->specular[1]; + dsgdx = oneOverArea * (eMaj_dsg * eBot.dy - eMaj.dy * eBot_dsg); + span.specGreenStep = dsgdx; + dsgdy = oneOverArea * (eMaj.dx * eBot_dsg - eMaj_dsg * eBot.dx); eMaj_dsb = (GLint) vMax->specular[2] - (GLint) vMin->specular[2]; eBot_dsb = (GLint) vMid->specular[2] - (GLint) vMin->specular[2]; dsbdx = oneOverArea * (eMaj_dsb * eBot.dy - eMaj.dy * eBot_dsb); - span.specBlueStep = SignedFloatToFixed(dsbdx); + span.specBlueStep = dsbdx; dsbdy = oneOverArea * (eMaj.dx * eBot_dsb - eMaj_dsb * eBot.dx); } #endif + #ifdef INTERP_INDEX span.activeMask |= SPAN_INDEX; { @@ -626,11 +698,22 @@ #ifdef INTERP_ALPHA GLfixed fa=0, fdaOuter=0, fdaInner; #endif +#ifdef INTERP_FLOAT_RGBA + GLfloat fr, fdrOuter, fdrInner; + GLfloat fg, fdgOuter, fdgInner; + GLfloat fb, fdbOuter, fdbInner; + GLfloat fa, fdaOuter, fdaInner; +#endif #ifdef INTERP_SPEC GLfixed fsr=0, fdsrOuter=0, fdsrInner; GLfixed fsg=0, fdsgOuter=0, fdsgInner; GLfixed fsb=0, fdsbOuter=0, fdsbInner; #endif +#ifdef INTERP_FLOAT_SPEC + GLfloat fsr=0, fdsrOuter=0, fdsrInner; + GLfloat fsg=0, fdsgOuter=0, fdsgInner; + GLfloat fsb=0, fdsbOuter=0, fdsbInner; +#endif #ifdef INTERP_INDEX GLfixed fi=0, fdiOuter=0, fdiInner; #endif @@ -770,36 +853,50 @@ dfogOuter = dfogdy + dxOuter * span.fogStep; #endif #ifdef INTERP_RGB - fr = (GLfixed)(ChanToFixed(vLower->color[0]) - + drdx * adjx + drdy * adjy) + FIXED_HALF; + fr = (GLfixed) (ChanToFixed(vLower->color[0]) + + drdx * adjx + drdy * adjy) + FIXED_HALF; fdrOuter = SignedFloatToFixed(drdy + dxOuter * drdx); - - fg = (GLfixed)(ChanToFixed(vLower->color[1]) - + dgdx * adjx + dgdy * adjy) + FIXED_HALF; + fg = (GLfixed) (ChanToFixed(vLower->color[1]) + + dgdx * adjx + dgdy * adjy) + FIXED_HALF; fdgOuter = SignedFloatToFixed(dgdy + dxOuter * dgdx); - - fb = (GLfixed)(ChanToFixed(vLower->color[2]) - + dbdx * adjx + dbdy * adjy) + FIXED_HALF; + fb = (GLfixed) (ChanToFixed(vLower->color[2]) + + dbdx * adjx + dbdy * adjy) + FIXED_HALF; fdbOuter = SignedFloatToFixed(dbdy + dxOuter * dbdx); #endif #ifdef INTERP_ALPHA - fa = (GLfixed)(ChanToFixed(vLower->color[3]) - + dadx * adjx + dady * adjy) + FIXED_HALF; + fa = (GLfixed) (ChanToFixed(vLower->color[3]) + + dadx * adjx + dady * adjy) + FIXED_HALF; fdaOuter = SignedFloatToFixed(dady + dxOuter * dadx); #endif +#ifdef INTERP_FLOAT_RGBA + fr = vLower->color[0] + drdx * adjx + drdy * adjy; + fdrOuter = drdy + dxOuter * drdx; + fg = vLower->color[1] + dgdx * adjx + dgdy * adjy; + fdgOuter = dgdy + dxOuter * dgdx; + fb = vLower->color[2] + dbdx * adjx + dbdy * adjy; + fdbOuter = dbdy + dxOuter * dbdx; + fa = vLower->color[3] + dadx * adjx + dady * adjy; + fdaOuter = dady + dxOuter * dadx; +#endif #ifdef INTERP_SPEC - fsr = (GLfixed)(ChanToFixed(vLower->specular[0]) - + dsrdx * adjx + dsrdy * adjy) + FIXED_HALF; + fsr = (GLfixed) (ChanToFixed(vLower->specular[0]) + + dsrdx * adjx + dsrdy * adjy) + FIXED_HALF; fdsrOuter = SignedFloatToFixed(dsrdy + dxOuter * dsrdx); - - fsg = (GLfixed)(ChanToFixed(vLower->specular[1]) - + dsgdx * adjx + dsgdy * adjy) + FIXED_HALF; + fsg = (GLfixed) (ChanToFixed(vLower->specular[1]) + + dsgdx * adjx + dsgdy * adjy) + FIXED_HALF; fdsgOuter = SignedFloatToFixed(dsgdy + dxOuter * dsgdx); - - fsb = (GLfixed)(ChanToFixed(vLower->specular[2]) - + dsbdx * adjx + dsbdy * adjy) + FIXED_HALF; + fsb = (GLfixed) (ChanToFixed(vLower->specular[2]) + + dsbdx * adjx + dsbdy * adjy) + FIXED_HALF; fdsbOuter = SignedFloatToFixed(dsbdy + dxOuter * dsbdx); #endif +#ifdef INTERP_FLOAT_SPEC + fsr = vLower->specular[0] + dsrdx * adjx + dsrdy * adjy; + fdsrOuter = dsrdy + dxOuter * dsrdx; + fsg = vLower->specular[1] + dsgdx * adjx + dsgdy * adjy; + fdsgOuter = dsgdy + dxOuter * dsgdx; + fsb = vLower->specular[2] + dsbdx * adjx + dsbdy * adjy; + fdsbOuter = dsbdy + dxOuter * dsbdx; +#endif #ifdef INTERP_INDEX fi = (GLfixed)(vLower->index * FIXED_SCALE + didx * adjx + didy * adjy) + FIXED_HALF; @@ -895,15 +992,15 @@ #ifdef INTERP_FOG dfogInner = dfogOuter + span.fogStep; #endif -#ifdef INTERP_RGB +#if defined(INTERP_RGB) || defined(INTERP_FLOAT_RGBA) fdrInner = fdrOuter + span.redStep; fdgInner = fdgOuter + span.greenStep; fdbInner = fdbOuter + span.blueStep; #endif -#ifdef INTERP_ALPHA +#if defined(INTERP_ALPHA) || defined(INTERP_FLOAT_RGBA) fdaInner = fdaOuter + span.alphaStep; #endif -#ifdef INTERP_SPEC +#if defined(INTERP_SPEC) || defined(INTERP_FLOAT_SPEC) fdsrInner = fdsrOuter + span.specRedStep; fdsgInner = fdsgOuter + span.specGreenStep; fdsbInner = fdsbOuter + span.specBlueStep; @@ -951,15 +1048,15 @@ #ifdef INTERP_FOG span.fog = fogLeft; #endif -#ifdef INTERP_RGB +#if defined(INTERP_RGB) || defined(INTERP_FLOAT_RGBA) span.red = fr; span.green = fg; span.blue = fb; #endif -#ifdef INTERP_ALPHA +#if defined(INTERP_ALPHA) || defined(INTERP_FLOAT_RGBA) span.alpha = fa; #endif -#ifdef INTERP_SPEC +#if defined(INTERP_SPEC) || defined(INTERP_FLOAT_SPEC) span.specRed = fsr; span.specGreen = fsg; span.specBlue = fsb; @@ -1089,15 +1186,15 @@ #ifdef INTERP_FOG fogLeft += dfogOuter; #endif -#ifdef INTERP_RGB +#if defined(INTERP_RGB) || defined(INTERP_FLOAT_RGBA) fr += fdrOuter; fg += fdgOuter; fb += fdbOuter; #endif -#ifdef INTERP_ALPHA +#if defined(INTERP_ALPHA) || defined(INTERP_FLOAT_RGBA) fa += fdaOuter; #endif -#ifdef INTERP_SPEC +#if defined(INTERP_SPEC) || defined(INTERP_FLOAT_SPEC) fsr += fdsrOuter; fsg += fdsgOuter; fsb += fdsbOuter; @@ -1142,15 +1239,15 @@ #ifdef INTERP_FOG fogLeft += dfogInner; #endif -#ifdef INTERP_RGB +#if defined(INTERP_RGB) || defined(INTERP_FLOAT_RGBA) fr += fdrInner; fg += fdgInner; fb += fdbInner; #endif -#ifdef INTERP_ALPHA +#if defined(INTERP_ALPHA) || defined(INTERP_FLOAT_RGBA) fa += fdaInner; #endif -#ifdef INTERP_SPEC +#if defined(INTERP_SPEC) || defined(INTERP_FLOAT_SPEC) fsr += fdsrInner; fsg += fdsgInner; fsb += fdsbInner; @@ -1211,6 +1308,8 @@ #undef INTERP_TEX #undef INTERP_MULTITEX #undef INTERP_LAMBDA +#undef INTERP_FLOAT_RGBA +#undef INTERP_FLOAT_SPEC #undef S_SCALE #undef T_SCALE -- cgit v1.2.3