Another stab at FIRE-13407: Skinned simple shader compilation - index out of bounds

Ansariel 2014-08-26 09:58:46 +02:00
parent cd05159b22
commit ae08a0ff5b
1 changed files with 4 additions and 1 deletions

View File

@ -4087,7 +4087,10 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
{
F32 w = weight[j][k];
idx[k] = (S32) floorf(w);
// <FS:Ansariel> Proper matrix array length for fitted mesh
//idx[k] = (S32) floorf(w);
idx[k] = llclamp((S32) floorf(w), 0, (S32)kMaxJoints - 1);
// </FS:Ansariel>
wght[k] = w - floorf(w);
scale += wght[k];
}