summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolavatar.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-09-20 18:45:56 -0500
committerDave Parks <davep@lindenlab.com>2010-09-20 18:45:56 -0500
commitc42ed54b0a532cb4e0ad30a1b0b5038cef9938f2 (patch)
tree39eb08c897f9e59fe448a1f63b354f83b7309f0b /indra/newview/lldrawpoolavatar.cpp
parent2c4c1c47bce3db7420f0eb27bdaa7598fbbbb65a (diff)
Stop using ll_aligned_malloc/free in llvolume.
Fix for garbage data in vertex weight array crashing software skinning. Proper integration of picking for rigged attachhments. Optimization in LLDrawable::updateDistance (don't call updateRelativeXform, just use spatial group position).
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index ccc060f3fa..5cf6082f12 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1325,6 +1325,12 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
#if LL_MESH_ENABLED
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
{
+ LLVector4a* weight = vol_face.mWeights;
+ if (!weight)
+ {
+ return;
+ }
+
LLVertexBuffer* buffer = face->mVertexBuffer;
U32 data_mask = 0;
@@ -1403,8 +1409,6 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
}
}
- LLVector4a* weight = vol_face.mWeights;
-
LLMatrix4a bind_shape_matrix;
bind_shape_matrix.loadu(skin->mBindShapeMatrix);
@@ -1422,7 +1426,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
{
F32 w = weight[j][k];
- idx[k] = (S32) floorf(w);
+ idx[k] = llclamp((S32) floorf(w), 0, 63);
wght[k] = w - floorf(w);
scale += wght[k];
}