If there is only one normal, don't transform it multiple times.

This commit is contained in:
Keith Whitwell
2005-01-05 11:10:05 +00:00
parent 380ba2daec
commit d5b1605449
+12
View File
@@ -68,11 +68,23 @@ static GLboolean run_normal_stage( GLcontext *ctx,
else
lengths = VB->NormalLengthPtr;
/* If there is only one normal, don't transform it multiple times:
*/
if (VB->NormalPtr->stride == 0)
VB->NormalPtr->count = 1;
store->NormalTransform( ctx->ModelviewMatrixStack.Top,
ctx->_ModelViewInvScale,
VB->NormalPtr, /* input normals */
lengths,
&store->normal ); /* resulting normals */
if (VB->NormalPtr->stride == 0) {
VB->NormalPtr->count = VB->Count;
store->normal.stride = 0;
}
else
store->normal.stride = 16;
}
VB->NormalPtr = &store->normal;