summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-01-29 18:25:03 -0500
committerOz Linden <oz@lindenlab.com>2014-01-29 18:25:03 -0500
commit7b1e1e4e35351936f2ab0305a91691f78f69519d (patch)
tree33fe5158da98924ed8fb96cffd73e24bce1b37db
parentcabd5867b7bb35cff08024a5b7305f1ad8adf3fb (diff)
FITMESH-6: correct bounds checking
-rwxr-xr-xindra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl2
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 8eb5a977bc..57129c3bd1 100755
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -34,7 +34,7 @@ mat4 getObjectSkinnedTransform()
vec4 w = fract(weight4);
vec4 index = floor(weight4);
- index = min(index, vec4(63.0));
+ index = min(index, vec4(51.0));
index = max(index, vec4( 0.0));
float scale = 1.0/(w.x+w.y+w.z+w.w);
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 4578d3d0cd..906b7b2809 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -698,7 +698,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor()
specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP);
normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
- sVertexProgram->bind();
+ U1573sVertexProgram->bind();
sVertexProgram->setMinimumAlpha(0.01f);
}
@@ -1586,7 +1586,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
LLMatrix4a mp[JOINT_COUNT];
LLMatrix4* mat = (LLMatrix4*) mp;
- for (U32 j = 0; j < skin->mJointNames.size(); ++j)
+ U32 count = llmin((U32) skin->mJointNames.size(), (U32) JOINT_COUNT);
+ for (U32 j = 0; j < count; ++j)
{
LLJoint* joint = avatar->getJoint(skin->mJointNames[j]);
if (joint)