diff options
author | Keith Whitwell <[email protected]> | 2005-01-05 18:06:05 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-01-05 18:06:05 +0000 |
commit | dd9666bc1def9e99a5050545ab71d24037cf5af0 (patch) | |
tree | 0d5f0b91399159768aa9ed35384dc1cb1d107d1b /src/mesa/tnl/t_vb_normals.c | |
parent | 30f64862766c573505fb7cd03a1c10bbf584c183 (diff) |
Give attributes with zero-stride a count of 1 to make it easier
to avoid transforming the same attribute multiple times.
Don't light a single normal multiple times in light_fast_rgba*
Diffstat (limited to 'src/mesa/tnl/t_vb_normals.c')
-rw-r--r-- | src/mesa/tnl/t_vb_normals.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index d82008821f2..9d6a4ba5d2d 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -68,23 +68,18 @@ 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; + if (VB->NormalPtr->count > 1) { + store->normal.stride = 16; + } + else { store->normal.stride = 0; } - else - store->normal.stride = 16; } VB->NormalPtr = &store->normal; |