From 12499cebcba81175ae5d92926f5ec89632f00926 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 16 Apr 2010 15:53:26 -0500
Subject: Fix for busted optimizations.

---
 indra/newview/lldrawpoolavatar.cpp  | 4 +---
 indra/newview/llviewerjointmesh.cpp | 6 +++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index b509b363b7..b3942d559a 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -881,9 +881,7 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const
 
 LLVertexBufferAvatar::LLVertexBufferAvatar()
 : LLVertexBuffer(sDataMask, 
-	LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 ?	
-	GL_DYNAMIC_DRAW_ARB : 
-	GL_STREAM_DRAW_ARB)
+	GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets
 {
 
 }
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 90a5a29bb4..db2279d925 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -752,14 +752,18 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
 
 			const U32 idx_count = mMesh->getNumFaces()*3;
 
+			indicesp += mMesh->mFaceIndexOffset;
+
 			U16* __restrict idx = indicesp.get();
 			S32* __restrict src_idx = (S32*) mMesh->getFaces();
 
 			i = 0;
 
+			const S32 offset = (S32) mMesh->mFaceVertexOffset;
+
 			do
 			{
-				*(idx++) = *(src_idx++);
+				*(idx++) = *(src_idx++)+offset;
 			}
 			while (++i < idx_count);
 		}
-- 
cgit v1.2.3