Give attributes with zero-stride a count of 1 to make it easier
[mesa.git] / src / mesa / tnl / t_vb_normals.c
index 2908f1aee082be4cb48d37b7b0d4bf2952a3542e..9d6a4ba5d2ddf703c1efdecc4e56e699deea7f60 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.1
  *
- * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -74,6 +73,13 @@ static GLboolean run_normal_stage( GLcontext *ctx,
                              VB->NormalPtr,  /* input normals */
                              lengths,
                              &store->normal ); /* resulting normals */
+
+      if (VB->NormalPtr->count > 1) {
+        store->normal.stride = 16;
+      }
+      else {
+        store->normal.stride = 0;
+      }
    }
 
    VB->NormalPtr = &store->normal;
@@ -137,7 +143,7 @@ static GLboolean run_validate_normal_stage( GLcontext *ctx,
 static void check_normal_transform( GLcontext *ctx,
                                    struct tnl_pipeline_stage *stage )
 {
-   stage->active = !ctx->VertexProgram.Enabled &&
+   stage->active = !ctx->VertexProgram._Enabled &&
       (ctx->Light.Enabled || (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS));
 
    /* Don't clobber the initialize function:
@@ -179,6 +185,7 @@ static void free_normal_data( struct tnl_pipeline_stage *stage )
 
 #define _TNL_NEW_NORMAL_TRANSFORM        (_NEW_MODELVIEW| \
                                          _NEW_TRANSFORM| \
+                                         _NEW_PROGRAM| \
                                           _MESA_NEW_NEED_NORMALS| \
                                           _MESA_NEW_NEED_EYE_COORDS)