Added ctx->Texture._EnabledCoordUnits bitfield.
[mesa.git] / src / mesa / tnl / t_vb_texgen.c
index 74ad17356b08e0a1c45254ceb7fe27441347a088..9a954bf485151ffaa03dbe1d06387931543fbf2b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t_vb_texgen.c,v 1.17 2003/03/01 01:50:27 brianp Exp $ */
+/* $Id: t_vb_texgen.c,v 1.19 2003/03/31 16:48:35 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -113,7 +113,7 @@ static void build_m3( GLfloat f[][3], GLfloat m[],
       fz = f[i][2] = u[2] - norm[2] * two_nu;
       m[i] = fx * fx + fy * fy + (fz + 1.0F) * (fz + 1.0F);
       if (m[i] != 0.0F) {
-        m[i] = 0.5F / SQRTF(m[i]);
+        m[i] = 0.5F * _mesa_inv_sqrtf(m[i]);
       }
    }
 }
@@ -142,7 +142,7 @@ static void build_m2( GLfloat f[][3], GLfloat m[],
       fz = f[i][2] = u[2] - norm[2] * two_nu;
       m[i] = fx * fx + fy * fy + (fz + 1.0F) * (fz + 1.0F);
       if (m[i] != 0.0F) {
-        m[i] = 0.5F / SQRTF(m[i]);
+        m[i] = 0.5F * _mesa_inv_sqrtf(m[i]);
       }
    }
 }
@@ -367,7 +367,7 @@ static void texgen( GLcontext *ctx,
    GLuint count = VB->Count;
    GLfloat (*f)[3] = store->tmp_f;
    GLfloat *m = store->tmp_m;
-        GLuint holes = 0;
+   GLuint holes = 0;
 
 
    if (texUnit->_GenFlags & TEXGEN_NEED_M) {
@@ -399,6 +399,7 @@ static void texgen( GLcontext *ctx,
    }
 
    if (holes) {
+      if (holes & VEC_DIRTY_3) _mesa_vector4f_clean_elem(out, count, 3);
       if (holes & VEC_DIRTY_2) _mesa_vector4f_clean_elem(out, count, 2);
       if (holes & VEC_DIRTY_1) _mesa_vector4f_clean_elem(out, count, 1);
       if (holes & VEC_DIRTY_0) _mesa_vector4f_clean_elem(out, count, 0);