teensy bit of optimization in interp code
authorDaniel Borca <dborca@users.sourceforge.net>
Wed, 7 Jan 2004 12:50:30 +0000 (12:50 +0000)
committerDaniel Borca <dborca@users.sourceforge.net>
Wed, 7 Jan 2004 12:50:30 +0000 (12:50 +0000)
src/mesa/drivers/glide/fxvbtmp.h

index 4e1b10f1d033c16f1d86e1b05abc88247c131f6b..9e46f755957162fb23dac16bf075b5c803652e68 100644 (file)
@@ -214,8 +214,8 @@ static void TAG(interp)( GLcontext *ctx,
    GrVertex *dst = (GrVertex *) (fxverts + edst);
    const GrVertex *out = (const GrVertex *) (fxverts + eout);
    const GrVertex *in = (const GrVertex *) (fxverts + ein);
-   const GLfloat wout = 1.0F / out->oow;
-   const GLfloat win = 1.0F / in->oow;
+   const GLfloat wout = oow / out->oow;
+   const GLfloat win = oow / in->oow;
 
    VIEWPORT_X(dst->x,   dstclip[0] * oow);
    VIEWPORT_Y(dst->y,   dstclip[1] * oow);
@@ -248,68 +248,36 @@ static void TAG(interp)( GLcontext *ctx,
    }
 
    if (IND & SETUP_TMU0) {
+      INTERP_F( t, 
+               dst->tmuvtx[0].sow, 
+               out->tmuvtx[0].sow * wout, 
+               in->tmuvtx[0].sow * win );
+      INTERP_F( t,
+               dst->tmuvtx[0].tow,
+               out->tmuvtx[0].tow * wout, 
+               in->tmuvtx[0].tow * win );
       if (IND & SETUP_PTEX) {
-        INTERP_F( t, 
-                  dst->tmuvtx[0].sow, 
-                  out->tmuvtx[0].sow * wout, 
-                  in->tmuvtx[0].sow * win );
-        INTERP_F( t,
-                  dst->tmuvtx[0].tow,
-                  out->tmuvtx[0].tow * wout, 
-                  in->tmuvtx[0].tow * win );
         INTERP_F( t, 
                   dst->tmuvtx[0].oow, 
                   out->tmuvtx[0].oow * wout, 
                   in->tmuvtx[0].oow * win );
-
-        dst->tmuvtx[0].sow *= oow;
-        dst->tmuvtx[0].tow *= oow;
-        dst->tmuvtx[0].oow *= oow;
-      } else {
-        INTERP_F( t, 
-                  dst->tmuvtx[0].sow, 
-                  out->tmuvtx[0].sow * wout, 
-                  in->tmuvtx[0].sow * win );
-        INTERP_F( t,
-                  dst->tmuvtx[0].tow,
-                  out->tmuvtx[0].tow * wout, 
-                  in->tmuvtx[0].tow * win );
-
-        dst->tmuvtx[0].sow *= oow;
-        dst->tmuvtx[0].tow *= oow;
       }
    }
 
    if (IND & SETUP_TMU1) {
+      INTERP_F( t, 
+               dst->tmuvtx[1].sow, 
+               out->tmuvtx[1].sow * wout, 
+               in->tmuvtx[1].sow * win );
+      INTERP_F( t,
+               dst->tmuvtx[1].tow,
+               out->tmuvtx[1].tow * wout, 
+               in->tmuvtx[1].tow * win );
       if (IND & SETUP_PTEX) {
-        INTERP_F( t, 
-                  dst->tmuvtx[1].sow, 
-                  out->tmuvtx[1].sow * wout, 
-                  in->tmuvtx[1].sow * win );
-        INTERP_F( t,
-                  dst->tmuvtx[1].tow,
-                  out->tmuvtx[1].tow * wout, 
-                  in->tmuvtx[1].tow * win );
         INTERP_F( t, 
                   dst->tmuvtx[1].oow, 
                   out->tmuvtx[1].oow * wout, 
                   in->tmuvtx[1].oow * win );
-
-        dst->tmuvtx[1].sow *= oow;
-        dst->tmuvtx[1].tow *= oow;
-        dst->tmuvtx[1].oow *= oow;
-      } else {
-        INTERP_F( t, 
-                  dst->tmuvtx[1].sow, 
-                  out->tmuvtx[1].sow * wout, 
-                  in->tmuvtx[1].sow * win );
-        INTERP_F( t,
-                  dst->tmuvtx[1].tow,
-                  out->tmuvtx[1].tow * wout, 
-                  in->tmuvtx[1].tow * win );
-
-        dst->tmuvtx[1].sow *= oow;
-        dst->tmuvtx[1].tow *= oow;
       }
    }
 }