nir: use enum operator helper for nir_variable_mode and nir_metadata
[mesa.git] / src / mesa / tnl / t_vb_texgen.c
index 88171085835439824c1749c6c92251b653868c89..aa8d10b4de4450aeac62d53678c9475e2dc381bc 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
@@ -23,7 +22,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  *
  * Authors:
- *    Brian Paul Keith Whitwell <keith@tungstengraphics.com>
+ *    Brian Paul Keith Whitwell <keithw@vmware.com>
  */
 
 /*
  * including any use thereof or modifications thereto.
  */
 
+#include "main/errors.h"
 #include "main/glheader.h"
-#include "main/colormac.h"
 #include "main/macros.h"
-#include "main/imports.h"
+
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
@@ -117,7 +116,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 * INV_SQRTF(m[i]);
+        m[i] = 0.5F * (1.0f / sqrtf(m[i]));
       }
    }
 }
@@ -146,7 +145,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 * INV_SQRTF(m[i]);
+        m[i] = 0.5F * (1.0f / sqrtf(m[i]));
       }
    }
 }
@@ -264,7 +263,7 @@ static void texgen_reflection_map_nv( struct gl_context *ctx,
    out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
    out->count = VB->Count;
    out->size = MAX2(in->size, 3);
-   if (in->size == 4) 
+   if (in->size == 4)
       _mesa_copy_tab[0x8]( out, in );
 }
 
@@ -293,7 +292,7 @@ static void texgen_normal_map_nv( struct gl_context *ctx,
    out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
    out->count = count;
    out->size = MAX2(in->size, 3);
-   if (in->size == 4) 
+   if (in->size == 4)
       _mesa_copy_tab[0x8]( out, in );
 }
 
@@ -339,7 +338,8 @@ static void texgen( struct gl_context *ctx,
    struct vertex_buffer *VB = &tnl->vb;
    GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit];
    GLvector4f *out = &store->texcoord[unit];
-   const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+   const struct gl_fixedfunc_texture_unit *texUnit =
+      &ctx->Texture.FixedFuncUnit[unit];
    const GLvector4f *obj = VB->AttribPtr[_TNL_ATTRIB_POS];
    const GLvector4f *eye = VB->EyePtr;
    const GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL];
@@ -487,14 +487,14 @@ static GLboolean run_texgen_stage( struct gl_context *ctx,
    struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
    GLuint i;
 
-   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) 
+   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current)
       return GL_TRUE;
 
    for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) {
-      struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+      struct gl_fixedfunc_texture_unit *texUnit =
+         &ctx->Texture.FixedFuncUnit[i];
 
       if (texUnit->TexGenEnabled) {
-
         store->TexgenFunc[i]( ctx, store, i );
 
          VB->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->texcoord[i];
@@ -511,11 +511,12 @@ static void validate_texgen_stage( struct gl_context *ctx,
    struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
    GLuint i;
 
-   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) 
+   if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current)
       return;
 
    for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) {
-      struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+      struct gl_fixedfunc_texture_unit *texUnit =
+         &ctx->Texture.FixedFuncUnit[i];
 
       if (texUnit->TexGenEnabled) {
         GLuint sz;