summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-09-29 11:09:15 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-09-29 11:09:15 +0100
commit7868ba0c60ff762f56180121fd117e350767934e (patch)
treef5f5148d9c85a79c5be4e962fad77b4986da57a5 /indra/newview
parent04e1962d48e36f9055f0d893fc1b7a97d9e334c6 (diff)
parent675514bdb372c25b50dd2c42b06633895c86b8ce (diff)
Merge branch 'DRTVWR-546' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-546
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml15
-rw-r--r--indra/newview/llappviewer.cpp123
-rw-r--r--indra/newview/llappviewer.h7
-rw-r--r--indra/newview/llappviewerwin32.cpp4
-rw-r--r--indra/newview/llcontrolavatar.cpp2
-rw-r--r--indra/newview/lldrawable.cpp45
-rw-r--r--indra/newview/lldrawpoolavatar.cpp700
-rw-r--r--indra/newview/lldrawpoolavatar.h30
-rw-r--r--indra/newview/llexperiencelog.cpp4
-rw-r--r--indra/newview/llface.cpp19
-rw-r--r--indra/newview/llfloatermodelpreview.cpp88
-rw-r--r--indra/newview/llhudnametag.cpp2
-rw-r--r--indra/newview/llmeshrepository.cpp40
-rw-r--r--indra/newview/llmeshrepository.h3
-rw-r--r--indra/newview/llmodelpreview.cpp9
-rw-r--r--indra/newview/llskinningutil.cpp62
-rw-r--r--indra/newview/llskinningutil.h4
-rw-r--r--indra/newview/llspatialpartition.cpp25
-rw-r--r--indra/newview/llsurface.cpp1
-rw-r--r--indra/newview/llsurfacepatch.cpp1
-rw-r--r--indra/newview/llviewerdisplay.cpp11
-rw-r--r--indra/newview/llviewerobjectlist.cpp16
-rw-r--r--indra/newview/llviewerparceloverlay.cpp1
-rw-r--r--indra/newview/llviewertexture.cpp1
-rw-r--r--indra/newview/llviewertexturelist.cpp1
-rw-r--r--indra/newview/llviewerwindow.cpp1
-rw-r--r--indra/newview/llvlcomposition.cpp1
-rw-r--r--indra/newview/llvoavatar.cpp47
-rw-r--r--indra/newview/llvoavatar.h5
-rw-r--r--indra/newview/llvosurfacepatch.cpp1
-rw-r--r--indra/newview/llvovolume.cpp5
-rw-r--r--indra/newview/llworld.cpp1
-rw-r--r--indra/newview/pipeline.cpp3
33 files changed, 802 insertions, 476 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index b1120c18b2..05c3fc3bfe 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -812,17 +812,6 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>FramePerSecondLimit</key>
- <map>
- <key>Comment</key>
- <string>Controls upper limit of frames per second</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>U32</string>
- <key>Value</key>
- <integer>120</integer>
- </map>
<key>BackgroundYieldTime</key>
<map>
<key>Comment</key>
@@ -3366,13 +3355,13 @@
<key>DisableVerticalSync</key>
<map>
<key>Comment</key>
- <string>Update frames as fast as possible (FALSE = update frames between display scans)</string>
+ <string>Update frames as fast as possible (FALSE = update frames between display scans). Requires restart.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>1</integer>
+ <integer>0</integer>
</map>
<key>EnableGroupChatPopups</key>
<map>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 94f0b31ecd..3d49a9eb78 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -694,8 +694,7 @@ LLAppViewer::LLAppViewer()
mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)),
mFastTimerLogThread(NULL),
mSettingsLocationList(NULL),
- mIsFirstRun(false),
- mMinMicroSecPerFrame(0.f)
+ mIsFirstRun(false)
{
if(NULL != sInstance)
{
@@ -1326,10 +1325,6 @@ bool LLAppViewer::init()
joystick = LLViewerJoystick::getInstance();
joystick->setNeedsReset(true);
/*----------------------------------------------------------------------*/
-
- gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2));
- onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit"));
-
// Load User's bindings
loadKeyBindings();
@@ -1358,7 +1353,8 @@ void LLAppViewer::initMaxHeapSize()
}
static LLTrace::BlockTimerStatHandle FTM_MESSAGES("System Messages");
-static LLTrace::BlockTimerStatHandle FTM_SLEEP("Sleep");
+static LLTrace::BlockTimerStatHandle FTM_SLEEP1("Sleep1");
+static LLTrace::BlockTimerStatHandle FTM_SLEEP2("Sleep2");
static LLTrace::BlockTimerStatHandle FTM_YIELD("Yield");
static LLTrace::BlockTimerStatHandle FTM_TEXTURE_CACHE("Texture Cache");
@@ -1420,13 +1416,17 @@ bool LLAppViewer::frame()
bool LLAppViewer::doFrame()
{
+ LL_RECORD_BLOCK_TIME(FTM_FRAME);
+
LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop"));
LLSD newFrame;
- LL_RECORD_BLOCK_TIME(FTM_FRAME);
- LLTrace::BlockTimer::processTimes();
- LLTrace::get_frame_recording().nextPeriod();
- LLTrace::BlockTimer::logStats();
+ {
+ LL_PROFILE_ZONE_NAMED( "df blocktimer" )
+ LLTrace::BlockTimer::processTimes();
+ LLTrace::get_frame_recording().nextPeriod();
+ LLTrace::BlockTimer::logStats();
+ }
LLTrace::get_thread_recorder()->pullFromChildren();
@@ -1434,6 +1434,7 @@ bool LLAppViewer::doFrame()
LL_CLEAR_CALLSTACKS();
{
+ LL_PROFILE_ZONE_NAMED( "df processMiscNativeEvents" )
pingMainloopTimeout("Main:MiscNativeWindowEvents");
if (gViewerWindow)
@@ -1442,7 +1443,10 @@ bool LLAppViewer::doFrame()
gViewerWindow->getWindow()->processMiscNativeEvents();
}
- pingMainloopTimeout("Main:GatherInput");
+ {
+ LL_PROFILE_ZONE_NAMED( "df gatherInput" )
+ pingMainloopTimeout("Main:GatherInput");
+ }
if (gViewerWindow)
{
@@ -1466,13 +1470,21 @@ bool LLAppViewer::doFrame()
}
}
- // canonical per-frame event
- mainloop.post(newFrame);
- // give listeners a chance to run
- llcoro::suspend();
+ {
+ LL_PROFILE_ZONE_NAMED( "df mainloop" )
+ // canonical per-frame event
+ mainloop.post(newFrame);
+ }
+
+ {
+ LL_PROFILE_ZONE_NAMED( "df suspend" )
+ // give listeners a chance to run
+ llcoro::suspend();
+ }
if (!LLApp::isExiting())
{
+ LL_PROFILE_ZONE_NAMED( "df JoystickKeyboard" )
pingMainloopTimeout("Main:JoystickKeyboard");
// Scan keyboard for movement keys. Command keys and typing
@@ -1493,12 +1505,18 @@ bool LLAppViewer::doFrame()
// Update state based on messages, user input, object idle.
{
- pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds!
+ {
+ LL_PROFILE_ZONE_NAMED( "df pauseMainloopTimeout" )
+ pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds!
+ }
LL_RECORD_BLOCK_TIME(FTM_IDLE);
idle();
- resumeMainloopTimeout();
+ {
+ LL_PROFILE_ZONE_NAMED( "df resumeMainloopTimeout" )
+ resumeMainloopTimeout();
+ }
}
if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED))
@@ -1513,46 +1531,40 @@ bool LLAppViewer::doFrame()
// *TODO: Should we run display() even during gHeadlessClient? DK 2011-02-18
if (!LLApp::isExiting() && !gHeadlessClient && gViewerWindow)
{
+ LL_PROFILE_ZONE_NAMED( "df Display" )
pingMainloopTimeout("Main:Display");
gGLActive = TRUE;
display();
- static U64 last_call = 0;
- if (!gTeleportDisplay)
{
- // Frame/draw throttling, controlled by FramePerSecondLimit
- U64 elapsed_time = LLTimer::getTotalTime() - last_call;
- if (elapsed_time < mMinMicroSecPerFrame)
- {
- LL_RECORD_BLOCK_TIME(FTM_SLEEP);
- // llclamp for when time function gets funky
- U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6);
- micro_sleep(sleep_time, 0);
- }
- }
- last_call = LLTimer::getTotalTime();
-
- pingMainloopTimeout("Main:Snapshot");
- LLFloaterSnapshot::update(); // take snapshots
+ LL_PROFILE_ZONE_NAMED( "df Snapshot" )
+ pingMainloopTimeout("Main:Snapshot");
+ LLFloaterSnapshot::update(); // take snapshots
LLFloaterOutfitSnapshot::update();
- gGLActive = FALSE;
+ gGLActive = FALSE;
+ }
}
}
- pingMainloopTimeout("Main:Sleep");
+ {
+ LL_PROFILE_ZONE_NAMED( "df pauseMainloopTimeout" )
+ pingMainloopTimeout("Main:Sleep");
- pauseMainloopTimeout();
+ pauseMainloopTimeout();
+ }
// Sleep and run background threads
{
- LL_RECORD_BLOCK_TIME(FTM_SLEEP);
+ //LL_RECORD_BLOCK_TIME(SLEEP2);
+ LL_PROFILE_ZONE_WARN( "Sleep2" )
// yield some time to the os based on command line option
static LLCachedControl<S32> yield_time(gSavedSettings, "YieldTime", -1);
if(yield_time >= 0)
{
LL_RECORD_BLOCK_TIME(FTM_YIELD);
+ LL_PROFILE_ZONE_NUM( yield_time )
ms_sleep(yield_time);
}
@@ -1615,16 +1627,22 @@ bool LLAppViewer::doFrame()
total_io_pending += io_pending ;
}
- gMeshRepo.update() ;
+
+ {
+ LL_PROFILE_ZONE_NAMED( "df gMeshRepo" )
+ gMeshRepo.update() ;
+ }
if(!total_work_pending) //pause texture fetching threads if nothing to process.
{
+ LL_PROFILE_ZONE_NAMED( "df getTextureCache" )
LLAppViewer::getTextureCache()->pause();
LLAppViewer::getImageDecodeThread()->pause();
LLAppViewer::getTextureFetch()->pause();
}
if(!total_io_pending) //pause file threads if nothing to process.
{
+ LL_PROFILE_ZONE_NAMED( "df LLVFSThread" )
LLVFSThread::sLocal->pause();
LLLFSThread::sLocal->pause();
}
@@ -1632,6 +1650,7 @@ bool LLAppViewer::doFrame()
//texture fetching debugger
if(LLTextureFetchDebugger::isEnabled())
{
+ LL_PROFILE_ZONE_NAMED( "df tex_fetch_debugger_instance" )
LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance =
LLFloaterReg::findTypedInstance<LLFloaterTextureFetchDebugger>("tex_fetch_debugger");
if(tex_fetch_debugger_instance)
@@ -1640,8 +1659,10 @@ bool LLAppViewer::doFrame()
}
}
- resumeMainloopTimeout();
-
+ {
+ LL_PROFILE_ZONE_NAMED( "df resumeMainloopTimeout" )
+ resumeMainloopTimeout();
+ }
pingMainloopTimeout("Main:End");
}
}
@@ -2480,12 +2501,7 @@ bool LLAppViewer::initConfiguration()
#ifndef LL_RELEASE_FOR_DOWNLOAD
// provide developer build only overrides for these control variables that are not
// persisted to settings.xml
- LLControlVariable* c = gSavedSettings.getControl("ShowConsoleWindow");
- if (c)
- {
- c->setValue(true, false);
- }
- c = gSavedSettings.getControl("AllowMultipleViewers");
+ LLControlVariable* c = gSavedSettings.getControl("AllowMultipleViewers");
if (c)
{
c->setValue(true, false);
@@ -5613,19 +5629,6 @@ void LLAppViewer::disconnectViewer()
LLUrlEntryParcel::setDisconnected(gDisconnected);
}
-bool LLAppViewer::onChangeFrameLimit(LLSD const & evt)
-{
- if (evt.asInteger() > 0)
- {
- mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger()));
- }
- else
- {
- mMinMicroSecPerFrame = 0;
- }
- return false;
-}
-
void LLAppViewer::forceErrorLLError()
{
LL_ERRS() << "This is a deliberate llerror" << LL_ENDL;
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 0afb70958c..64e7caa36b 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -262,8 +262,6 @@ private:
void sendLogoutRequest();
void disconnectViewer();
- bool onChangeFrameLimit(LLSD const & evt);
-
// *FIX: the app viewer class should be some sort of singleton, no?
// Perhaps its child class is the singleton and this should be an abstract base.
static LLAppViewer* sInstance;
@@ -319,10 +317,7 @@ private:
// llcorehttp library init/shutdown helper
LLAppCoreHttp mAppCoreHttp;
- bool mIsFirstRun;
- U64 mMinMicroSecPerFrame; // frame throttling
-
-
+ bool mIsFirstRun;
};
// consts from viewer.h
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 9daea515e5..fb53a7648d 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -323,6 +323,10 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
PWSTR pCmdLine,
int nCmdShow)
{
+ // Call Tracy first thing to have it allocate memory
+ // https://github.com/wolfpld/tracy/issues/196
+ LL_PROFILER_FRAME_END
+
const S32 MAX_HEAPS = 255;
DWORD heap_enable_lfh_error[MAX_HEAPS];
S32 num_heaps = 0;
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index fab249f988..606e670805 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -241,7 +241,7 @@ void LLControlAvatar::matchVolumeTransform()
if (skin_info)
{
LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL;
- bind_rot = LLSkinningUtil::getUnscaledQuaternion(skin_info->mBindShapeMatrix);
+ bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(skin_info->mBindShapeMatrix));
}
#endif
setRotation(bind_rot*obj_rot);
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 507af56cb0..30c4a21e1c 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -101,6 +101,8 @@ LLDrawable::LLDrawable(LLViewerObject *vobj, bool new_entry)
void LLDrawable::init(bool new_entry)
{
+ LL_PROFILE_ZONE_SCOPED
+
// mXform
mParent = NULL;
mRenderType = 0;
@@ -232,6 +234,8 @@ void LLDrawable::markDead()
LLVOVolume* LLDrawable::getVOVolume() const
{
+ LL_PROFILE_ZONE_SCOPED
+
LLViewerObject* objectp = mVObjp;
if ( !isDead() && objectp && (objectp->getPCode() == LL_PCODE_VOLUME))
{
@@ -335,6 +339,7 @@ static LLTrace::BlockTimerStatHandle FTM_ALLOCATE_FACE("Allocate Face");
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
{
+ LL_PROFILE_ZONE_SCOPED
LLFace *face;
{
@@ -363,6 +368,8 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLFace *face;
{
@@ -387,6 +394,8 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLViewerTexture *normalp)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLFace *face;
face = new LLFace(this, mVObjp);
@@ -408,6 +417,8 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep,
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLViewerTexture *normalp, LLViewerTexture *specularp)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLFace *face;
face = new LLFace(this, mVObjp);
@@ -430,6 +441,8 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep,
void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (newFaces == (S32)mFaces.size())
{
return;
@@ -453,6 +466,8 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText
void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2)
{
return;
@@ -476,6 +491,8 @@ void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewer
void LLDrawable::mergeFaces(LLDrawable* src)
{
+ LL_PROFILE_ZONE_SCOPED
+
U32 face_count = mFaces.size() + src->mFaces.size();
mFaces.reserve(face_count);
@@ -509,6 +526,8 @@ void LLDrawable::updateMaterial()
void LLDrawable::makeActive()
{
+ LL_PROFILE_ZONE_SCOPED
+
#if !LL_RELEASE_FOR_DOWNLOAD
if (mVObjp.notNull())
{
@@ -572,6 +591,8 @@ void LLDrawable::makeActive()
void LLDrawable::makeStatic(BOOL warning_enabled)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (isState(ACTIVE) &&
!isState(ACTIVE_CHILD) &&
!mVObjp->isAttachment() &&
@@ -618,6 +639,8 @@ void LLDrawable::makeStatic(BOOL warning_enabled)
// Returns "distance" between target destination and resulting xfrom
F32 LLDrawable::updateXform(BOOL undamped)
{
+ LL_PROFILE_ZONE_SCOPED
+
BOOL damped = !undamped;
// Position
@@ -769,6 +792,8 @@ void LLDrawable::moveUpdatePipeline(BOOL moved)
void LLDrawable::movePartition()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLSpatialPartition* part = getSpatialPartition();
if (part)
{
@@ -813,6 +838,8 @@ BOOL LLDrawable::updateMoveUndamped()
void LLDrawable::updatePartition()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!getVOVolume())
{
movePartition();
@@ -830,6 +857,8 @@ void LLDrawable::updatePartition()
BOOL LLDrawable::updateMoveDamped()
{
+ LL_PROFILE_ZONE_SCOPED
+
F32 dist_squared = updateXform(FALSE);
mGeneration++;
@@ -853,6 +882,8 @@ BOOL LLDrawable::updateMoveDamped()
void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
{
LL_WARNS() << "Attempted to update distance for non-world camera." << LL_ENDL;
@@ -957,6 +988,8 @@ void LLDrawable::updateTexture()
BOOL LLDrawable::updateGeometry(BOOL priority)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert(mVObjp.notNull());
BOOL res = mVObjp->updateGeometry(this);
return res;
@@ -1034,6 +1067,8 @@ const LLVector3& LLDrawable::getBounds(LLVector3& min, LLVector3& max) const
void LLDrawable::updateSpatialExtents()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (mVObjp)
{
const LLVector4a* exts = getSpatialExtents();
@@ -1164,6 +1199,8 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp)
LLSpatialPartition* LLDrawable::getSpatialPartition()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLSpatialPartition* retval = NULL;
if (!mVObjp ||
@@ -1247,6 +1284,8 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat
LLDrawable(root->getVObj(), true),
LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB, regionp)
{
+ LL_PROFILE_ZONE_SCOPED
+
mBridge = this;
mDrawable = root;
root->setSpatialBridge(this);
@@ -1292,6 +1331,8 @@ void LLSpatialBridge::destroyTree()
void LLSpatialBridge::updateSpatialExtents()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0);
{
@@ -1455,6 +1496,8 @@ public:
void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, BOOL for_select)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!gPipeline.hasRenderType(mDrawableType))
{
return;
@@ -1552,6 +1595,8 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (mDrawable == NULL)
{
markDead();
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 687b13d2c8..02ab316256 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -121,6 +121,8 @@ LLDrawPoolAvatar::~LLDrawPoolAvatar()
// virtual
BOOL LLDrawPoolAvatar::isDead()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!LLFacePool::isDead())
{
return FALSE;
@@ -138,11 +140,15 @@ BOOL LLDrawPoolAvatar::isDead()
S32 LLDrawPoolAvatar::getShaderLevel() const
{
+ LL_PROFILE_ZONE_SCOPED
+
return (S32) LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR);
}
void LLDrawPoolAvatar::prerender()
{
+ LL_PROFILE_ZONE_SCOPED
+
mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR);
sShaderLevel = mShaderLevel;
@@ -163,12 +169,15 @@ void LLDrawPoolAvatar::prerender()
{
LLVOAvatar* avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
updateRiggedVertexBuffers(avatarp);
+ updateSkinInfoMatrixPalettes(avatarp);
}
}
}
LLMatrix4& LLDrawPoolAvatar::getModelView()
{
+ LL_PROFILE_ZONE_SCOPED
+
static LLMatrix4 ret;
ret.initRows(LLVector4(gGLModelView+0),
@@ -257,6 +266,8 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass)
void LLDrawPoolAvatar::renderDeferred(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
render(pass);
}
@@ -267,6 +278,8 @@ S32 LLDrawPoolAvatar::getNumPostDeferredPasses()
void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
switch (pass)
{
case 0:
@@ -295,6 +308,8 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
void LLDrawPoolAvatar::beginPostDeferredAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
sSkipOpaque = TRUE;
sShaderLevel = mShaderLevel;
sVertexProgram = &gDeferredAvatarAlphaProgram;
@@ -309,6 +324,8 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha()
void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredSkinnedAlphaProgram;
gPipeline.bindDeferredShader(*sVertexProgram);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -317,6 +334,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
void LLDrawPoolAvatar::beginDeferredRiggedMaterialAlpha(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
switch (pass)
{
case 0: pass = 1; break;
@@ -343,6 +362,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterialAlpha(S32 pass)
void LLDrawPoolAvatar::endDeferredRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
gPipeline.unbindDeferredShader(*sVertexProgram);
sDiffuseChannel = 0;
@@ -353,6 +374,8 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha()
void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
switch (pass)
{
case 0:
@@ -381,6 +404,8 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
void LLDrawPoolAvatar::endPostDeferredAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
sRenderingSkinned = FALSE;
sSkipOpaque = FALSE;
@@ -392,6 +417,8 @@ void LLDrawPoolAvatar::endPostDeferredAlpha()
void LLDrawPoolAvatar::renderPostDeferred(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
static const S32 actual_pass[] =
{ //map post deferred pass numbers to what render() expects
2, //skinned
@@ -428,225 +455,235 @@ S32 LLDrawPoolAvatar::getNumShadowPasses()
void LLDrawPoolAvatar::beginShadowPass(S32 pass)
{
LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
+ {
+ LL_PROFILE_ZONE_SCOPED;
- if (pass == SHADOW_PASS_AVATAR_OPAQUE)
- {
- sVertexProgram = &gDeferredAvatarShadowProgram;
-
- if ((sShaderLevel > 0)) // for hardware blending
- {
- sRenderingSkinned = TRUE;
- sVertexProgram->bind();
- }
+ if (pass == SHADOW_PASS_AVATAR_OPAQUE)
+ {
+ sVertexProgram = &gDeferredAvatarShadowProgram;
- gGL.diffuseColor4f(1,1,1,1);
- }
- else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND)
- {
- sVertexProgram = &gDeferredAvatarAlphaShadowProgram;
+ if ((sShaderLevel > 0)) // for hardware blending
+ {
+ sRenderingSkinned = TRUE;
+ sVertexProgram->bind();
+ }
- // bind diffuse tex so we can reference the alpha channel...
- S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
- sDiffuseChannel = 0;
- if (loc != -1)
+ gGL.diffuseColor4f(1, 1, 1, 1);
+ }
+ else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND)
{
- sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
- }
+ sVertexProgram = &gDeferredAvatarAlphaShadowProgram;
- if ((sShaderLevel > 0)) // for hardware blending
- {
- sRenderingSkinned = TRUE;
- sVertexProgram->bind();
- }
+ // bind diffuse tex so we can reference the alpha channel...
+ S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
+ sDiffuseChannel = 0;
+ if (loc != -1)
+ {
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+ }
- gGL.diffuseColor4f(1,1,1,1);
- }
- else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK)
- {
- sVertexProgram = &gDeferredAvatarAlphaMaskShadowProgram;
+ if ((sShaderLevel > 0)) // for hardware blending
+ {
+ sRenderingSkinned = TRUE;
+ sVertexProgram->bind();
+ }
- // bind diffuse tex so we can reference the alpha channel...
- S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
- sDiffuseChannel = 0;
- if (loc != -1)
+ gGL.diffuseColor4f(1, 1, 1, 1);
+ }
+ else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK)
{
- sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
- }
+ sVertexProgram = &gDeferredAvatarAlphaMaskShadowProgram;
- if ((sShaderLevel > 0)) // for hardware blending
- {
- sRenderingSkinned = TRUE;
- sVertexProgram->bind();
- }
+ // bind diffuse tex so we can reference the alpha channel...
+ S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
+ sDiffuseChannel = 0;
+ if (loc != -1)
+ {
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+ }
- gGL.diffuseColor4f(1,1,1,1);
- }
- else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND)
- {
- sVertexProgram = &gDeferredAttachmentAlphaShadowProgram;
+ if ((sShaderLevel > 0)) // for hardware blending
+ {
+ sRenderingSkinned = TRUE;
+ sVertexProgram->bind();
+ }
- // bind diffuse tex so we can reference the alpha channel...
- S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
- sDiffuseChannel = 0;
- if (loc != -1)
+ gGL.diffuseColor4f(1, 1, 1, 1);
+ }
+ else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND)
{
- sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
- }
-
- if ((sShaderLevel > 0)) // for hardware blending
- {
- sRenderingSkinned = TRUE;
- sVertexProgram->bind();
- }
+ sVertexProgram = &gDeferredAttachmentAlphaShadowProgram;
- gGL.diffuseColor4f(1,1,1,1);
- }
- else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK)
- {
- sVertexProgram = &gDeferredAttachmentAlphaMaskShadowProgram;
+ // bind diffuse tex so we can reference the alpha channel...
+ S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
+ sDiffuseChannel = 0;
+ if (loc != -1)
+ {
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+ }
+
+ if ((sShaderLevel > 0)) // for hardware blending
+ {
+ sRenderingSkinned = TRUE;
+ sVertexProgram->bind();
+ }
- // bind diffuse tex so we can reference the alpha channel...
- S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
- sDiffuseChannel = 0;
- if (loc != -1)
+ gGL.diffuseColor4f(1, 1, 1, 1);
+ }
+ else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK)
{
- sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
- }
+ sVertexProgram = &gDeferredAttachmentAlphaMaskShadowProgram;
- if ((sShaderLevel > 0)) // for hardware blending
- {
- sRenderingSkinned = TRUE;
- sVertexProgram->bind();
- }
+ // bind diffuse tex so we can reference the alpha channel...
+ S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
+ sDiffuseChannel = 0;
+ if (loc != -1)
+ {
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+ }
- gGL.diffuseColor4f(1,1,1,1);
- }
- else // SHADOW_PASS_ATTACHMENT_OPAQUE
- {
- sVertexProgram = &gDeferredAttachmentShadowProgram;
- S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
- sDiffuseChannel = 0;
- if (loc != -1)
+ if ((sShaderLevel > 0)) // for hardware blending
+ {
+ sRenderingSkinned = TRUE;
+ sVertexProgram->bind();
+ }
+
+ gGL.diffuseColor4f(1, 1, 1, 1);
+ }
+ else // SHADOW_PASS_ATTACHMENT_OPAQUE
{
- sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
- }
- sVertexProgram->bind();
- }
+ sVertexProgram = &gDeferredAttachmentShadowProgram;
+ S32 loc = sVertexProgram->getUniformLocation(LLViewerShaderMgr::DIFFUSE_MAP);
+ sDiffuseChannel = 0;
+ if (loc != -1)
+ {
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+ }
+ sVertexProgram->bind();
+ }
+ }
}
void LLDrawPoolAvatar::endShadowPass(S32 pass)
{
LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
+ {
+ LL_PROFILE_ZONE_SCOPED;
- if (pass == SHADOW_PASS_ATTACHMENT_OPAQUE)
- {
- LLVertexBuffer::unbind();
- }
+ if (pass == SHADOW_PASS_ATTACHMENT_OPAQUE)
+ {
+ LLVertexBuffer::unbind();
+ }
- if (sShaderLevel > 0)
- {
- sVertexProgram->unbind();
- }
- sVertexProgram = NULL;
- sRenderingSkinned = FALSE;
- LLDrawPoolAvatar::sShadowPass = -1;
+ if (sShaderLevel > 0)
+ {
+ sVertexProgram->unbind();
+ }
+ sVertexProgram = NULL;
+ sRenderingSkinned = FALSE;
+ LLDrawPoolAvatar::sShadowPass = -1;
+ }
}
void LLDrawPoolAvatar::renderShadow(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
+ {
+ LL_PROFILE_ZONE_SCOPED;
- if (mDrawFace.empty())
- {
- return;
- }
+ if (mDrawFace.empty())
+ {
+ return;
+ }
- const LLFace *facep = mDrawFace[0];
- if (!facep->getDrawable())
- {
- return;
- }
- LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
+ const LLFace *facep = mDrawFace[0];
+ if (!facep->getDrawable())
+ {
+ return;
+ }
+ LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
- if (avatarp->isDead() || avatarp->isUIAvatar() || avatarp->mDrawable.isNull())
- {
- return;
- }
- LLVOAvatar::AvatarOverallAppearance oa = avatarp->getOverallAppearance();
- BOOL impostor = !LLPipeline::sImpostorRender && avatarp->isImpostor();
- if (oa == LLVOAvatar::AOA_INVISIBLE ||
- (impostor && oa == LLVOAvatar::AOA_JELLYDOLL))
- {
- // No shadows for jellydolled or invisible avs.
- return;
- }
-
- LLDrawPoolAvatar::sShadowPass = pass;
+ if (avatarp->isDead() || avatarp->isUIAvatar() || avatarp->mDrawable.isNull())
+ {
+ return;
+ }
+ LLVOAvatar::AvatarOverallAppearance oa = avatarp->getOverallAppearance();
+ BOOL impostor = !LLPipeline::sImpostorRender && avatarp->isImpostor();
+ if (impostor || (oa == LLVOAvatar::AOA_INVISIBLE))
+ {
+ // No shadows for impostored (including jellydolled) or invisible avs.
+ return;
+ }
- if (pass == SHADOW_PASS_AVATAR_OPAQUE)
- {
- LLDrawPoolAvatar::sSkipTransparent = true;
- avatarp->renderSkinned();
- LLDrawPoolAvatar::sSkipTransparent = false;
- }
- else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND)
- {
- LLDrawPoolAvatar::sSkipOpaque = true;
- avatarp->renderSkinned();
- LLDrawPoolAvatar::sSkipOpaque = false;
- }
- else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK)
- {
- LLDrawPoolAvatar::sSkipOpaque = true;
- avatarp->renderSkinned();
- LLDrawPoolAvatar::sSkipOpaque = false;
- }
- else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND) // rigged alpha
- {
- LLDrawPoolAvatar::sSkipOpaque = true;
- renderRigged(avatarp, RIGGED_MATERIAL_ALPHA);
- renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE);
- renderRigged(avatarp, RIGGED_ALPHA);
- renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA);
- renderRigged(avatarp, RIGGED_GLOW);
- renderRigged(avatarp, RIGGED_SPECMAP_BLEND);
- renderRigged(avatarp, RIGGED_NORMMAP_BLEND);
- renderRigged(avatarp, RIGGED_NORMSPEC_BLEND);
- LLDrawPoolAvatar::sSkipOpaque = false;
- }
- else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) // rigged alpha mask
- {
- LLDrawPoolAvatar::sSkipOpaque = true;
- renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_MASK);
- renderRigged(avatarp, RIGGED_NORMMAP_MASK);
- renderRigged(avatarp, RIGGED_SPECMAP_MASK);
- renderRigged(avatarp, RIGGED_NORMSPEC_MASK);
- renderRigged(avatarp, RIGGED_GLOW);
- LLDrawPoolAvatar::sSkipOpaque = false;
- }
- else // rigged opaque (SHADOW_PASS_ATTACHMENT_OPAQUE
- {
- LLDrawPoolAvatar::sSkipTransparent = true;
- renderRigged(avatarp, RIGGED_MATERIAL);
- renderRigged(avatarp, RIGGED_SPECMAP);
- renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE);
- renderRigged(avatarp, RIGGED_NORMMAP);
- renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE);
- renderRigged(avatarp, RIGGED_NORMSPEC);
- renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE);
- renderRigged(avatarp, RIGGED_SIMPLE);
- renderRigged(avatarp, RIGGED_FULLBRIGHT);
- renderRigged(avatarp, RIGGED_SHINY);
- renderRigged(avatarp, RIGGED_FULLBRIGHT_SHINY);
- renderRigged(avatarp, RIGGED_GLOW);
- renderRigged(avatarp, RIGGED_DEFERRED_BUMP);
- renderRigged(avatarp, RIGGED_DEFERRED_SIMPLE);
- LLDrawPoolAvatar::sSkipTransparent = false;
- }
+ LLDrawPoolAvatar::sShadowPass = pass;
+
+ if (pass == SHADOW_PASS_AVATAR_OPAQUE)
+ {
+ LLDrawPoolAvatar::sSkipTransparent = true;
+ avatarp->renderSkinned();
+ LLDrawPoolAvatar::sSkipTransparent = false;
+ }
+ else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND)
+ {
+ LLDrawPoolAvatar::sSkipOpaque = true;
+ avatarp->renderSkinned();
+ LLDrawPoolAvatar::sSkipOpaque = false;
+ }
+ else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK)
+ {
+ LLDrawPoolAvatar::sSkipOpaque = true;
+ avatarp->renderSkinned();
+ LLDrawPoolAvatar::sSkipOpaque = false;
+ }
+ else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND) // rigged alpha
+ {
+ LLDrawPoolAvatar::sSkipOpaque = true;
+ renderRigged(avatarp, RIGGED_MATERIAL_ALPHA);
+ renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE);
+ renderRigged(avatarp, RIGGED_ALPHA);
+ renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA);
+ renderRigged(avatarp, RIGGED_GLOW);
+ renderRigged(avatarp, RIGGED_SPECMAP_BLEND);
+ renderRigged(avatarp, RIGGED_NORMMAP_BLEND);
+ renderRigged(avatarp, RIGGED_NORMSPEC_BLEND);
+ LLDrawPoolAvatar::sSkipOpaque = false;
+ }
+ else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) // rigged alpha mask
+ {
+ LLDrawPoolAvatar::sSkipOpaque = true;
+ renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_MASK);
+ renderRigged(avatarp, RIGGED_NORMMAP_MASK);
+ renderRigged(avatarp, RIGGED_SPECMAP_MASK);
+ renderRigged(avatarp, RIGGED_NORMSPEC_MASK);
+ renderRigged(avatarp, RIGGED_GLOW);
+ LLDrawPoolAvatar::sSkipOpaque = false;
+ }
+ else // rigged opaque (SHADOW_PASS_ATTACHMENT_OPAQUE
+ {
+ LLDrawPoolAvatar::sSkipTransparent = true;
+ renderRigged(avatarp, RIGGED_MATERIAL);
+ renderRigged(avatarp, RIGGED_SPECMAP);
+ renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE);
+ renderRigged(avatarp, RIGGED_NORMMAP);
+ renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE);
+ renderRigged(avatarp, RIGGED_NORMSPEC);
+ renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE);
+ renderRigged(avatarp, RIGGED_SIMPLE);
+ renderRigged(avatarp, RIGGED_FULLBRIGHT);
+ renderRigged(avatarp, RIGGED_SHINY);
+ renderRigged(avatarp, RIGGED_FULLBRIGHT_SHINY);
+ renderRigged(avatarp, RIGGED_GLOW);
+ renderRigged(avatarp, RIGGED_DEFERRED_BUMP);
+ renderRigged(avatarp, RIGGED_DEFERRED_SIMPLE);
+ LLDrawPoolAvatar::sSkipTransparent = false;
+ }
+ }
}
S32 LLDrawPoolAvatar::getNumPasses()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLPipeline::sImpostorRender)
{
return 8;
@@ -660,6 +697,8 @@ S32 LLDrawPoolAvatar::getNumPasses()
S32 LLDrawPoolAvatar::getNumDeferredPasses()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLPipeline::sImpostorRender)
{
return 19;
@@ -780,6 +819,8 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass)
void LLDrawPoolAvatar::beginImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!LLPipeline::sReflectionRender)
{
LLVOAvatar::sRenderDistance = llclamp(LLVOAvatar::sRenderDistance, 16.f, 256.f);
@@ -798,6 +839,8 @@ void LLDrawPoolAvatar::beginImpostor()
void LLDrawPoolAvatar::endImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLGLSLShader::sNoFixedFunction)
{
gImpostorProgram.unbind();
@@ -807,6 +850,8 @@ void LLDrawPoolAvatar::endImpostor()
void LLDrawPoolAvatar::beginRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (gPipeline.canUseVertexShaders())
{
if (LLPipeline::sUnderWaterRender)
@@ -840,6 +885,8 @@ void LLDrawPoolAvatar::beginRigid()
void LLDrawPoolAvatar::endRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
if (sVertexProgram != NULL)
{
@@ -849,6 +896,8 @@ void LLDrawPoolAvatar::endRigid()
void LLDrawPoolAvatar::beginDeferredImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!LLPipeline::sReflectionRender)
{
LLVOAvatar::sRenderDistance = llclamp(LLVOAvatar::sRenderDistance, 16.f, 256.f);
@@ -865,6 +914,8 @@ void LLDrawPoolAvatar::beginDeferredImpostor()
void LLDrawPoolAvatar::endDeferredImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL);
sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP);
@@ -876,6 +927,8 @@ void LLDrawPoolAvatar::endDeferredImpostor()
void LLDrawPoolAvatar::beginDeferredRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
sVertexProgram->bind();
@@ -892,6 +945,8 @@ void LLDrawPoolAvatar::beginDeferredRigid()
void LLDrawPoolAvatar::endDeferredRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
sVertexProgram->unbind();
@@ -901,6 +956,8 @@ void LLDrawPoolAvatar::endDeferredRigid()
void LLDrawPoolAvatar::beginSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -967,6 +1024,8 @@ void LLDrawPoolAvatar::beginSkinned()
void LLDrawPoolAvatar::endSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
if (sShaderLevel > 0)
{
@@ -991,6 +1050,8 @@ void LLDrawPoolAvatar::endSkinned()
void LLDrawPoolAvatar::beginRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1031,6 +1092,8 @@ void LLDrawPoolAvatar::beginRiggedSimple()
void LLDrawPoolAvatar::endRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1041,27 +1104,37 @@ void LLDrawPoolAvatar::endRiggedSimple()
void LLDrawPoolAvatar::beginRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
beginRiggedSimple();
}
void LLDrawPoolAvatar::endRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
endRiggedSimple();
}
void LLDrawPoolAvatar::beginRiggedFullbrightAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
beginRiggedFullbright();
}
void LLDrawPoolAvatar::endRiggedFullbrightAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
endRiggedFullbright();
}
void LLDrawPoolAvatar::beginRiggedGlow()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1108,11 +1181,15 @@ void LLDrawPoolAvatar::beginRiggedGlow()
void LLDrawPoolAvatar::endRiggedGlow()
{
+ LL_PROFILE_ZONE_SCOPED
+
endRiggedFullbright();
}
void LLDrawPoolAvatar::beginRiggedFullbright()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1170,6 +1247,8 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
void LLDrawPoolAvatar::endRiggedFullbright()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1180,6 +1259,8 @@ void LLDrawPoolAvatar::endRiggedFullbright()
void LLDrawPoolAvatar::beginRiggedShinySimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1220,6 +1301,8 @@ void LLDrawPoolAvatar::beginRiggedShinySimple()
void LLDrawPoolAvatar::endRiggedShinySimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1231,6 +1314,8 @@ void LLDrawPoolAvatar::endRiggedShinySimple()
void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1296,6 +1381,8 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
void LLDrawPoolAvatar::endRiggedFullbrightShiny()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1308,6 +1395,8 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny()
void LLDrawPoolAvatar::beginDeferredRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredSkinnedDiffuseProgram;
sDiffuseChannel = 0;
sVertexProgram->bind();
@@ -1323,6 +1412,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedSimple()
void LLDrawPoolAvatar::endDeferredRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
sVertexProgram->unbind();
sVertexProgram = NULL;
@@ -1330,6 +1421,8 @@ void LLDrawPoolAvatar::endDeferredRiggedSimple()
void LLDrawPoolAvatar::beginDeferredRiggedBump()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredSkinnedBumpProgram;
sVertexProgram->bind();
if (LLPipeline::sRenderingHUDs)
@@ -1346,6 +1439,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedBump()
void LLDrawPoolAvatar::endDeferredRiggedBump()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP);
sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -1357,6 +1452,8 @@ void LLDrawPoolAvatar::endDeferredRiggedBump()
void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (pass == 1 ||
pass == 5 ||
pass == 9 ||
@@ -1387,6 +1484,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass)
void LLDrawPoolAvatar::endDeferredRiggedMaterial(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (pass == 1 ||
pass == 5 ||
pass == 9 ||
@@ -1407,6 +1506,8 @@ void LLDrawPoolAvatar::endDeferredRiggedMaterial(S32 pass)
void LLDrawPoolAvatar::beginDeferredSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
sVertexProgram = &gDeferredAvatarProgram;
sRenderingSkinned = TRUE;
@@ -1428,6 +1529,8 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
void LLDrawPoolAvatar::endDeferredSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
sRenderingSkinned = FALSE;
sVertexProgram->unbind();
@@ -1740,6 +1843,8 @@ void LLDrawPoolAvatar::getRiggedGeometry(
LLVolume* volume,
const LLVolumeFace& vol_face)
{
+ LL_PROFILE_ZONE_SCOPED
+
face->setGeomIndex(0);
face->setIndicesIndex(0);
@@ -1794,7 +1899,7 @@ void LLDrawPoolAvatar::getRiggedGeometry(
U16 offset = 0;
- LLMatrix4 mat_vert = skin->mBindShapeMatrix;
+ LLMatrix4 mat_vert = LLMatrix4(skin->mBindShapeMatrix);
glh::matrix4f m((F32*) mat_vert.mMatrix);
m = m.inverse().transpose();
@@ -1836,24 +1941,26 @@ void LLDrawPoolAvatar::getRiggedGeometry(
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
LLVOAvatar* avatar,
LLFace* face,
- const LLMeshSkinInfo* skin,
+ const LLVOVolume* vobj,
LLVolume* volume,
LLVolumeFace& vol_face)
{
+ LL_PROFILE_ZONE_SCOPED;
+
LLVector4a* weights = vol_face.mWeights;
if (!weights)
{
return;
}
+ if (!vobj || vobj->isNoLOD())
+ {
+ return;
+ }
+
LLPointer<LLVertexBuffer> buffer = face->getVertexBuffer();
LLDrawable* drawable = face->getDrawable();
- if (drawable->getVOVolume() && drawable->getVOVolume()->isNoLOD())
- {
- return;
- }
-
const U32 max_joints = LLSkinningUtil::getMaxJointCount();
#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS
@@ -1893,23 +2000,26 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
}
#endif
- // FIXME ugly const cast
- LLSkinningUtil::scrubInvalidJoints(avatar, const_cast<LLMeshSkinInfo*>(skin));
-
- U32 data_mask = face->getRiggedVertexBufferDataMask();
+ U32 data_mask = face->getRiggedVertexBufferDataMask();
+ const LLMeshSkinInfo* skin = nullptr;
- if (!vol_face.mWeightsScrubbed)
- {
- LLSkinningUtil::scrubSkinWeights(weights, vol_face.mNumVertices, skin);
- vol_face.mWeightsScrubbed = TRUE;
- }
-
if (buffer.isNull() ||
buffer->getTypeMask() != data_mask ||
buffer->getNumVerts() != vol_face.mNumVertices ||
buffer->getNumIndices() != vol_face.mNumIndices ||
(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
{
+ LL_PROFILE_ZONE_NAMED("Rigged VBO Rebuild");
+ skin = vobj->getSkinInfo();
+ // FIXME ugly const cast
+ LLSkinningUtil::scrubInvalidJoints(avatar, const_cast<LLMeshSkinInfo*>(skin));
+
+ if (!vol_face.mWeightsScrubbed)
+ {
+ LLSkinningUtil::scrubSkinWeights(weights, vol_face.mNumVertices, skin);
+ vol_face.mWeightsScrubbed = TRUE;
+ }
+
if (drawable && drawable->isState(LLDrawable::REBUILD_ALL))
{
//rebuild EVERY face in the drawable, not just this one, to avoid missing drawable wide rebuild issues
@@ -1935,18 +2045,13 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
}
}
- if (buffer.isNull() ||
- buffer->getNumVerts() != vol_face.mNumVertices ||
- buffer->getNumIndices() != vol_face.mNumIndices)
- {
- // Allocation failed
- return;
- }
-
- if (!buffer.isNull() &&
- sShaderLevel <= 0 &&
- face->mLastSkinTime < avatar->getLastSkinTime())
+ if (sShaderLevel <= 0 &&
+ face->mLastSkinTime < avatar->getLastSkinTime() &&
+ !buffer.isNull() &&
+ buffer->getNumVerts() == vol_face.mNumVertices &&
+ buffer->getNumIndices() == vol_face.mNumIndices)
{
+ LL_PROFILE_ZONE_NAMED("Software Skinning");
//perform software vertex skinning for this face
LLStrider<LLVector3> position;
LLStrider<LLVector3> normal;
@@ -1963,14 +2068,16 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
LLVector4a* norm = has_normal ? (LLVector4a*) normal.get() : NULL;
- //build matrix palette
- LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
- U32 count = LLSkinningUtil::getMeshJointCount(skin);
- LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count, skin, avatar);
- LLSkinningUtil::checkSkinWeights(weights, buffer->getNumVerts(), skin);
+ if (skin == nullptr)
+ {
+ skin = vobj->getSkinInfo();
+ }
- LLMatrix4a bind_shape_matrix;
- bind_shape_matrix.loadu(skin->mBindShapeMatrix);
+ const MatrixPaletteCache& mpc = updateSkinInfoMatrixPalette(avatar, skin);
+ const LLMatrix4a* mat = &(mpc.mMatrixPalette[0]);
+
+ LLSkinningUtil::checkSkinWeights(weights, buffer->getNumVerts(), skin);
+ const LLMatrix4a& bind_shape_matrix = skin->mBindShapeMatrix;
#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS
U8* joint_indices_cursor = vol_face.mJointIndices;
@@ -2038,6 +2145,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!avatar->shouldRenderRigged())
{
return;
@@ -2045,15 +2154,18 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
stop_glerror();
+ const LLMeshSkinInfo* lastSkin = nullptr;
+
for (U32 i = 0; i < mRiggedFace[type].size(); ++i)
{
+ LL_PROFILE_ZONE_NAMED("Render Rigged Face");
LLFace* face = mRiggedFace[type][i];
S32 offset = face->getIndicesStart();
U32 count = face->getIndicesCount();
U16 start = face->getGeomStart();
- U16 end = start + face->getGeomCount()-1;
+ U16 end = start + face->getGeomCount()-1;
LLDrawable* drawable = face->getDrawable();
if (!drawable)
@@ -2175,52 +2287,32 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
}
if (buff)
- {
+ {
if (sShaderLevel > 0)
{
- // upload matrix palette to shader
- LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
- U32 count = LLSkinningUtil::getMeshJointCount(skin);
- LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count, skin, avatar);
-
- stop_glerror();
-
- F32 mp[LL_MAX_JOINTS_PER_MESH_OBJECT*12];
-
- 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];
+ if (lastSkin != skin) // <== only upload matrix palette to GL if the skininfo changed
+ {
+ // upload matrix palette to shader
+ const MatrixPaletteCache& mpc = updateSkinInfoMatrixPalette(avatar, skin);
+ U32 count = mpc.mMatrixPalette.size();
- mp[idx+4] = m[4];
- mp[idx+5] = m[5];
- mp[idx+6] = m[6];
- mp[idx+7] = m[13];
+ stop_glerror();
- mp[idx+8] = m[8];
- mp[idx+9] = m[9];
- mp[idx+10] = m[10];
- mp[idx+11] = m[14];
- }
+ LLDrawPoolAvatar::sVertexProgram->uniformMatrix3x4fv(LLViewerShaderMgr::AVATAR_MATRIX,
+ count,
+ FALSE,
+ (GLfloat*) &(mpc.mGLMp[0]));
- LLDrawPoolAvatar::sVertexProgram->uniformMatrix3x4fv(LLViewerShaderMgr::AVATAR_MATRIX,
- count,
- FALSE,
- (GLfloat*) mp);
-
- stop_glerror();
+ stop_glerror();
+ }
}
else
{
data_mask &= ~LLVertexBuffer::MAP_WEIGHT4;
}
+ lastSkin = skin;
+
/*if (glow)
{
gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow());
@@ -2330,16 +2422,22 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_DEFERRED_SIMPLE);
}
void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_DEFERRED_BUMP);
}
void LLDrawPoolAvatar::renderDeferredRiggedMaterial(LLVOAvatar* avatar, S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, pass);
}
@@ -2352,8 +2450,10 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
//update rigged vertex buffers
for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type)
{
+ LL_PROFILE_ZONE_NAMED("Pass");
for (U32 i = 0; i < mRiggedFace[type].size(); ++i)
{
+ LL_PROFILE_ZONE_NAMED("Face");
LLFace* face = mRiggedFace[type][i];
LLDrawable* drawable = face->getDrawable();
if (!drawable)
@@ -2376,43 +2476,111 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
continue;
}
- const LLMeshSkinInfo* skin = vobj->getSkinInfo();
- if (!skin)
- {
- continue;
- }
-
stop_glerror();
LLVolumeFace& vol_face = volume->getVolumeFace(te);
- updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face);
+ updateRiggedFaceVertexBuffer(avatar, face, vobj, volume, vol_face);
}
}
}
+void LLDrawPoolAvatar::updateSkinInfoMatrixPalettes(LLVOAvatar* avatarp)
+{
+ LL_PROFILE_ZONE_SCOPED;
+ //evict matrix palettes from the cache that haven't been updated in 10 frames
+ for (matrix_palette_cache_t::iterator iter = mMatrixPaletteCache.begin(); iter != mMatrixPaletteCache.end(); )
+ {
+ if (gFrameCount - iter->second.mFrame > 10)
+ {
+ iter = mMatrixPaletteCache.erase(iter);
+ }
+ else
+ {
+ ++iter;
+ }
+ }
+}
+
+const LLDrawPoolAvatar::MatrixPaletteCache& LLDrawPoolAvatar::updateSkinInfoMatrixPalette(LLVOAvatar * avatarp, const LLMeshSkinInfo* skin)
+{
+ MatrixPaletteCache& entry = mMatrixPaletteCache[skin];
+
+ if (entry.mFrame != gFrameCount)
+ {
+ LL_PROFILE_ZONE_SCOPED;
+ entry.mFrame = gFrameCount;
+ //build matrix palette
+ U32 count = LLSkinningUtil::getMeshJointCount(skin);
+ entry.mMatrixPalette.resize(count);
+ LLSkinningUtil::initSkinningMatrixPalette(&(entry.mMatrixPalette[0]), count, skin, avatarp);
+
+ const LLMatrix4a* mat = &(entry.mMatrixPalette[0]);
+
+ stop_glerror();
+
+ 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;
+}
+
void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_SIMPLE);
}
void LLDrawPoolAvatar::renderRiggedFullbright(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_FULLBRIGHT);
}
void LLDrawPoolAvatar::renderRiggedShinySimple(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_SHINY);
}
void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_FULLBRIGHT_SHINY);
}
void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!mRiggedFace[RIGGED_ALPHA].empty())
{
LLGLEnable blend(GL_BLEND);
@@ -2430,6 +2598,8 @@ void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!mRiggedFace[RIGGED_FULLBRIGHT_ALPHA].empty())
{
LLGLEnable blend(GL_BLEND);
@@ -2447,6 +2617,8 @@ void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!mRiggedFace[RIGGED_GLOW].empty())
{
LLGLEnable blend(GL_BLEND);
@@ -2474,6 +2646,8 @@ void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
//-----------------------------------------------------------------------------
LLViewerTexture *LLDrawPoolAvatar::getDebugTexture()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (mReferences.empty())
{
return NULL;
@@ -2497,6 +2671,8 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const
void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert (facep->isState(LLFace::RIGGED));
llassert(getType() == LLDrawPool::POOL_AVATAR || getType() == LLDrawPool::POOL_CONTROL_AV);
if (facep->getPool() && facep->getPool() != this)
@@ -2519,6 +2695,8 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type)
void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert (facep->isState(LLFace::RIGGED));
llassert(getType() == LLDrawPool::POOL_AVATAR || getType() == LLDrawPool::POOL_CONTROL_AV);
if (facep->getPool() != this)
@@ -2556,7 +2734,7 @@ LLVertexBufferAvatar::LLVertexBufferAvatar()
: LLVertexBuffer(sDataMask,
GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets
{
-
+ LL_PROFILE_ZONE_SCOPED
}
diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h
index 92a8538958..0c1ee2cced 100644
--- a/indra/newview/lldrawpoolavatar.h
+++ b/indra/newview/lldrawpoolavatar.h
@@ -28,14 +28,18 @@
#define LL_LLDRAWPOOLAVATAR_H
#include "lldrawpool.h"
+#include "llmodel.h"
+
+#include <unordered_map>
class LLVOAvatar;
+class LLVOVolume;
class LLGLSLShader;
class LLFace;
-class LLMeshSkinInfo;
class LLVolume;
class LLVolumeFace;
+extern U32 gFrameCount;
class LLDrawPoolAvatar : public LLFacePool
{
@@ -253,11 +257,13 @@ typedef enum
void getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face);
void updateRiggedFaceVertexBuffer(LLVOAvatar* avatar,
LLFace* facep,
- const LLMeshSkinInfo* skin,
+ const LLVOVolume* vobj,
LLVolume* volume,
LLVolumeFace& vol_face);
void updateRiggedVertexBuffers(LLVOAvatar* avatar);
+ void updateSkinInfoMatrixPalettes(LLVOAvatar* avatarp);
+
void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false);
void renderRiggedSimple(LLVOAvatar* avatar);
void renderRiggedAlpha(LLVOAvatar* avatar);
@@ -277,6 +283,26 @@ typedef enum
std::vector<LLFace*> mRiggedFace[NUM_RIGGED_PASSES];
+ class MatrixPaletteCache
+ {
+ public:
+ U32 mFrame;
+ LLMeshSkinInfo::matrix_list_t mMatrixPalette;
+
+ // Float array ready to be sent to GL
+ std::vector<F32> mGLMp;
+
+ MatrixPaletteCache() :
+ mFrame(gFrameCount-1)
+ {
+ }
+ };
+
+ const MatrixPaletteCache& updateSkinInfoMatrixPalette(LLVOAvatar* avatarp, const LLMeshSkinInfo* skin);
+
+ typedef std::unordered_map<const LLMeshSkinInfo*, MatrixPaletteCache> matrix_palette_cache_t;
+ matrix_palette_cache_t mMatrixPaletteCache;
+
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp
index ee5d561927..c441fbc09f 100644
--- a/indra/newview/llexperiencelog.cpp
+++ b/indra/newview/llexperiencelog.cpp
@@ -149,10 +149,6 @@ std::string LLExperienceLog::getPermissionString( const LLSD& message, const std
{
buf.str(entry);
}
- else
- {
- buf.str();
- }
}
if(buf.str().empty())
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 4a802ad9aa..34448a780d 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -241,6 +241,8 @@ void LLFace::setPool(LLFacePool* pool)
void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!new_pool)
{
LL_ERRS() << "Setting pool to null!" << LL_ENDL;
@@ -320,6 +322,8 @@ void LLFace::setSpecularMap(LLViewerTexture* tex)
void LLFace::dirtyTexture()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLDrawable* drawablep = getDrawable();
if (mVObjp.notNull() && mVObjp->getVolume())
@@ -535,6 +539,8 @@ void LLFace::updateCenterAgent()
void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (mDrawablep == NULL || mDrawablep->getSpatialGroup() == NULL)
{
return;
@@ -585,6 +591,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
}
gGL.syncMatrices();
+ LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x00FF00 );
glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
@@ -605,6 +612,8 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
void renderFace(LLDrawable* drawable, LLFace *face)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVOVolume* vobj = drawable->getVOVolume();
if (vobj)
{
@@ -891,6 +900,8 @@ bool less_than_max_mag(const LLVector4a& vec)
BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
const LLMatrix4& mat_vert_in, BOOL global_volume)
{
+ LL_PROFILE_ZONE_SCOPED
+
//get bounding box
if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED))
{
@@ -2375,6 +2386,8 @@ F32 LLFace::getTextureVirtualSize()
BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
{
+ LL_PROFILE_ZONE_SCOPED
+
//VECTORIZE THIS
//get area of circle around face
LLVector4a center;
@@ -2654,6 +2667,8 @@ const LLMatrix4& LLFace::getRenderMatrix() const
S32 LLFace::renderElements(const U16 *index_array) const
{
+ LL_PROFILE_ZONE_SCOPED
+
S32 ret = 0;
if (isState(GLOBAL))
@@ -2673,6 +2688,8 @@ S32 LLFace::renderElements(const U16 *index_array) const
S32 LLFace::renderIndexed()
{
+ LL_PROFILE_ZONE_SCOPED
+
if(mDrawablep == NULL || mDrawPoolp == NULL)
{
return 0;
@@ -2683,6 +2700,8 @@ S32 LLFace::renderIndexed()
S32 LLFace::renderIndexed(U32 mask)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (mVertexBuffer.isNull())
{
return 0;
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index d9edd4dc30..0e54b66ea9 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1357,31 +1357,31 @@ void LLFloaterModelPreview::clearAvatarTab()
}
void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides)
- {
+{
S32 display_lod = mModelPreview->mPreviewLOD;
if (mModelPreview->mModel[display_lod].empty())
- {
+ {
mSelectedJointName.clear();
return;
- }
+ }
// Joints will be listed as long as they are listed in mAlternateBindMatrix
// even if they are for some reason identical to defaults.
// Todo: Are overrides always identical for all lods? They normally are, but there might be situations where they aren't.
if (mJointOverrides[display_lod].empty())
- {
+ {
// populate map
for (LLModelLoader::scene::iterator iter = mModelPreview->mScene[display_lod].begin(); iter != mModelPreview->mScene[display_lod].end(); ++iter)
- {
+ {
for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter)
- {
+ {
LLModelInstance& instance = *model_iter;
LLModel* model = instance.mModel;
const LLMeshSkinInfo *skin = &model->mSkinInfo;
U32 joint_count = LLSkinningUtil::getMeshJointCount(skin);
U32 bind_count = highlight_overrides ? skin->mAlternateBindMatrix.size() : 0; // simply do not include overrides if data is not needed
if (bind_count > 0 && bind_count != joint_count)
- {
+ {
std::ostringstream out;
out << "Invalid joint overrides for model " << model->getName();
out << ". Amount of joints " << joint_count;
@@ -1390,68 +1390,68 @@ void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides)
addStringToLog(out.str(), true);
// Disable overrides for this model
bind_count = 0;
- }
+ }
if (bind_count > 0)
- {
+ {
for (U32 j = 0; j < joint_count; ++j)
- {
- const LLVector3& joint_pos = skin->mAlternateBindMatrix[j].getTranslation();
+ {
+ const LLVector3& joint_pos = LLVector3(skin->mAlternateBindMatrix[j].getTranslation());
LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]];
LLJoint* pJoint = LLModelPreview::lookupJointByName(skin->mJointNames[j], mModelPreview);
if (pJoint)
- {
+ {
// see how voavatar uses aboveJointPosThreshold
if (pJoint->aboveJointPosThreshold(joint_pos))
- {
+ {
// valid override
if (data.mPosOverrides.size() > 0
&& (data.mPosOverrides.begin()->second - joint_pos).lengthSquared() > (LL_JOINT_TRESHOLD_POS_OFFSET * LL_JOINT_TRESHOLD_POS_OFFSET))
- {
+ {
// File contains multiple meshes with conflicting joint offsets
// preview may be incorrect, upload result might wary (depends onto
// mesh_id that hasn't been generated yet).
data.mHasConflicts = true;
- }
+ }
data.mPosOverrides[model->getName()] = joint_pos;
- }
- else
- {
+ }
+ else
+ {
// default value, it won't be accounted for by avatar
data.mModelsNoOverrides.insert(model->getName());
- }
- }
- }
- }
- else
- {
+ }
+ }
+ }
+ }
+ else
+ {
for (U32 j = 0; j < joint_count; ++j)
- {
+ {
LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]];
data.mModelsNoOverrides.insert(model->getName());
}
}
- }
- }
- }
+ }
+ }
+ }
LLPanel *panel = mTabContainer->getPanelByName("rigging_panel");
LLScrollListCtrl *joints_list = panel->getChild<LLScrollListCtrl>("joints_list");
if (joints_list->isEmpty())
- {
+ {
// Populate table
- std::map<std::string, std::string> joint_alias_map;
+ std::map<std::string, std::string> joint_alias_map;
mModelPreview->getJointAliases(joint_alias_map);
-
+
S32 conflicts = 0;
joint_override_data_map_t::iterator joint_iter = mJointOverrides[display_lod].begin();
joint_override_data_map_t::iterator joint_end = mJointOverrides[display_lod].end();
while (joint_iter != joint_end)
- {
+ {
const std::string& listName = joint_iter->first;
-
+
LLScrollListItem::Params item_params;
item_params.value(listName);
@@ -1459,38 +1459,38 @@ void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides)
cell_params.font = LLFontGL::getFontSansSerif();
cell_params.value = listName;
if (joint_alias_map.find(listName) == joint_alias_map.end())
- {
+ {
// Missing names
cell_params.color = LLColor4::red;
- }
+ }
if (joint_iter->second.mHasConflicts)
- {
+ {
// Conflicts
cell_params.color = LLColor4::orange;
conflicts++;
- }
+ }
if (highlight_overrides && joint_iter->second.mPosOverrides.size() > 0)
- {
+ {
cell_params.font.style = "BOLD";
- }
+ }
item_params.columns.add(cell_params);
joints_list->addRow(item_params, ADD_BOTTOM);
joint_iter++;
- }
+ }
joints_list->selectFirstItem();
LLScrollListItem *selected = joints_list->getFirstSelected();
if (selected)
-{
+ {
mSelectedJointName = selected->getValue().asString();
- }
+ }
LLTextBox *joint_conf_descr = panel->getChild<LLTextBox>("conflicts_description");
joint_conf_descr->setTextArg("[CONFLICTS]", llformat("%d", conflicts));
joint_conf_descr->setTextArg("[JOINTS_COUNT]", llformat("%d", mJointOverrides[display_lod].size()));
- }
- }
+ }
+}
//-----------------------------------------------------------------------------
// addStringToLogTab()
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 9d49c30a49..55a4b5a457 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -224,6 +224,7 @@ BOOL LLHUDNameTag::lineSegmentIntersect(const LLVector4a& start, const LLVector4
void LLHUDNameTag::render()
{
+ LL_PROFILE_ZONE_SCOPED;
if (sDisplayText)
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
@@ -731,6 +732,7 @@ void LLHUDNameTag::updateSize()
void LLHUDNameTag::updateAll()
{
+ LL_PROFILE_ZONE_SCOPED;
// iterate over all text objects, calculate their restoration forces,
// and add them to the visible set if they are on screen and close enough
sVisibleTextObjects.clear();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2c1c1191da..8ac64dbd15 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -4046,28 +4046,26 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo
const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const LLVOVolume* requesting_obj)
{
LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
+ if (mesh_id.notNull())
+ {
+ skin_map::iterator iter = mSkinMap.find(mesh_id);
+ if (iter != mSkinMap.end())
+ {
+ return &(iter->second);
+ }
- if (mesh_id.notNull())
- {
- skin_map::iterator iter = mSkinMap.find(mesh_id);
- if (iter != mSkinMap.end())
- {
- return &(iter->second);
- }
-
- //no skin info known about given mesh, try to fetch it
- {
- LLMutexLock lock(mMeshMutex);
- //add volume to list of loading meshes
- skin_load_map::iterator iter = mLoadingSkins.find(mesh_id);
- if (iter == mLoadingSkins.end())
- { //no request pending for this skin info
- mPendingSkinRequests.push(mesh_id);
- }
- mLoadingSkins[mesh_id].insert(requesting_obj->getID());
- }
- }
-
+ //no skin info known about given mesh, try to fetch it
+ {
+ LLMutexLock lock(mMeshMutex);
+ //add volume to list of loading meshes
+ skin_load_map::iterator iter = mLoadingSkins.find(mesh_id);
+ if (iter == mLoadingSkins.end())
+ { //no request pending for this skin info
+ mPendingSkinRequests.push(mesh_id);
+ }
+ mLoadingSkins[mesh_id].insert(requesting_obj->getID());
+ }
+ }
return NULL;
}
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 81e49cb1d8..c1698194cb 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -27,6 +27,7 @@
#ifndef LL_MESH_REPOSITORY_H
#define LL_MESH_REPOSITORY_H
+#include <unordered_map>
#include "llassettype.h"
#include "llmodel.h"
#include "lluuid.h"
@@ -613,7 +614,7 @@ public:
typedef std::map<LLVolumeParams, std::set<LLUUID> > mesh_load_map;
mesh_load_map mLoadingMeshes[4];
- typedef std::map<LLUUID, LLMeshSkinInfo> skin_map;
+ typedef std::unordered_map<LLUUID, LLMeshSkinInfo> skin_map;
skin_map mSkinMap;
typedef std::map<LLUUID, LLModel::Decomposition*> decomposition_map;
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index a9e80ab5da..01bddd781d 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -591,7 +591,7 @@ void LLModelPreview::rebuildUploadData()
bool upload_skinweights = fmp && fmp->childGetValue("upload_skin").asBoolean();
if (upload_skinweights && high_lod_model->mSkinInfo.mJointNames.size() > 0)
{
- LLQuaternion bind_rot = LLSkinningUtil::getUnscaledQuaternion(high_lod_model->mSkinInfo.mBindShapeMatrix);
+ LLQuaternion bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(high_lod_model->mSkinInfo.mBindShapeMatrix));
LLQuaternion identity;
if (!bind_rot.isEqualEps(identity, 0.01))
{
@@ -3298,7 +3298,7 @@ BOOL LLModelPreview::render()
LLJoint *joint = getPreviewAvatar()->getJoint(skin->mJointNums[j]);
if (joint)
{
- const LLVector3& jointPos = skin->mAlternateBindMatrix[j].getTranslation();
+ const LLVector3& jointPos = LLVector3(skin->mAlternateBindMatrix[j].getTranslation());
if (joint->aboveJointPosThreshold(jointPos))
{
bool override_changed;
@@ -3340,11 +3340,10 @@ BOOL LLModelPreview::render()
//build matrix palette
LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
- LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, joint_count,
+ LLSkinningUtil::initSkinningMatrixPalette(mat, joint_count,
skin, getPreviewAvatar());
- LLMatrix4a bind_shape_matrix;
- bind_shape_matrix.loadu(skin->mBindShapeMatrix);
+ const LLMatrix4a& bind_shape_matrix = skin->mBindShapeMatrix;
U32 max_joints = LLSkinningUtil::getMaxJointCount();
for (U32 j = 0; j < buffer->getNumVerts(); ++j)
{
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp
index e02b21f036..dc12de29fb 100644
--- a/indra/newview/llskinningutil.cpp
+++ b/indra/newview/llskinningutil.cpp
@@ -35,7 +35,6 @@
#include "llrigginginfo.h"
#define DEBUG_SKINNING LL_DEBUG
-#define MAT_USE_SSE 1
void dump_avatar_and_skin_state(const std::string& reason, LLVOAvatar *avatar, const LLMeshSkinInfo *skin)
{
@@ -120,36 +119,26 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin
skin->mInvalidJointsScrubbed = true;
}
-#define MAT_USE_SSE 1
-
void LLSkinningUtil::initSkinningMatrixPalette(
- LLMatrix4* mat,
+ LLMatrix4a* mat,
S32 count,
const LLMeshSkinInfo* skin,
LLVOAvatar *avatar)
{
+ LL_PROFILE_ZONE_SCOPED;
+
initJointNums(const_cast<LLMeshSkinInfo*>(skin), avatar);
+
+ LLMatrix4a world[LL_CHARACTER_MAX_ANIMATED_JOINTS];
+
for (U32 j = 0; j < count; ++j)
{
S32 joint_num = skin->mJointNums[j];
- LLJoint *joint = NULL;
- if (joint_num >= 0 && joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS)
- {
- joint = avatar->getJoint(joint_num);
- }
- llassert(joint);
+ LLJoint *joint = avatar->getJoint(joint_num);
+
if (joint)
{
-#ifdef MAT_USE_SSE
- LLMatrix4a bind, world, res;
- bind.loadu(skin->mInvBindMatrix[j]);
- world.loadu(joint->getWorldMatrix());
- matMul(bind,world,res);
- memcpy(mat[j].mMatrix,res.mMatrix,16*sizeof(float));
-#else
- mat[j] = skin->mInvBindMatrix[j];
- mat[j] *= joint->getWorldMatrix();
-#endif
+ world[j] = joint->getWorldMatrix4a();
}
else
{
@@ -159,16 +148,27 @@ void LLSkinningUtil::initSkinningMatrixPalette(
// rendering should be disabled unless all joints are
// valid. In other cases of skinned rendering, invalid
// joints should already have been removed during scrubInvalidJoints().
- LL_WARNS_ONCE("Avatar") << avatar->getFullname()
- << " rigged to invalid joint name " << skin->mJointNames[j]
- << " num " << skin->mJointNums[j] << LL_ENDL;
- LL_WARNS_ONCE("Avatar") << avatar->getFullname()
- << " avatar build state: isBuilt() " << avatar->isBuilt()
- << " mInitFlags " << avatar->mInitFlags << LL_ENDL;
+ LL_WARNS_ONCE("Avatar") << avatar->getFullname()
+ << " rigged to invalid joint name " << skin->mJointNames[j]
+ << " num " << skin->mJointNums[j] << LL_ENDL;
+ LL_WARNS_ONCE("Avatar") << avatar->getFullname()
+ << " avatar build state: isBuilt() " << avatar->isBuilt()
+ << " mInitFlags " << avatar->mInitFlags << LL_ENDL;
#endif
dump_avatar_and_skin_state("initSkinningMatrixPalette joint not found", avatar, skin);
}
}
+
+ //NOTE: pointer striders used here as a micro-optimization over vector/array lookups
+ const LLMatrix4a* invBind = &(skin->mInvBindMatrix[0]);
+ const LLMatrix4a* w = world;
+ LLMatrix4a* m = mat;
+ LLMatrix4a* end = m + count;
+
+ while (m < end)
+ {
+ matMulUnsafe(*(invBind++), *(w++), *(m++));
+ }
}
void LLSkinningUtil::checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin)
@@ -212,7 +212,7 @@ void LLSkinningUtil::scrubSkinWeights(LLVector4a* weights, U32 num_vertices, con
void LLSkinningUtil::getPerVertexSkinMatrix(
F32* weights,
- LLMatrix4a* mat,
+ const LLMatrix4a* mat,
bool handle_bad_scale,
LLMatrix4a& final_mat,
U32 max_joints)
@@ -270,6 +270,7 @@ void LLSkinningUtil::initJointNums(LLMeshSkinInfo* skin, LLVOAvatar *avatar)
{
if (!skin->mJointNumsInitialized)
{
+ LL_PROFILE_ZONE_SCOPED;
for (U32 j = 0; j < skin->mJointNames.size(); ++j)
{
#if DEBUG_SKINNING
@@ -357,13 +358,11 @@ void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *a
rig_info_tab[joint_num].setIsRiggedTo(true);
// FIXME could precompute these matMuls.
- LLMatrix4a bind_shape;
- LLMatrix4a inv_bind;
+ const LLMatrix4a& bind_shape = skin->mBindShapeMatrix;
+ const LLMatrix4a& inv_bind = skin->mInvBindMatrix[joint_index];
LLMatrix4a mat;
LLVector4a pos_joint_space;
- bind_shape.loadu(skin->mBindShapeMatrix);
- inv_bind.loadu(skin->mInvBindMatrix[joint_index]);
matMul(bind_shape, inv_bind, mat);
mat.affineTransform(pos, pos_joint_space);
@@ -426,3 +425,4 @@ LLQuaternion LLSkinningUtil::getUnscaledQuaternion(const LLMatrix4& mat4)
bind_rot.normalize();
return bind_rot;
}
+
diff --git a/indra/newview/llskinningutil.h b/indra/newview/llskinningutil.h
index efe7c85997..807418f983 100644
--- a/indra/newview/llskinningutil.h
+++ b/indra/newview/llskinningutil.h
@@ -42,10 +42,10 @@ namespace LLSkinningUtil
S32 getMaxJointCount();
U32 getMeshJointCount(const LLMeshSkinInfo *skin);
void scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin);
- void initSkinningMatrixPalette(LLMatrix4* mat, S32 count, const LLMeshSkinInfo* skin, LLVOAvatar *avatar);
+ void initSkinningMatrixPalette(LLMatrix4a* mat, S32 count, const LLMeshSkinInfo* skin, LLVOAvatar *avatar);
void checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin);
void scrubSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin);
- void getPerVertexSkinMatrix(F32* weights, LLMatrix4a* mat, bool handle_bad_scale, LLMatrix4a& final_mat, U32 max_joints);
+ void getPerVertexSkinMatrix(F32* weights, const LLMatrix4a* mat, bool handle_bad_scale, LLMatrix4a& final_mat, U32 max_joints);
LL_FORCE_INLINE void getPerVertexSkinMatrixWithIndices(
F32* weights,
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index efa4a7fd66..253b6b9953 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -503,7 +503,9 @@ LLSpatialGroup* LLSpatialGroup::getParent()
}
BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
- {
+{
+ LL_PROFILE_ZONE_SCOPED
+
if(!drawablep)
{
return FALSE;
@@ -591,6 +593,8 @@ public:
void LLSpatialGroup::setState(U32 state, S32 mode)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert(state <= LLSpatialGroup::STATE_MASK);
if (mode > STATE_MODE_SINGLE)
@@ -638,6 +642,8 @@ public:
void LLSpatialGroup::clearState(U32 state, S32 mode)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert(state <= LLSpatialGroup::STATE_MASK);
if (mode > STATE_MODE_SINGLE)
@@ -724,6 +730,8 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVector4a eye;
LLVector4a origin;
origin.load3(camera.getOrigin().mV);
@@ -815,6 +823,8 @@ F32 LLSpatialGroup::getUpdateUrgency() const
BOOL LLSpatialGroup::changeLOD()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (hasState(ALPHA_DIRTY | OBJECT_DIRTY))
{
//a rebuild is going to happen, update distance and LoD
@@ -907,6 +917,8 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (child->getListenerCount() == 0)
{
new LLSpatialGroup(child, getSpatialPartition());
@@ -2700,11 +2712,17 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
gGL.diffuseColor4fv(line_color.mV);
gGL.syncMatrices();
- glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+ {
+ LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x20FF20 )
+ glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+ }
gGL.diffuseColor4fv(color.mV);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+ {
+ LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x40FF40 )
+ glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+ }
}
else
{
@@ -3222,6 +3240,7 @@ void renderRaycast(LLDrawable* drawablep)
gGL.diffuseColor4f(0,1,1,0.5f);
glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
gGL.syncMatrices();
+ LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x60FF60 );
glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
}
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index cb356726e6..ea36e1d7be 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -1214,6 +1214,7 @@ F32 LLSurface::getWaterHeight() const
BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y,
const F32 width, const F32 height)
{
+ LL_PROFILE_ZONE_SCOPED
if (!getWaterTexture())
{
return FALSE;
diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp
index 5e056944e9..aeefcd6fb8 100644
--- a/indra/newview/llsurfacepatch.cpp
+++ b/indra/newview/llsurfacepatch.cpp
@@ -728,6 +728,7 @@ BOOL LLSurfacePatch::updateTexture()
void LLSurfacePatch::updateGL()
{
+ LL_PROFILE_ZONE_SCOPED
F32 meters_per_grid = getSurface()->getMetersPerGrid();
F32 grids_per_patch_edge = (F32)getSurface()->getGridsPerPatchEdge();
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index a590237440..33842497d1 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -208,9 +208,11 @@ void display_update_camera()
// Write some stats to LL_INFOS()
void display_stats()
{
+ LL_PROFILE_ZONE_SCOPED
F32 fps_log_freq = gSavedSettings.getF32("FPSLogFrequency");
if (fps_log_freq > 0.f && gRecentFPSTime.getElapsedTimeF32() >= fps_log_freq)
{
+ LL_PROFILE_ZONE_NAMED("DS - FPS");
F32 fps = gRecentFrameCount / fps_log_freq;
LL_INFOS() << llformat("FPS: %.02f", fps) << LL_ENDL;
gRecentFrameCount = 0;
@@ -219,6 +221,7 @@ void display_stats()
F32 mem_log_freq = gSavedSettings.getF32("MemoryLogFrequency");
if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq)
{
+ LL_PROFILE_ZONE_NAMED("DS - Memory");
gMemoryAllocated = U64Bytes(LLMemory::getCurrentRSS());
U32Megabytes memory = gMemoryAllocated;
LL_INFOS() << "MEMORY: " << memory << LL_ENDL;
@@ -228,6 +231,7 @@ void display_stats()
F32 asset_storage_log_freq = gSavedSettings.getF32("AssetStorageLogFrequency");
if (asset_storage_log_freq > 0.f && gAssetStorageLogTime.getElapsedTimeF32() >= asset_storage_log_freq)
{
+ LL_PROFILE_ZONE_NAMED("DS - Asset Storage");
gAssetStorageLogTime.reset();
gAssetStorage->logAssetStorageInfo();
}
@@ -630,6 +634,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (!gDisconnected)
{
+ LL_PROFILE_ZONE_NAMED("display - 1");
LLAppViewer::instance()->pingMainloopTimeout("Display:Update");
if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
{ //don't draw hud objects in this frame
@@ -722,6 +727,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLAppViewer::instance()->pingMainloopTimeout("Display:Swap");
{
+ LL_PROFILE_ZONE_NAMED("display - 2")
if (gResizeScreenTexture)
{
gResizeScreenTexture = FALSE;
@@ -777,6 +783,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
//if (!for_snapshot)
{
+ LL_PROFILE_ZONE_NAMED("display - 3")
LLAppViewer::instance()->pingMainloopTimeout("Display:Imagery");
gPipeline.generateWaterReflection(*LLViewerCamera::getInstance());
gPipeline.generateHighlight(*LLViewerCamera::getInstance());
@@ -825,7 +832,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLImageGL::deleteDeadTextures();
stop_glerror();
}*/
- }
+ }
LLGLState::checkStates();
LLGLState::checkClientArrays();
@@ -840,6 +847,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
//
LLAppViewer::instance()->pingMainloopTimeout("Display:StateSort");
{
+ LL_PROFILE_ZONE_NAMED("display - 3")
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
gPipeline.stateSort(*LLViewerCamera::getInstance(), result);
stop_glerror();
@@ -948,6 +956,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())
&& !gRestoreGL)
{
+ LL_PROFILE_ZONE_NAMED("display - 4")
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
if (gSavedSettings.getBOOL("RenderDepthPrePass") && LLGLSLShader::sNoFixedFunction)
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 63e48d1dd0..0b20556104 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -168,6 +168,8 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
{
+ LL_PROFILE_ZONE_SCOPED
+
if(objectp && objectp->getRegion())
{
U32 local_id = objectp->mLocalID;
@@ -303,6 +305,8 @@ static LLTrace::BlockTimerStatHandle FTM_PROCESS_OBJECTS("Process Objects");
LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* entry, LLViewerRegion* regionp)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLDataPacker *cached_dpp = entry->getDP();
if (!cached_dpp)
@@ -848,6 +852,8 @@ static LLTrace::BlockTimerStatHandle FTM_IDLE_COPY("Idle Copy");
void LLViewerObjectList::update(LLAgent &agent)
{
+ LL_PROFILE_ZONE_SCOPED
+
// Update globals
LLViewerObject::setVelocityInterpolate( gSavedSettings.getBOOL("VelocityInterpolate") );
LLViewerObject::setPingInterpolate( gSavedSettings.getBOOL("PingInterpolate") );
@@ -1293,6 +1299,8 @@ void LLViewerObjectList::clearDebugText()
void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
{
+ LL_PROFILE_ZONE_SCOPED
+
bool new_dead_object = true;
if (mDeadObjects.find(objectp->mID) != mDeadObjects.end())
{
@@ -1523,6 +1531,8 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
void LLViewerObjectList::updateActive(LLViewerObject *objectp)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (objectp->isDead())
{
return; // We don't update dead objects!
@@ -1843,6 +1853,8 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 &center)
void LLViewerObjectList::generatePickList(LLCamera &camera)
{
+ LL_PROFILE_ZONE_SCOPED
+
LLViewerObject *objectp;
S32 i;
// Reset all of the GL names to zero.
@@ -2104,6 +2116,8 @@ LLViewerObject *LLViewerObjectList::replaceObject(const LLUUID &id, const LLPCod
S32 LLViewerObjectList::findReferences(LLDrawable *drawablep) const
{
+ LL_PROFILE_ZONE_SCOPED
+
LLViewerObject *objectp;
S32 num_refs = 0;
@@ -2167,6 +2181,8 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip
void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (objectp->isDead())
{
LL_WARNS() << "Trying to find orphans for dead obj " << objectp->mID
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 7c3dd00e1a..02f7bbeed8 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -847,6 +847,7 @@ void LLViewerParcelOverlay::setDirty()
void LLViewerParcelOverlay::updateGL()
{
+ LL_PROFILE_ZONE_SCOPED
updateOverlayTexture();
}
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index ca01bb46aa..af55f68cd2 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -208,6 +208,7 @@ void LLViewerTextureManager::findTextures(const LLUUID& id, std::vector<LLViewe
LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id, S32 tex_type)
{
+ LL_PROFILE_ZONE_SCOPED;
return gTextureList.findImage(id, (ETexListType)tex_type);
}
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 561319ca5d..12495078e9 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -620,6 +620,7 @@ void LLViewerTextureList::findTexturesByID(const LLUUID &image_id, std::vector<L
LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLTextureKey &search_key)
{
+ LL_PROFILE_ZONE_SCOPED;
uuid_map_t::iterator iter = mUUIDMap.find(search_key);
if (iter == mUUIDMap.end())
return NULL;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 1d13a306ef..2157585364 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -5280,6 +5280,7 @@ void LLViewerWindow::setup3DRender()
void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset)
{
+ LL_PROFILE_ZONE_SCOPED
gGLViewport[0] = mWorldViewRectRaw.mLeft + x_offset;
gGLViewport[1] = mWorldViewRectRaw.mBottom + y_offset;
gGLViewport[2] = mWorldViewRectRaw.getWidth();
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index c63c5f6b23..46beac8255 100644
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -254,6 +254,7 @@ BOOL LLVLComposition::generateComposition()
BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
const F32 width, const F32 height)
{
+ LL_PROFILE_ZONE_SCOPED
llassert(mSurfacep);
llassert(x >= 0.f);
llassert(y >= 0.f);
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index e085a945a8..a588d05ff7 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3136,6 +3136,8 @@ void LLVOAvatar::idleUpdateWindEffect()
void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
{
+ LL_PROFILE_ZONE_SCOPED;
+
// update chat bubble
//--------------------------------------------------------------------
// draw text label over character's head
@@ -4884,6 +4886,8 @@ bool LLVOAvatar::shouldAlphaMask()
//-----------------------------------------------------------------------------
U32 LLVOAvatar::renderSkinned()
{
+ LL_PROFILE_ZONE_SCOPED;
+
U32 num_indices = 0;
if (!mIsBuilt)
@@ -6158,27 +6162,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;
}
@@ -6513,7 +6519,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;
@@ -7117,6 +7123,7 @@ void LLVOAvatar::updateGL()
{
if (mMeshTexturesDirty)
{
+ LL_PROFILE_ZONE_SCOPED
updateMeshTextures();
mMeshTexturesDirty = FALSE;
}
@@ -7862,6 +7869,8 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color)
// Do rigged mesh attachments display with this av?
bool LLVOAvatar::shouldRenderRigged() const
{
+ LL_PROFILE_ZONE_SCOPED;
+
if (getOverallAppearance() == AOA_NORMAL)
{
return true;
@@ -8353,6 +8362,7 @@ void LLVOAvatar::updateMeshVisibility()
// virtual
void LLVOAvatar::updateMeshTextures()
{
+ LL_PROFILE_ZONE_SCOPED
static S32 update_counter = 0;
mBakedTextureDebugText.clear();
@@ -10949,6 +10959,7 @@ void LLVOAvatar::updateOverallAppearanceAnimations()
// Based on isVisuallyMuted(), but has 3 possible results.
LLVOAvatar::AvatarOverallAppearance LLVOAvatar::getOverallAppearance() const
{
+ LL_PROFILE_ZONE_SCOPED;
AvatarOverallAppearance result = AOA_NORMAL;
// Priority order (highest priority first)
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 74ef589ca4..39adaab8ca 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -209,6 +209,11 @@ public:
virtual LLJoint* getJoint(const std::string &name);
LLJoint* getJoint(S32 num);
+ //if you KNOW joint_num is a valid animated joint index, use getSkeletonJoint for efficiency
+ inline LLJoint* getSkeletonJoint(S32 joint_num) { return mSkeleton[joint_num]; }
+ inline size_t getSkeletonJointCount() const { return mSkeleton.size(); }
+
+
void addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LLUUID>* meshes_seen = NULL, bool recursive = true);
void removeAttachmentOverridesForObject(const LLUUID& mesh_id);
void removeAttachmentOverridesForObject(LLViewerObject *vo);
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 897bace4e1..b5560d3d79 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -218,6 +218,7 @@ void LLVOSurfacePatch::updateGL()
{
if (mPatchp)
{
+ LL_PROFILE_ZONE_SCOPED
mPatchp->updateGL();
}
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f9b2285989..e5a4b0f374 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4807,7 +4807,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
LLMatrix4a mat[kMaxJoints];
U32 maxJoints = LLSkinningUtil::getMeshJointCount(skin);
- LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, maxJoints, skin, avatar);
+ LLSkinningUtil::initSkinningMatrixPalette(mat, maxJoints, skin, avatar);
S32 rigged_vert_count = 0;
S32 rigged_face_count = 0;
@@ -4823,8 +4823,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
if ( weight )
{
LLSkinningUtil::checkSkinWeights(weight, dst_face.mNumVertices, skin);
- LLMatrix4a bind_shape_matrix;
- bind_shape_matrix.loadu(skin->mBindShapeMatrix);
+ const LLMatrix4a& bind_shape_matrix = skin->mBindShapeMatrix;
LLVector4a* pos = dst_face.mPositions;
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index a1a1db35d6..c7b0a2bfb4 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1284,6 +1284,7 @@ void send_agent_pause()
void send_agent_resume()
{
+ LL_PROFILE_ZONE_SCOPED
// Note: used to check for LLWorld initialization before it became a singleton.
// Rather than just remove this check I'm changing it to assure that the message
// system has been initialized. -MG
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e7c2d4db39..d7acf2ec0e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1897,6 +1897,7 @@ void LLPipeline::createObject(LLViewerObject* vobj)
void LLPipeline::resetFrameStats()
{
+ LL_PROFILE_ZONE_SCOPED
assertInitialized();
sCompiles = 0;
@@ -2125,6 +2126,7 @@ void LLPipeline::grabReferences(LLCullResult& result)
void LLPipeline::clearReferences()
{
+ LL_PROFILE_ZONE_SCOPED
sCull = NULL;
mGroupSaveQ1.clear();
}
@@ -11146,6 +11148,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
if (LLPipeline::sRenderDeferred)
{
GLuint buff = GL_COLOR_ATTACHMENT0;
+ LL_PROFILER_GPU_ZONEC( "gl.DrawBuffersARB", 0x8000FF );
glDrawBuffersARB(1, &buff);
}