Merge remote branch 'origin/lp-binning'
[mesa.git] / src / mesa / tnl / t_vb_normals.c
index 7ac33f8bec4cb171b52a7bae74a2cb3b0610935d..693d3dc118d17d806c816b676fb84581fd939868 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.3
+ * Version:  6.5
  *
- * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2006  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"),
  */
 
 
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
 
 #include "math/m_xform.h"
 
@@ -67,19 +67,18 @@ run_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
 
    store->NormalTransform( ctx->ModelviewMatrixStack.Top,
                           ctx->_ModelViewInvScale,
-                          VB->NormalPtr,  /* input normals */
+                          VB->AttribPtr[_TNL_ATTRIB_NORMAL],  /* input normals */
                           lengths,
                           &store->normal ); /* resulting normals */
 
-   if (VB->NormalPtr->count > 1) {
+   if (VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count > 1) {
       store->normal.stride = 4 * sizeof(GLfloat);
    }
    else {
       store->normal.stride = 0;
    }
 
-   VB->NormalPtr = &store->normal;
-   VB->AttribPtr[_TNL_ATTRIB_NORMAL] = VB->NormalPtr;
+   VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &store->normal;
 
    VB->NormalLengthPtr = NULL; /* no longer valid */
    return GL_TRUE;
@@ -95,7 +94,7 @@ validate_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
 {
    struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
 
-   if (ctx->VertexProgram._Enabled ||
+   if (ctx->VertexProgram._Current ||
        (!ctx->Light.Enabled &&
        !(ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS))) {
       store->NormalTransform = NULL;