summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-26 03:07:05 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-26 03:07:05 +0300
commit91606c7b60de4270050f373e1efe49eb3074951b (patch)
tree5523b2c78c73d22881c0ae8bfbfcbb29ffdc5df4 /indra/newview/llvoavatar.cpp
parente6245adce883d62f18a2d8b8af5061d3183d9be9 (diff)
parentcdbd06e8ed6e3f4285a61f5c0b607a65dfdf8dfd (diff)
Merge branch 'master' into DRTVWR-548-maint-N
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp316
1 files changed, 217 insertions, 99 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 8c8025e352..37851ce99b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -111,6 +111,7 @@
#include "llsdserialize.h"
#include "llcallstack.h"
#include "llrendersphere.h"
+#include "llskinningutil.h"
#include <boost/lexical_cast.hpp>
@@ -126,6 +127,12 @@ const F32 MIN_HOVER_Z = -2.0;
const F32 MIN_ATTACHMENT_COMPLEXITY = 0.f;
const F32 DEFAULT_MAX_ATTACHMENT_COMPLEXITY = 1.0e6f;
+// Unlike with 'self' avatar, server doesn't inform viewer about
+// expected attachments so viewer has to wait to see if anything
+// else will arrive
+const F32 FIRST_APPEARANCE_CLOUD_MIN_DELAY = 3.f; // seconds
+const F32 FIRST_APPEARANCE_CLOUD_MAX_DELAY = 45.f;
+
using namespace LLAvatarAppearanceDefines;
//-----------------------------------------------------------------------------
@@ -328,6 +335,7 @@ public:
// must return FALSE when the motion is completed.
virtual BOOL onUpdate(F32 time, U8* joint_mask)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
F32 nx[2];
nx[0]=time*TORSO_NOISE_SPEED;
nx[1]=0.0f;
@@ -448,6 +456,7 @@ public:
// must return FALSE when the motion is completed.
virtual BOOL onUpdate(F32 time, U8* joint_mask)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
mBreatheRate = 1.f;
F32 breathe_amt = (sinf(mBreatheRate * time) * BREATHE_ROT_MOTION_STRENGTH);
@@ -549,6 +558,7 @@ public:
// must return FALSE when the motion is completed.
virtual BOOL onUpdate(F32 time, U8* joint_mask)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
mPelvisState->setPosition(LLVector3::zero);
return TRUE;
@@ -609,6 +619,7 @@ F32 LLVOAvatar::sUnbakedTime = 0.f;
F32 LLVOAvatar::sUnbakedUpdateTime = 0.f;
F32 LLVOAvatar::sGreyTime = 0.f;
F32 LLVOAvatar::sGreyUpdateTime = 0.f;
+LLPointer<LLViewerTexture> LLVOAvatar::sCloudTexture = NULL;
//-----------------------------------------------------------------------------
// Helper functions
@@ -664,6 +675,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mVisuallyMuteSetting(AV_RENDER_NORMALLY),
mMutedAVColor(LLColor4::white /* used for "uninitialize" */),
mFirstFullyVisible(TRUE),
+ mFirstUseDelaySeconds(FIRST_APPEARANCE_CLOUD_MIN_DELAY),
mFullyLoaded(FALSE),
mPreviousFullyLoaded(FALSE),
mFullyLoadedInitialized(FALSE),
@@ -738,7 +750,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mCurrentGesticulationLevel = 0;
-
+ mFirstAppearanceMessageTimer.reset();
mRuthTimer.reset();
mRuthDebugTimer.reset();
mDebugExistenceTimer.reset();
@@ -1125,6 +1137,7 @@ void LLVOAvatar::initClass()
LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged);
+ sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c");
}
@@ -1317,11 +1330,9 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
}
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_EXTENT_UPDATE("Av Upd Extent");
-
void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
{
- LL_RECORD_BLOCK_TIME(FTM_AVATAR_EXTENT_UPDATE);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
static LLCachedControl<S32> box_detail_cache(gSavedSettings, "AvatarBoundingBoxComplexity");
S32 box_detail = box_detail_cache;
@@ -1425,7 +1436,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
continue;
}
LLDrawable* drawable = attached_object->mDrawable;
- if (drawable && !drawable->isState(LLDrawable::RIGGED))
+ if (drawable && !drawable->isState(LLDrawable::RIGGED | LLDrawable::RIGGED_CHILD)) // <-- don't extend bounding box if any rigged objects are present
{
LLSpatialBridge* bridge = drawable->getSpatialBridge();
if (bridge)
@@ -2491,10 +2502,6 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid)
return setTETextureCore(te, image);
}
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_UPDATE("Avatar Update");
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_UPDATE_COMPLEXITY("Avatar Update Complexity");
-static LLTrace::BlockTimerStatHandle FTM_JOINT_UPDATE("Update Joints");
-
//------------------------------------------------------------------------
// LLVOAvatar::dumpAnimationState()
//------------------------------------------------------------------------
@@ -2527,7 +2534,7 @@ void LLVOAvatar::dumpAnimationState()
//------------------------------------------------------------------------
void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
{
- LL_RECORD_BLOCK_TIME(FTM_AVATAR_UPDATE);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
if (isDead())
{
@@ -2564,8 +2571,6 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
// force asynchronous drawable update
if(mDrawable.notNull())
{
- LL_RECORD_BLOCK_TIME(FTM_JOINT_UPDATE);
-
if (isSitting() && getParent())
{
LLViewerObject *root_object = (LLViewerObject*)getRoot();
@@ -2665,9 +2670,8 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
if ((LLFrameTimer::getFrameCount() + mID.mData[0]) % compl_upd_freq == 0)
{
- LL_RECORD_BLOCK_TIME(FTM_AVATAR_UPDATE_COMPLEXITY);
- idleUpdateRenderComplexity();
-}
+ idleUpdateRenderComplexity();
+ }
idleUpdateDebugInfo();
}
@@ -2781,10 +2785,17 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
}//if ( voiceEnabled )
}
-static LLTrace::BlockTimerStatHandle FTM_ATTACHMENT_UPDATE("Update Attachments");
+static void override_bbox(LLDrawable* drawable, LLVector4a* extents)
+{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
+ drawable->setSpatialExtents(extents[0], extents[1]);
+ drawable->setPositionGroup(LLVector4a(0, 0, 0));
+ drawable->movePartition();
+}
void LLVOAvatar::idleUpdateMisc(bool detailed_update)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
if (LLVOAvatar::sJointDebug)
{
LL_INFOS() << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;
@@ -2798,7 +2809,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
// update attachments positions
if (detailed_update)
{
- LL_RECORD_BLOCK_TIME(FTM_ATTACHMENT_UPDATE);
+ U32 draw_order = 0;
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -2809,28 +2820,72 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = attachment_iter->get();
- BOOL visibleAttachment = visible || (attached_object &&
- !(attached_object->mDrawable->getSpatialBridge() &&
- attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0));
+ LLViewerObject* attached_object = attachment_iter->get();
+ if (!attached_object
+ || attached_object->isDead()
+ || !attachment->getValid()
+ || attached_object->mDrawable.isNull())
+ {
+ continue;
+ }
+
+ LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
- if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid())
+ if (visible || !(bridge && bridge->getRadius() < 2.0))
{
- // if selecting any attachments, update all of them as non-damped
- if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment())
- {
- gPipeline.updateMoveNormalAsync(attached_object->mDrawable);
- }
- else
- {
- gPipeline.updateMoveDampedAsync(attached_object->mDrawable);
- }
-
- LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
- if (bridge)
- {
- gPipeline.updateMoveNormalAsync(bridge);
- }
+ //override rigged attachments' octree spatial extents with this avatar's bounding box
+ bool rigged = false;
+ if (bridge)
+ {
+ //transform avatar bounding box into attachment's coordinate frame
+ LLVector4a extents[2];
+ bridge->transformExtents(mDrawable->getSpatialExtents(), extents);
+
+ if (attached_object->mDrawable->isState(LLDrawable::RIGGED | LLDrawable::RIGGED_CHILD))
+ {
+ rigged = true;
+ override_bbox(attached_object->mDrawable, extents);
+ }
+ }
+
+ // if selecting any attachments, update all of them as non-damped
+ if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment())
+ {
+ gPipeline.updateMoveNormalAsync(attached_object->mDrawable);
+ }
+ else
+ {
+ // Note: SL-17415; While most objects follow joints,
+ // some objects get position updates from server
+ gPipeline.updateMoveDampedAsync(attached_object->mDrawable);
+ }
+
+ // override_bbox calls movePartition() and getSpatialPartition(),
+ // so bridge might no longer be valid, get it again.
+ // ex: animesh stops being an animesh
+ bridge = attached_object->mDrawable->getSpatialBridge();
+ if (bridge)
+ {
+ if (!rigged)
+ {
+ gPipeline.updateMoveNormalAsync(bridge);
+ }
+ else
+ {
+ //specialized impl of updateMoveNormalAsync just for rigged attachment SpatialBridge
+ bridge->setState(LLDrawable::MOVE_UNDAMPED);
+ bridge->updateMove();
+ bridge->setState(LLDrawable::EARLY_MOVE);
+
+ LLSpatialGroup* group = attached_object->mDrawable->getSpatialGroup();
+ if (group)
+ { //set draw order of group
+ group->mAvatarp = this;
+ group->mRenderOrder = draw_order++;
+ }
+ }
+ }
+
attached_object->updateText();
}
}
@@ -3054,8 +3109,7 @@ void LLVOAvatar::idleUpdateLoadingEffect()
particle_parameters.mPartData.mStartColor = LLColor4(1, 1, 1, 0.5f);
particle_parameters.mPartData.mEndColor = LLColor4(1, 1, 1, 0.0f);
particle_parameters.mPartData.mStartScale.mV[VX] = 0.8f;
- LLViewerTexture* cloud = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c");
- particle_parameters.mPartImageID = cloud->getID();
+ particle_parameters.mPartImageID = sCloudTexture->getID();
particle_parameters.mMaxAge = 0.f;
particle_parameters.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE;
particle_parameters.mInnerAngle = F_PI;
@@ -3138,6 +3192,8 @@ void LLVOAvatar::idleUpdateWindEffect()
void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
+
// update chat bubble
//--------------------------------------------------------------------
// draw text label over character's head
@@ -4891,6 +4947,8 @@ bool LLVOAvatar::shouldAlphaMask()
//-----------------------------------------------------------------------------
U32 LLVOAvatar::renderSkinned()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
+
U32 num_indices = 0;
if (!mIsBuilt)
@@ -5059,11 +5117,6 @@ U32 LLVOAvatar::renderSkinned()
bool should_alpha_mask = shouldAlphaMask();
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
- if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
- }
-
BOOL first_pass = TRUE;
if (!LLDrawPoolAvatar::sSkipOpaque)
{
@@ -5110,11 +5163,6 @@ U32 LLVOAvatar::renderSkinned()
}
}
- if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
- {
- gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
- }
-
if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender)
{
LLGLState blend(GL_BLEND, !mIsDummy);
@@ -5130,21 +5178,21 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
U32 num_indices = 0;
if( isWearingWearableType( LLWearableType::WT_SKIRT ) && (isUIAvatar() || isTextureVisible(TEX_SKIRT_BAKED)) )
{
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.25f);
+ gGL.flush();
LLViewerJoint* skirt_mesh = getViewerJoint(MESH_ID_SKIRT);
if (skirt_mesh)
{
num_indices += skirt_mesh->render(mAdjustedPixelArea, FALSE);
}
first_pass = FALSE;
- gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
+ gGL.flush();
}
if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender)
{
if (LLPipeline::sImpostorRender)
{
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
+ gGL.flush();
}
if (isTextureVisible(TEX_HEAD_BAKED))
@@ -5167,7 +5215,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
}
if (LLPipeline::sImpostorRender)
{
- gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
+ gGL.flush();
}
}
@@ -5199,11 +5247,6 @@ U32 LLVOAvatar::renderRigid()
bool should_alpha_mask = shouldAlphaMask();
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
- if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
- }
-
if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar())
{
LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT);
@@ -5218,11 +5261,6 @@ U32 LLVOAvatar::renderRigid()
}
}
- if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
- {
- gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
- }
-
return num_indices;
}
@@ -5273,7 +5311,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
}
{
LLGLEnable test(GL_ALPHA_TEST);
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
+ gGL.flush();
gGL.color4ubv(color.mV);
gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
@@ -6180,27 +6218,29 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name )
LLJoint *LLVOAvatar::getJoint( S32 joint_num )
{
LLJoint *pJoint = NULL;
- S32 collision_start = mNumBones;
- S32 attachment_start = mNumBones + mNumCollisionVolumes;
- if (joint_num>=attachment_start)
+ if (joint_num >= 0)
{
- // Attachment IDs start at 1
- S32 attachment_id = joint_num - attachment_start + 1;
- attachment_map_t::iterator iter = mAttachmentPoints.find(attachment_id);
- if (iter != mAttachmentPoints.end())
+ if (joint_num < mNumBones)
{
- pJoint = iter->second;
+ pJoint = mSkeleton[joint_num];
+ }
+ else if (joint_num < mNumBones + mNumCollisionVolumes)
+ {
+ S32 collision_id = joint_num - mNumBones;
+ pJoint = &mCollisionVolumes[collision_id];
+ }
+ else
+ {
+ // Attachment IDs start at 1
+ S32 attachment_id = joint_num - (mNumBones + mNumCollisionVolumes) + 1;
+ attachment_map_t::iterator iter = mAttachmentPoints.find(attachment_id);
+ if (iter != mAttachmentPoints.end())
+ {
+ pJoint = iter->second;
+ }
}
}
- else if (joint_num>=collision_start)
- {
- S32 collision_id = joint_num-collision_start;
- pJoint = &mCollisionVolumes[collision_id];
- }
- else if (joint_num>=0)
- {
- pJoint = mSkeleton[joint_num];
- }
+
llassert(!pJoint || pJoint->getJointNum() == joint_num);
return pJoint;
}
@@ -6445,6 +6485,16 @@ void LLVOAvatar::updateAttachmentOverrides()
#endif
}
+void LLVOAvatar::notifyAttachmentMeshLoaded()
+{
+ if (!isFullyLoaded())
+ {
+ // We just received mesh or skin info
+ // Reset timer to wait for more potential meshes or changes
+ mFullyLoadedTimer.reset();
+ }
+}
+
//-----------------------------------------------------------------------------
// addAttachmentOverridesForObject
//-----------------------------------------------------------------------------
@@ -6535,7 +6585,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
LLJoint* pJoint = getJoint( lookingForJoint );
if (pJoint)
{
- const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();
+ const LLVector3& jointPos = LLVector3(pSkinData->mAlternateBindMatrix[i].getTranslation());
if (pJoint->aboveJointPosThreshold(jointPos))
{
bool override_changed;
@@ -7139,6 +7189,7 @@ void LLVOAvatar::updateGL()
{
if (mMeshTexturesDirty)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR
updateMeshTextures();
mMeshTexturesDirty = FALSE;
}
@@ -7147,10 +7198,9 @@ void LLVOAvatar::updateGL()
//-----------------------------------------------------------------------------
// updateGeometry()
//-----------------------------------------------------------------------------
-static LLTrace::BlockTimerStatHandle FTM_UPDATE_AVATAR("Update Avatar");
BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable)
{
- LL_RECORD_BLOCK_TIME(FTM_UPDATE_AVATAR);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
if (!(gPipeline.hasRenderType(mIsControlAvatar ? LLPipeline::RENDER_TYPE_CONTROL_AV : LLPipeline::RENDER_TYPE_AVATAR)))
{
return TRUE;
@@ -7884,6 +7934,8 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color)
// Do rigged mesh attachments display with this av?
bool LLVOAvatar::shouldRenderRigged() const
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
+
if (getOverallAppearance() == AOA_NORMAL)
{
return true;
@@ -8148,16 +8200,35 @@ void LLVOAvatar::updateRuthTimer(bool loading)
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
{
// We wait a little bit before giving the 'all clear', to let things to
- // settle down (models to snap into place, textures to get first packets)
+ // settle down (models to snap into place, textures to get first packets).
+ // And if viewer isn't aware of some parts yet, this gives them a chance
+ // to arrive.
const F32 LOADED_DELAY = 1.f;
- const F32 FIRST_USE_DELAY = 3.f;
- if (loading)
- mFullyLoadedTimer.reset();
+ if (loading)
+ {
+ mFullyLoadedTimer.reset();
+ }
if (mFirstFullyVisible)
{
- mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY);
+ if (!isSelf() && loading)
+ {
+ // Note that textures can causes 60s delay on thier own
+ // so this delay might end up on top of textures' delay
+ mFirstUseDelaySeconds = llclamp(
+ mFirstAppearanceMessageTimer.getElapsedTimeF32(),
+ FIRST_APPEARANCE_CLOUD_MIN_DELAY,
+ FIRST_APPEARANCE_CLOUD_MAX_DELAY);
+
+ if (shouldImpostor())
+ {
+ // Impostors are less of a priority,
+ // let them stay cloud longer
+ mFirstUseDelaySeconds *= 1.25;
+ }
+ }
+ mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > mFirstUseDelaySeconds);
}
else
{
@@ -8376,6 +8447,7 @@ void LLVOAvatar::updateMeshVisibility()
// virtual
void LLVOAvatar::updateMeshTextures()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR
static S32 update_counter = 0;
mBakedTextureDebugText.clear();
@@ -8916,6 +8988,9 @@ void LLVOAvatar::onFirstTEMessageReceived()
mMeshTexturesDirty = TRUE;
gPipeline.markGLRebuild(this);
+
+ mFirstAppearanceMessageTimer.reset();
+ mFullyLoadedTimer.reset();
}
}
@@ -9447,6 +9522,54 @@ LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te)
}
+const LLVOAvatar::MatrixPaletteCache& LLVOAvatar::updateSkinInfoMatrixPalette(const LLMeshSkinInfo* skin)
+{
+ U64 hash = skin->mHash;
+ MatrixPaletteCache& entry = mMatrixPaletteCache[hash];
+
+ if (entry.mFrame != gFrameCount)
+ {
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
+
+ entry.mFrame = gFrameCount;
+
+ //build matrix palette
+ U32 count = LLSkinningUtil::getMeshJointCount(skin);
+ entry.mMatrixPalette.resize(count);
+ LLSkinningUtil::initSkinningMatrixPalette(&(entry.mMatrixPalette[0]), count, skin, this);
+
+ const LLMatrix4a* mat = &(entry.mMatrixPalette[0]);
+
+ entry.mGLMp.resize(count * 12);
+
+ F32* mp = &(entry.mGLMp[0]);
+
+ for (U32 i = 0; i < count; ++i)
+ {
+ F32* m = (F32*)mat[i].mMatrix[0].getF32ptr();
+
+ U32 idx = i * 12;
+
+ mp[idx + 0] = m[0];
+ mp[idx + 1] = m[1];
+ mp[idx + 2] = m[2];
+ mp[idx + 3] = m[12];
+
+ mp[idx + 4] = m[4];
+ mp[idx + 5] = m[5];
+ mp[idx + 6] = m[6];
+ mp[idx + 7] = m[13];
+
+ mp[idx + 8] = m[8];
+ mp[idx + 9] = m[9];
+ mp[idx + 10] = m[10];
+ mp[idx + 11] = m[14];
+ }
+ }
+
+ return entry;
+}
+
// static
void LLVOAvatar::getAnimLabels( std::vector<std::string>* labels )
{
@@ -10210,6 +10333,7 @@ void showRigInfoTabExtents(LLVOAvatar *avatar, LLJointRiggingInfoTab& tab, S32&
void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
for ( LLVOAvatar::attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter )
{
LLViewerJointAttachment* attachment = iter->second;
@@ -10267,27 +10391,19 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
}
}
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_RIGGING_INFO_UPDATE("Av Upd Rig Info");
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_RIGGING_KEY_UPDATE("Av Upd Rig Key");
-static LLTrace::BlockTimerStatHandle FTM_AVATAR_RIGGING_AVOL_UPDATE("Av Upd Avol");
-
// virtual
void LLVOAvatar::updateRiggingInfo()
{
- LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_INFO_UPDATE);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL;
std::vector<LLVOVolume*> volumes;
- {
- LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_AVOL_UPDATE);
- getAssociatedVolumes(volumes);
- }
+ getAssociatedVolumes(volumes);
std::map<LLUUID,S32> curr_rigging_info_key;
{
- LL_RECORD_BLOCK_TIME(FTM_AVATAR_RIGGING_KEY_UPDATE);
// Get current rigging info key
for (std::vector<LLVOVolume*>::iterator it = volumes.begin(); it != volumes.end(); ++it)
{
@@ -10449,6 +10565,7 @@ void LLVOAvatar::updateImpostorRendering(U32 newMaxNonImpostorsValue)
void LLVOAvatar::idleUpdateRenderComplexity()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
if (isControlAvatar())
{
LLControlAvatar *cav = dynamic_cast<LLControlAvatar*>(this);
@@ -10976,6 +11093,7 @@ void LLVOAvatar::updateOverallAppearanceAnimations()
// Based on isVisuallyMuted(), but has 3 possible results.
LLVOAvatar::AvatarOverallAppearance LLVOAvatar::getOverallAppearance() const
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
AvatarOverallAppearance result = AOA_NORMAL;
// Priority order (highest priority first)