summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-07-20 16:37:10 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-07-20 16:37:10 -0600
commit3dbe2837d9660c50c8db34f5131bd9258940b3c6 (patch)
treec4dbecac84faab894fbd0fda2d70727aa8d24017 /indra/newview
parent271c06363cd8c077d110da6501392cf33a45017b (diff)
parenta49f4090b8d9d2519439b4d7ba4904b165d569cc (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-release
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvoavatar.cpp40
-rw-r--r--indra/newview/llvoavatar.h3
-rw-r--r--indra/newview/llvoavatarself.cpp2
3 files changed, 29 insertions, 16 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 53b47ec408..09a3b3b9ae 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4140,9 +4140,13 @@ void LLVOAvatar::updateTextures()
}
else
{
- render_avatar = isVisible() && !mCulled;
+ if(!isVisible())
+ {
+ return ;//do not update for invisible avatar.
+ }
+
+ render_avatar = !mCulled; //visible and not culled.
}
- checkTextureLoading() ;
std::vector<BOOL> layer_baked;
// GL NOT ACTIVE HERE - *TODO
@@ -4183,7 +4187,7 @@ void LLVOAvatar::updateTextures()
}
}
}
- if (isIndexBakedTexture((ETextureIndex) texture_index) && render_avatar)
+ if (isIndexBakedTexture((ETextureIndex) texture_index))
{
const S32 boost_level = getAvatarBakedBoostLevel();
imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE);
@@ -4222,10 +4226,11 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerFetchedTexture
return;
}
-
+const S32 MAX_TEXTURE_UPDATE_INTERVAL = 64 ; //need to call updateTextures() at least every 32 frames.
+const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = S32_MAX ; //frames
void LLVOAvatar::checkTextureLoading()
{
- static const F32 MAX_INVISIBLE_WAITING_TIME = 30.f ; //seconds
+ static const F32 MAX_INVISIBLE_WAITING_TIME = 15.f ; //seconds
BOOL pause = !isVisible() ;
if(!pause)
@@ -4245,9 +4250,9 @@ void LLVOAvatar::checkTextureLoading()
if(pause && mInvisibleTimer.getElapsedTimeF32() < MAX_INVISIBLE_WAITING_TIME)
{
- return ;
+ return ; //have not been invisible for enough time.
}
-
+
for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin();
iter != mCallbackTextureList.end(); ++iter)
{
@@ -4257,17 +4262,22 @@ void LLVOAvatar::checkTextureLoading()
if(pause)//pause texture fetching.
{
tex->pauseLoadedCallbacks(&mCallbackTextureList) ;
+
+ //set to terminate texture fetching after MAX_TEXTURE_UPDATE_INTERVAL frames.
+ tex->setMaxVirtualSizeResetInterval(MAX_TEXTURE_UPDATE_INTERVAL);
+ tex->resetMaxVirtualSizeResetCounter() ;
}
else//unpause
{
- static const F32 START_AREA = 100.f ;
-
- tex->unpauseLoadedCallbacks(&mCallbackTextureList) ;
- tex->addTextureStats(START_AREA); //jump start the fetching again
+ tex->unpauseLoadedCallbacks(&mCallbackTextureList) ;
}
}
}
+ if(!pause)
+ {
+ updateTextures() ; //refresh texture stats.
+ }
mLoadedCallbacksPaused = pause ;
return ;
}
@@ -4276,12 +4286,14 @@ const F32 SELF_ADDITIONAL_PRI = 0.75f ;
const F32 ADDITIONAL_PRI = 0.5f;
void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level)
{
- //if this function is not called for the last 512 frames, the texture pipeline will stop fetching this texture.
- static const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = 512 ; //frames
-
+ //Note:
+ //if this function is not called for the last MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL frames,
+ //the texture pipeline will stop fetching this texture.
+
imagep->resetTextureStats();
imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures.
imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL);
+ imagep->resetMaxVirtualSizeResetCounter() ;
mMaxPixelArea = llmax(pixel_area, mMaxPixelArea);
mMinPixelArea = llmin(pixel_area, mMinPixelArea);
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 22fc595ea2..8ffcfc7ed4 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -1049,6 +1049,7 @@ protected: // Shared with LLVOAvatarSelf
*******************************************************************************/
}; // LLVOAvatar
-extern const F32 SELF_ADDITIONAL_PRI;
+extern const F32 SELF_ADDITIONAL_PRI;
+extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL;
#endif // LL_VO_AVATAR_H
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 8961d2c285..88896871b2 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -2032,7 +2032,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe
imagep->setBoostLevel(getAvatarBoostLevel());
imagep->resetTextureStats();
- imagep->setMaxVirtualSizeResetInterval(16);
+ imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL);
imagep->addTextureStats( desired_pixels / texel_area_ratio );
imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ;
imagep->forceUpdateBindStats() ;