summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-01-05 11:10:05 +0000
committerKeith Whitwell <[email protected]>2005-01-05 11:10:05 +0000
commitd5b1605449b3a29c02ee74e042a0a32720f3561a (patch)
treee29b7e91b128a8d0012b946512cc4a0a3afd4d6f /src/mesa
parent380ba2daec31a72d3484aabb6bc34905463c46c9 (diff)
If there is only one normal, don't transform it multiple times.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/tnl/t_vb_normals.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c
index 732e7c6f4ec..d82008821f2 100644
--- a/src/mesa/tnl/t_vb_normals.c
+++ b/src/mesa/tnl/t_vb_normals.c
@@ -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;