From 0d7fa932d579f3fb6140658db7efb01fcd8f5ceb Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Fri, 20 Apr 2018 18:14:29 +0100 Subject: Move class3 sky/cloud shaders to where they need to be to get picked up by ALM. Modify autobuild.xml to use new libatmo w/ state save/restore fixes (addresses font render glitch). Put in nSight debug support. --- indra/llmath/llvolume.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/llmath/llvolume.cpp') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 24f46d720b..2bce4e9bd3 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2191,6 +2191,12 @@ BOOL LLVolume::generate() LLVector4a* end_profile = profile+sizeT; LLVector4a offset = mPathp->mPath[s].mPos; + if (!offset.isFinite3()) + { // MAINT-5660; don't know why this happens, does not affect Release builds + LL_WARNS() << "LLVolume using path with non-finite points. Resetting them to 0,0,0" << LL_ENDL; + offset.clear(); + } + LLVector4a tmp; // Run along the profile. @@ -2198,7 +2204,7 @@ BOOL LLVolume::generate() { rot_mat.rotate(*profile++, tmp); dst->setAdd(tmp,offset); - llassert(dst->isFinite3()); // MAINT-5660; don't know why this happens, does not affect Release builds + ++dst; } } -- cgit v1.2.3 From 898c9f44218353b3bf71b78ffce02662b4927625 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Mar 2019 13:21:48 -0700 Subject: Mods to make merge with viewer-release have less whitespace-only change and fix diffs between EEP and VR. --- indra/llmath/llvolume.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llmath/llvolume.cpp') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 0e1748b337..605032e0a8 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2204,7 +2204,6 @@ BOOL LLVolume::generate() { rot_mat.rotate(*profile++, tmp); dst->setAdd(tmp,offset); - ++dst; } } -- cgit v1.2.3 From 76128c4357bc36acd54575153516c6d337fe4263 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 5 Aug 2019 12:04:29 -0700 Subject: SL-10566 Use vector for some high-traffic, low-item count containers instead of list. Provide method of storing joint indices sep from weight data for faster runtime processing. --- indra/llmath/llvolume.cpp | 54 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 7 deletions(-) (limited to 'indra/llmath/llvolume.cpp') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index e32625796c..9d0cf1e119 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2526,6 +2526,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (mdl[i].has("Weights")) { face.allocateWeights(num_verts); + face.allocateJointIndices(num_verts); LLSD::Binary weights = mdl[i]["Weights"]; @@ -2566,6 +2567,13 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) { wght = LLVector4(0.999f,0.f,0.f,0.f); } + if (face.mJointIndices) + { + for (U32 k=0; k<4; k++) + { + face.mJointIndices[cur_vertex * 4 + k] = llclamp((U8)joints[k], (U8)0, (U8)110); + } + } for (U32 k=0; k<4; k++) { F32 f_combined = (F32) joints[k] + wght[k]; @@ -4656,6 +4664,7 @@ LLVolumeFace::LLVolumeFace() : mTexCoords(NULL), mIndices(NULL), mWeights(NULL), + mJointIndices(NULL), mWeightsScrubbed(FALSE), mOctree(NULL), mOptimized(FALSE) @@ -4682,6 +4691,7 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mTexCoords(NULL), mIndices(NULL), mWeights(NULL), + mJointIndices(NULL), mWeightsScrubbed(FALSE), mOctree(NULL) { @@ -4746,15 +4756,29 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) if (src.mWeights) { + llassert(!mWeights); // don't orphan an old alloc here accidentally allocateWeights(src.mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mWeights, (F32*) src.mWeights, vert_size); + LLVector4a::memcpyNonAliased16((F32*) mWeights, (F32*) src.mWeights, vert_size); + mWeightsScrubbed = src.mWeightsScrubbed; } else { - ll_aligned_free_16(mWeights); - mWeights = NULL; - } - mWeightsScrubbed = src.mWeightsScrubbed; + ll_aligned_free_16(mWeights); + mWeights = NULL; + mWeightsScrubbed = FALSE; + } + + if (src.mJointIndices) + { + llassert(!mJointIndices); // don't orphan an old alloc here accidentally + allocateJointIndices(src.mNumVertices); + LLVector4a::memcpyNonAliased16((F32*) mJointIndices, (F32*) src.mJointIndices, src.mNumVertices * sizeof(U8) * 4); + } + else + { + ll_aligned_free_16(mJointIndices); + mJointIndices = NULL; + } } if (mNumIndices) @@ -4763,7 +4787,12 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) LLVector4a::memcpyNonAliased16((F32*) mIndices, (F32*) src.mIndices, idx_size); } - + else + { + ll_aligned_free_16(mIndices); + mIndices = NULL; + } + mOptimized = src.mOptimized; //delete @@ -4794,6 +4823,8 @@ void LLVolumeFace::freeData() mTangents = NULL; ll_aligned_free_16(mWeights); mWeights = NULL; + ll_aligned_free_16(mJointIndices); + mJointIndices = NULL; delete mOctree; mOctree = NULL; @@ -5448,11 +5479,13 @@ bool LLVolumeFace::cacheOptimize() // DO NOT free mNormals and mTexCoords as they are part of mPositions buffer ll_aligned_free_16(mWeights); ll_aligned_free_16(mTangents); + ll_aligned_free_16(mJointIndices); mPositions = pos; mNormals = norm; mTexCoords = tc; mWeights = wght; + mJointIndices = NULL; // filled in later as necessary by skinning code for acceleration mTangents = binorm; //std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks); @@ -6362,7 +6395,14 @@ void LLVolumeFace::allocateTangents(S32 num_verts) void LLVolumeFace::allocateWeights(S32 num_verts) { ll_aligned_free_16(mWeights); - mWeights = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + mWeights = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + +} + +void LLVolumeFace::allocateJointIndices(S32 num_verts) +{ + ll_aligned_free_16(mJointIndices); + mJointIndices = (U8*)ll_aligned_malloc_16(sizeof(U8) * 4 * num_verts); } void LLVolumeFace::resizeIndices(S32 num_indices) -- cgit v1.2.3 From 71af0a2a9e9f90d1e336f8a30f642bb5e19ef658 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 6 Aug 2019 14:41:55 -0700 Subject: Fix shutdown crash in teardown of joint heirarchy. Ifdef'd code for potential skinning speed up to avoid lots of int<->float conversions (expensive and static for min space investment) as updating rigged VBs shows up as a profiling bottleneck for Low rendering (where we actually use CPU skinning). --- indra/llmath/llvolume.cpp | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'indra/llmath/llvolume.cpp') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 9d0cf1e119..df867b332d 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2526,7 +2526,6 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (mdl[i].has("Weights")) { face.allocateWeights(num_verts); - face.allocateJointIndices(num_verts); LLSD::Binary weights = mdl[i]["Weights"]; @@ -2567,13 +2566,6 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) { wght = LLVector4(0.999f,0.f,0.f,0.f); } - if (face.mJointIndices) - { - for (U32 k=0; k<4; k++) - { - face.mJointIndices[cur_vertex * 4 + k] = llclamp((U8)joints[k], (U8)0, (U8)110); - } - } for (U32 k=0; k<4; k++) { F32 f_combined = (F32) joints[k] + wght[k]; @@ -4664,7 +4656,10 @@ LLVolumeFace::LLVolumeFace() : mTexCoords(NULL), mIndices(NULL), mWeights(NULL), +#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS + mJustWeights(NULL), mJointIndices(NULL), +#endif mWeightsScrubbed(FALSE), mOctree(NULL), mOptimized(FALSE) @@ -4691,7 +4686,10 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mTexCoords(NULL), mIndices(NULL), mWeights(NULL), +#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS + mJustWeights(NULL), mJointIndices(NULL), +#endif mWeightsScrubbed(FALSE), mOctree(NULL) { @@ -4768,19 +4766,22 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) mWeightsScrubbed = FALSE; } + #if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS if (src.mJointIndices) { llassert(!mJointIndices); // don't orphan an old alloc here accidentally allocateJointIndices(src.mNumVertices); LLVector4a::memcpyNonAliased16((F32*) mJointIndices, (F32*) src.mJointIndices, src.mNumVertices * sizeof(U8) * 4); } - else + else*/ { ll_aligned_free_16(mJointIndices); mJointIndices = NULL; } - } + #endif + } + if (mNumIndices) { S32 idx_size = (mNumIndices*sizeof(U16)+0xF) & ~0xF; @@ -4823,8 +4824,13 @@ void LLVolumeFace::freeData() mTangents = NULL; ll_aligned_free_16(mWeights); mWeights = NULL; + +#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS ll_aligned_free_16(mJointIndices); mJointIndices = NULL; + ll_aligned_free_16(mJustWeights); + mJustWeights = NULL; +#endif delete mOctree; mOctree = NULL; @@ -5479,13 +5485,17 @@ bool LLVolumeFace::cacheOptimize() // DO NOT free mNormals and mTexCoords as they are part of mPositions buffer ll_aligned_free_16(mWeights); ll_aligned_free_16(mTangents); +#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS ll_aligned_free_16(mJointIndices); + ll_aligned_free_16(mJustWeights); + mJustWeights = NULL; + mJointIndices = NULL; // filled in later as necessary by skinning code for acceleration +#endif mPositions = pos; mNormals = norm; mTexCoords = tc; - mWeights = wght; - mJointIndices = NULL; // filled in later as necessary by skinning code for acceleration + mWeights = wght; mTangents = binorm; //std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks); @@ -6401,8 +6411,13 @@ void LLVolumeFace::allocateWeights(S32 num_verts) void LLVolumeFace::allocateJointIndices(S32 num_verts) { +#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS ll_aligned_free_16(mJointIndices); + ll_aligned_free_16(mJustWeights); + mJointIndices = (U8*)ll_aligned_malloc_16(sizeof(U8) * 4 * num_verts); + mJustWeights = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a) * num_verts); +#endif } void LLVolumeFace::resizeIndices(S32 num_indices) -- cgit v1.2.3