summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llfasttimer_class.h8
-rw-r--r--indra/llcommon/llthread.cpp9
-rw-r--r--indra/newview/llface.cpp34
-rw-r--r--indra/newview/llfloatermodelpreview.cpp18
-rw-r--r--indra/newview/llfloatermodelpreview.h2
-rw-r--r--indra/newview/pipeline.cpp3
6 files changed, 40 insertions, 34 deletions
diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h
index ddb1a74793..d348888832 100644
--- a/indra/llcommon/llfasttimer_class.h
+++ b/indra/llcommon/llfasttimer_class.h
@@ -37,12 +37,17 @@
#define FAST_TIMER_ON 1
#define TIME_FAST_TIMERS 0
+#define DEBUG_FAST_TIMER_THREADS 1
class LLMutex;
#include <queue>
#include "llsd.h"
+#if DEBUG_FAST_TIMER_THREADS
+void assert_main_thread();
+#endif
+
class LL_COMMON_API LLFastTimer
{
public:
@@ -182,6 +187,9 @@ public:
U64 timer_end = getCPUClockCount64();
sTimerCycles += timer_end - timer_start;
#endif
+#if DEBUG_FAST_TIMER_THREADS
+ assert_main_thread();
+#endif
}
LL_FORCE_INLINE ~LLFastTimer()
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 0385569a02..10cc409c6e 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -68,6 +68,15 @@ U32 ll_thread_local sThreadID = 0;
U32 LLThread::sIDIter = 0;
+void assert_main_thread()
+{
+ static U32 s_thread_id = LLThread::currentID();
+ if (LLThread::currentID() != s_thread_id)
+ {
+ llerrs << "Illegal execution outside main thread." << llendl;
+ }
+}
+
//
// Handed to the APR thread creation function
//
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index bac636286e..7c24eb77cd 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -198,18 +198,8 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
mHasMedia = FALSE ;
}
-static LLFastTimer::DeclareTimer FTM_DESTROY_FACE("Destroy Face");
-static LLFastTimer::DeclareTimer FTM_DESTROY_TEXTURE("Texture");
-static LLFastTimer::DeclareTimer FTM_DESTROY_DRAWPOOL("Drawpool");
-static LLFastTimer::DeclareTimer FTM_DESTROY_TEXTURE_MATRIX("Texture Matrix");
-static LLFastTimer::DeclareTimer FTM_DESTROY_DRAW_INFO("Draw Info");
-static LLFastTimer::DeclareTimer FTM_DESTROY_ATLAS("Atlas");
-static LLFastTimer::DeclareTimer FTM_FACE_DEREF("Deref");
-
void LLFace::destroy()
{
- LLFastTimer t(FTM_DESTROY_FACE);
-
if (gDebugGL)
{
gPipeline.checkReferences(this);
@@ -217,14 +207,11 @@ void LLFace::destroy()
if(mTexture.notNull())
{
- LLFastTimer t(FTM_DESTROY_TEXTURE);
mTexture->removeFace(this) ;
}
if (mDrawPoolp)
{
- LLFastTimer t(FTM_DESTROY_DRAWPOOL);
-
#if LL_MESH_ENABLED
if (this->isState(LLFace::RIGGED) && mDrawPoolp->getType() == LLDrawPool::POOL_AVATAR)
{
@@ -241,7 +228,6 @@ void LLFace::destroy()
if (mTextureMatrix)
{
- LLFastTimer t(FTM_DESTROY_TEXTURE_MATRIX);
delete mTextureMatrix;
mTextureMatrix = NULL;
@@ -256,22 +242,12 @@ void LLFace::destroy()
}
}
- {
- LLFastTimer t(FTM_DESTROY_DRAW_INFO);
- setDrawInfo(NULL);
- }
-
- {
- LLFastTimer t(FTM_DESTROY_ATLAS);
- removeAtlas();
- }
+ setDrawInfo(NULL);
+ removeAtlas();
+
+ mDrawablep = NULL;
+ mVObjp = NULL;
- {
- LLFastTimer t(FTM_FACE_DEREF);
- mDrawablep = NULL;
- mVObjp = NULL;
- }
-
ll_aligned_free_16(mExtents);
mExtents = NULL;
}
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a283be7aa7..b0cde6962b 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -557,6 +557,8 @@ void LLFloaterModelPreview::draw()
LLFloater::draw();
LLRect r = getRect();
+ mModelPreview->update();
+
if (!mLoading)
{
childSetTextArg("status", "[STATUS]", getString("status_idle"));
@@ -1813,6 +1815,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp
mTextureName = 0;
mPreviewLOD = 3;
mModelLoader = NULL;
+ mDirty = false;
mLODMode[0] = 0;
@@ -1881,7 +1884,7 @@ U32 LLModelPreview::calcResourceCost()
mFMP->childSetTextArg(info_name[LLModel::LOD_PHYSICS], "[POINTS]", llformat("%d",num_points));
updateStatusMessages();
-
+
return cost;
}
@@ -2024,8 +2027,8 @@ void LLModelPreview::loadModelCallback(S32 lod)
clearIncompatible(lod);
- mResourceCost = calcResourceCost();
-
+ mDirty = true;
+
mPreviewTarget = (mModelLoader->mExtents[0] + mModelLoader->mExtents[1]) * 0.5f;
mPreviewScale = (mModelLoader->mExtents[1] - mModelLoader->mExtents[0]) * 0.5f;
setPreviewTarget(mPreviewScale.magVec()*2.f);
@@ -2864,6 +2867,15 @@ void LLModelPreview::genBuffers(S32 lod)
}
}
+void LLModelPreview::update()
+{
+ if (mDirty)
+ {
+ mDirty = false;
+ mResourceCost = calcResourceCost();
+ }
+}
+
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 1f9de2e2b9..97e681a6a8 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -118,6 +118,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
void setTexture(U32 name) { mTextureName = name; }
BOOL render();
+ void update();
void genBuffers(S32 lod);
void refresh();
void rotate(F32 yaw_radians, F32 pitch_radians);
@@ -145,6 +146,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
LLFloaterModelPreview* mFMP;
BOOL mNeedsUpdate;
+ bool mDirty;
U32 mTextureName;
F32 mCameraDistance;
F32 mCameraYaw;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e8052aa5a0..d4ee7e36e6 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2367,8 +2367,7 @@ void LLPipeline::markGLRebuild(LLGLUpdate* glu)
void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority)
{
LLMemType mt(LLMemType::MTYPE_PIPELINE);
- //assert_main_thread();
-
+
if (group && !group->isDead() && group->mSpatialPartition)
{
if (group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD)