From f14215689244a65064158e475e4f41eb149d85b0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 20 May 2010 02:22:26 -0500 Subject: Vectorized avatar vertex skinning. --- indra/newview/llpolymesh.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index d5a2d66bcf..b8bdbfb2f8 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -708,15 +708,17 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ mClothingWeights = reference_mesh->mClothingWeights; } else - { + { #if 1 // Allocate memory without initializing every vector // NOTE: This makes asusmptions about the size of LLVector[234] int nverts = mSharedData->mNumVertices; - int nfloats = nverts * (3*5 + 2 + 4); - mVertexData = new F32[nfloats]; + int nfloats = nverts * (2*4 + 3*3 + 2 + 4); + + //use aligned vertex data to make LLPolyMesh SSE friendly + mVertexData = (F32*) _mm_malloc(nfloats*4, 16); int offset = 0; - mCoords = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; + mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mScaledNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; mBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; mScaledBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; @@ -757,7 +759,7 @@ LLPolyMesh::~LLPolyMesh() delete [] mClothingWeights; delete [] mTexCoords; #else - delete [] mVertexData; + _mm_free(mVertexData); #endif } @@ -864,7 +866,7 @@ void LLPolyMesh::dumpDiagInfo() //----------------------------------------------------------------------------- // getWritableCoords() //----------------------------------------------------------------------------- -LLVector3 *LLPolyMesh::getWritableCoords() +LLVector4 *LLPolyMesh::getWritableCoords() { return mCoords; } @@ -872,7 +874,7 @@ LLVector3 *LLPolyMesh::getWritableCoords() //----------------------------------------------------------------------------- // getWritableNormals() //----------------------------------------------------------------------------- -LLVector3 *LLPolyMesh::getWritableNormals() +LLVector4 *LLPolyMesh::getWritableNormals() { return mNormals; } @@ -927,8 +929,12 @@ void LLPolyMesh::initializeForMorph() if (!mSharedData) return; - memcpy(mCoords, mSharedData->mBaseCoords, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ - memcpy(mNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ + for (U32 i = 0; i < mSharedData->mNumVertices; ++i) + { + mCoords[i] = LLVector4(mSharedData->mBaseCoords[i]); + mNormals[i] = LLVector4(mSharedData->mBaseNormals[i]); + } + memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ -- cgit v1.2.3 From 05a23f8dbaa45c64bcf6c55dd09a468ba2b1f144 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 21 May 2010 04:49:12 -0500 Subject: Vectorized memcpy. 16-byte aligned vertex buffers. (almost) fully vectorized avatar vertex buffer updating --- index buffers still need to be vectorized --- indra/newview/llpolymesh.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index b8bdbfb2f8..98c0191397 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -140,7 +140,7 @@ void LLPolyMeshSharedData::freeMeshData() delete [] mDetailTexCoords; mDetailTexCoords = NULL; - delete [] mWeights; + _mm_free(mWeights); mWeights = NULL; } @@ -230,7 +230,7 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices ) mBaseBinormals = new LLVector3[ numVertices ]; mTexCoords = new LLVector2[ numVertices ]; mDetailTexCoords = new LLVector2[ numVertices ]; - mWeights = new F32[ numVertices ]; + mWeights = (F32*) _mm_malloc((numVertices*sizeof(F32)+0xF) & ~0xF, 16); for (i = 0; i < numVertices; i++) { mWeights[i] = 0.f; @@ -717,13 +717,20 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ //use aligned vertex data to make LLPolyMesh SSE friendly mVertexData = (F32*) _mm_malloc(nfloats*4, 16); int offset = 0; - mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; - mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; - mScaledNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mScaledBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mTexCoords = (LLVector2*)(mVertexData + offset); offset += 2*nverts; - mClothingWeights = (LLVector4*)(mVertexData + offset); offset += 4*nverts; + + //all members must be 16-byte aligned except the last 3 + mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; + mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; + mClothingWeights = (LLVector4*)(mVertexData + offset); offset += 4*nverts; + mTexCoords = (LLVector2*)(mVertexData + offset); offset += 2*nverts; + + // these members don't need to be 16-byte aligned, but the first one might be + // read during an aligned memcpy of mTexCoords + mScaledNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + mBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + mScaledBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + + #else mCoords = new LLVector3[mSharedData->mNumVertices]; mNormals = new LLVector3[mSharedData->mNumVertices]; -- cgit v1.2.3 From ab31e3bb217089e0cc28ca57bb5c4e46c06789dd Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 21 May 2010 15:11:16 +0100 Subject: Fix up the SSE stuff so it compiles on Linux. Though I don't think it actually works properly. --- indra/newview/llpolymesh.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index b8bdbfb2f8..af3c3e2b16 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -35,7 +35,8 @@ //----------------------------------------------------------------------------- #include "llviewerprecompiledheaders.h" -#include "llpolymesh.h" +#include "llfasttimer.h" +#include "llmemory.h" #include "llviewercontrol.h" #include "llxmltree.h" @@ -45,7 +46,7 @@ #include "llvolume.h" #include "llendianswizzle.h" -#include "llfasttimer.h" +#include "llpolymesh.h" #define HEADER_ASCII "Linden Mesh 1.0" #define HEADER_BINARY "Linden Binary Mesh 1.0" @@ -715,7 +716,7 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ int nfloats = nverts * (2*4 + 3*3 + 2 + 4); //use aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) _mm_malloc(nfloats*4, 16); + mVertexData = (F32*) ll_aligned_malloc(nfloats*4, 16); int offset = 0; mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; @@ -759,7 +760,7 @@ LLPolyMesh::~LLPolyMesh() delete [] mClothingWeights; delete [] mTexCoords; #else - _mm_free(mVertexData); + ll_aligned_free(mVertexData); #endif } -- cgit v1.2.3 From 62059a05cfa2b4b08fde13122997bd2a7ebbbc67 Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" Date: Mon, 24 May 2010 17:10:21 -0500 Subject: fix aligned malloc for osx. reviewed by falcon. --- indra/newview/llpolymesh.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index d0164c1033..d10e4fee3a 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -141,7 +141,7 @@ void LLPolyMeshSharedData::freeMeshData() delete [] mDetailTexCoords; mDetailTexCoords = NULL; - _mm_free(mWeights); + ll_aligned_free_16(mWeights); mWeights = NULL; } @@ -231,7 +231,7 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices ) mBaseBinormals = new LLVector3[ numVertices ]; mTexCoords = new LLVector2[ numVertices ]; mDetailTexCoords = new LLVector2[ numVertices ]; - mWeights = (F32*) _mm_malloc((numVertices*sizeof(F32)+0xF) & ~0xF, 16); + mWeights = (F32*) ll_aligned_malloc_16((numVertices*sizeof(F32)+0xF) & ~0xF); for (i = 0; i < numVertices; i++) { mWeights[i] = 0.f; @@ -716,7 +716,7 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ int nfloats = nverts * (2*4 + 3*3 + 2 + 4); //use aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) ll_aligned_malloc(nfloats*4, 16); + mVertexData = (F32*) ll_aligned_malloc_16(nfloats*4); int offset = 0; //all members must be 16-byte aligned except the last 3 @@ -767,7 +767,7 @@ LLPolyMesh::~LLPolyMesh() delete [] mClothingWeights; delete [] mTexCoords; #else - ll_aligned_free(mVertexData); + ll_aligned_free_16(mVertexData); #endif } -- cgit v1.2.3 From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/newview/llpolymesh.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index d10e4fee3a..2a14355061 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -2,31 +2,25 @@ * @file llpolymesh.cpp * @brief Implementation of LLPolyMesh class * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 2915715ec4a9bb7978c4a0db0afc26b73ab8b2fb Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 21 Nov 2010 05:09:59 -0600 Subject: Remove dependency on ll_align_malloc/free from avatar. --- indra/newview/llpolymesh.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 2a14355061..c6425ed283 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -135,7 +135,7 @@ void LLPolyMeshSharedData::freeMeshData() delete [] mDetailTexCoords; mDetailTexCoords = NULL; - ll_aligned_free_16(mWeights); + free(mWeights); mWeights = NULL; } @@ -225,7 +225,7 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices ) mBaseBinormals = new LLVector3[ numVertices ]; mTexCoords = new LLVector2[ numVertices ]; mDetailTexCoords = new LLVector2[ numVertices ]; - mWeights = (F32*) ll_aligned_malloc_16((numVertices*sizeof(F32)+0xF) & ~0xF); + mWeights = (F32*) malloc((numVertices*sizeof(F32)+0xF) & ~0xF); for (i = 0; i < numVertices; i++) { mWeights[i] = 0.f; @@ -709,8 +709,8 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ int nverts = mSharedData->mNumVertices; int nfloats = nverts * (2*4 + 3*3 + 2 + 4); - //use aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) ll_aligned_malloc_16(nfloats*4); + //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly + mVertexData = (F32*) malloc(nfloats*4); int offset = 0; //all members must be 16-byte aligned except the last 3 @@ -761,7 +761,7 @@ LLPolyMesh::~LLPolyMesh() delete [] mClothingWeights; delete [] mTexCoords; #else - ll_aligned_free_16(mVertexData); + free(mVertexData); #endif } -- cgit v1.2.3 From f17997e274a426086e20e1743f79748ccfadcbac Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 6 Apr 2011 16:21:40 -0500 Subject: merge cleanup --- indra/newview/llpolymesh.cpp | 122 +++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 74 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index b512a867ba..90e835cda8 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -738,43 +738,40 @@ const LLVector2 &LLPolyMeshSharedData::getUVs(U32 index) //----------------------------------------------------------------------------- LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_mesh) { - LLMemType mt(LLMemType::MTYPE_AVATAR_MESH); - - llassert(shared_data); - - mSharedData = shared_data; - mReferenceMesh = reference_mesh; - mAvatarp = NULL; - mVertexData = NULL; - - mCurVertexCount = 0; - mFaceIndexCount = 0; - mFaceIndexOffset = 0; - mFaceVertexCount = 0; - mFaceVertexOffset = 0; - - if (shared_data->isLOD() && reference_mesh) - { - mCoords = reference_mesh->mCoords; - mNormals = reference_mesh->mNormals; - mScaledNormals = reference_mesh->mScaledNormals; - mBinormals = reference_mesh->mBinormals; - mScaledBinormals = reference_mesh->mScaledBinormals; - mTexCoords = reference_mesh->mTexCoords; - mClothingWeights = reference_mesh->mClothingWeights; - } - else - { -#if 1 // Allocate memory without initializing every vector - // NOTE: This makes asusmptions about the size of LLVector[234] - int nverts = mSharedData->mNumVertices; - int nfloats = nverts * (3*5 + 2 + 4); - mVertexData = new F32[nfloats]; + LLMemType mt(LLMemType::MTYPE_AVATAR_MESH); + + llassert(shared_data); + + mSharedData = shared_data; + mReferenceMesh = reference_mesh; + mAvatarp = NULL; + mVertexData = NULL; + + mCurVertexCount = 0; + mFaceIndexCount = 0; + mFaceIndexOffset = 0; + mFaceVertexCount = 0; + mFaceVertexOffset = 0; + + if (shared_data->isLOD() && reference_mesh) + { + mCoords = reference_mesh->mCoords; + mNormals = reference_mesh->mNormals; + mScaledNormals = reference_mesh->mScaledNormals; + mBinormals = reference_mesh->mBinormals; + mScaledBinormals = reference_mesh->mScaledBinormals; + mTexCoords = reference_mesh->mTexCoords; + mClothingWeights = reference_mesh->mClothingWeights; + } + else + { + // Allocate memory without initializing every vector + // NOTE: This makes asusmptions about the size of LLVector[234] + int nverts = mSharedData->mNumVertices; + int nfloats = nverts * (3*5 + 2 + 4); //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) malloc(nfloats*4); - int offset = 0; - mCoords = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + mVertexData = new F32[nfloats]; + int offset = 0; mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mClothingWeights = (LLVector4*)(mVertexData + offset); offset += 4*nverts; @@ -782,23 +779,11 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ // these members don't need to be 16-byte aligned, but the first one might be // read during an aligned memcpy of mTexCoords - mScaledNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mScaledBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; - mTexCoords = (LLVector2*)(mVertexData + offset); offset += 2*nverts; - mClothingWeights = (LLVector4*)(mVertexData + offset); offset += 4*nverts; -#else - mCoords = new LLVector3[mSharedData->mNumVertices]; - mNormals = new LLVector3[mSharedData->mNumVertices]; - mScaledNormals = new LLVector3[mSharedData->mNumVertices]; - mBinormals = new LLVector3[mSharedData->mNumVertices]; - mScaledBinormals = new LLVector3[mSharedData->mNumVertices]; - mTexCoords = new LLVector2[mSharedData->mNumVertices]; - mClothingWeights = new LLVector4[mSharedData->mNumVertices]; - memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices); -#endif - initializeForMorph(); - } + mScaledNormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + mBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + mScaledBinormals = (LLVector3*)(mVertexData + offset); offset += 3*nverts; + initializeForMorph(); + } } @@ -813,17 +798,9 @@ LLPolyMesh::~LLPolyMesh() delete mJointRenderData[i]; mJointRenderData[i] = NULL; } -#if 0 // These are now allocated as one big uninitialized chunk - delete [] mCoords; - delete [] mNormals; - delete [] mScaledNormals; - delete [] mBinormals; - delete [] mScaledBinormals; - delete [] mClothingWeights; - delete [] mTexCoords; -#else - delete [] mVertexData; -#endif + + delete [] mVertexData; + } @@ -989,20 +966,17 @@ LLVector3 *LLPolyMesh::getScaledBinormals() //----------------------------------------------------------------------------- void LLPolyMesh::initializeForMorph() { - if (!mSharedData) - return; - - memcpy(mCoords, mSharedData->mBaseCoords, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ - memcpy(mNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ + for (U32 i = 0; i < mSharedData->mNumVertices; ++i) + { mCoords[i] = LLVector4(mSharedData->mBaseCoords[i]); mNormals[i] = LLVector4(mSharedData->mBaseNormals[i]); } - memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ - memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ - memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ - memcpy(mTexCoords, mSharedData->mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ - memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices); + memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ + memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ + memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ + memcpy(mTexCoords, mSharedData->mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices); /*Flawfinder: ignore*/ + memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices); } //----------------------------------------------------------------------------- -- cgit v1.2.3 From 13e12b2773ebd784281e76a1ec488c532962f765 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 12 Apr 2011 17:22:02 -0500 Subject: Fix for bad merge causing crash in llpolymorph.cpp --- indra/newview/llpolymesh.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 90e835cda8..24f84b2ddf 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -768,9 +768,9 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ // Allocate memory without initializing every vector // NOTE: This makes asusmptions about the size of LLVector[234] int nverts = mSharedData->mNumVertices; - int nfloats = nverts * (3*5 + 2 + 4); - //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = new F32[nfloats]; + int nfloats = nverts * (2*4 + 3*3 + 2 + 4); + //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly + mVertexData = (F32*) malloc(nfloats*4); int offset = 0; mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; @@ -799,7 +799,7 @@ LLPolyMesh::~LLPolyMesh() mJointRenderData[i] = NULL; } - delete [] mVertexData; + free(mVertexData); } -- cgit v1.2.3 From 12f9f521ee6baeb39b403dfe15168de7ecfd9349 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 13 Apr 2011 13:43:32 -0500 Subject: Fix for bad default setting and libpng using /GL --- indra/newview/llpolymesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpolymesh.cpp') diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 24f84b2ddf..4b2c569cc3 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -768,9 +768,9 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ // Allocate memory without initializing every vector // NOTE: This makes asusmptions about the size of LLVector[234] int nverts = mSharedData->mNumVertices; - int nfloats = nverts * (2*4 + 3*3 + 2 + 4); - //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) malloc(nfloats*4); + int nfloats = nverts * (2*4 + 3*3 + 2 + 4); + //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly + mVertexData = (F32*) malloc(nfloats*4); int offset = 0; mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; -- cgit v1.2.3