Xiaohong Bao 2013-08-16 17:59:24 -06:00
commit 4290365ebb
3 changed files with 42 additions and 22 deletions

View File

@ -72,6 +72,8 @@
#include "llsdserialize.h"
#include "llvieweroctree.h"
#include "llviewerdisplay.h"
#include "llviewerwindow.h"
#include "llprogressview.h"
#ifdef LL_WINDOWS
#pragma warning(disable:4355)
@ -90,7 +92,7 @@ const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE;
S32 LLViewerRegion::sLastCameraUpdated = 0;
S32 LLViewerRegion::sNewObjectCreationThrottle = 0;
S32 LLViewerRegion::sNewObjectCreationThrottle = -1;
typedef std::map<std::string, std::string> CapabilityMap;
@ -1205,7 +1207,12 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
max_update_time -= update_timer.getElapsedTimeF32();
if(max_update_time < 0.f)
if(gViewerWindow->getProgressView()->getVisible())
{
//in case rendering pipeline is not started yet.
mImpl->mVOCachePartition->cull(*(LLViewerCamera::getInstance()), false);
}
else if(max_update_time < 0.f)
{
return did_update;
}
@ -1226,23 +1233,28 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
void LLViewerRegion::calcNewObjectCreationThrottle()
{
static LLCachedControl<S32> new_object_creation_throttle(gSavedSettings,"NewObjectCreationThrottle");
static LLFrameTimer timer;
sNewObjectCreationThrottle = new_object_creation_throttle;
if(LLStartUp::getStartupState() < STATE_STARTED || gTeleportDisplay)
//
//sNewObjectCreationThrottle =
//-2: throttle is disabled because either the screen is showing progress view, or immediate after the screen is not black
//-1: throttle is disabled by the debug setting
//0: no new object creation is allowed
//>0: valid throttling number
//
if(gViewerWindow->getProgressView()->getVisible())
{
sNewObjectCreationThrottle = -1; //cancel the throttling
sNewObjectCreationThrottle = -2; //cancel the throttling
timer.reset();
}
else if(sNewObjectCreationThrottle < 0) //just recoved from the login/teleport screen
{
if(new_object_creation_throttle > 0)
if(new_object_creation_throttle > 0 && timer.getElapsedTimeF32() > 2.0f) //wait for two seconds to reset the throttle
{
sNewObjectCreationThrottle = 4096; //a big number
sNewObjectCreationThrottle = new_object_creation_throttle; //reset
}
}
else
{
sNewObjectCreationThrottle = llmax((S32)new_object_creation_throttle, (S32)(sNewObjectCreationThrottle >> 1));
}
}
BOOL LLViewerRegion::isViewerCameraStatic()
@ -1295,7 +1307,7 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time)
mLastVisitedEntry = *iter;
}
mInvisibilityCheckHistory <<= 2;
mInvisibilityCheckHistory <<= 1;
if(!delete_list.empty())
{
mInvisibilityCheckHistory |= 1;

View File

@ -59,7 +59,8 @@
#include "llxuiparser.h"
#include "lltracerecording.h"
#include "llviewerdisplay.h"
#include "llstartup.h"
#include "llviewerwindow.h"
#include "llprogressview.h"
////////////////////////////////////////////////////////////////////////////
void (*LLViewerTextureList::sUUIDCallback)(void **, const LLUUID&) = NULL;
@ -756,12 +757,9 @@ void LLViewerTextureList::updateImagesDecodePriorities()
F32 lazy_flush_timeout = 30.f; // stop decoding
F32 max_inactive_time = 20.f; // actually delete
S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference
if(LLStartUp::getStartupState() < STATE_STARTED)
{
//do not remove pre-fetched images if viewer does not finish logging in.
lazy_flush_timeout = 30000.f;
max_inactive_time = 20000.f;
}
//reset imagep->getLastReferencedTimer() when screen is showing the progress view to avoid removing pre-fetched textures too soon.
bool reset_timer = gViewerWindow->getProgressView()->getVisible();
static const S32 MAX_PRIO_UPDATES = gSavedSettings.getS32("TextureFetchUpdatePriorities"); // default: 32
const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds.value()) + 1, MAX_PRIO_UPDATES);
@ -789,7 +787,11 @@ void LLViewerTextureList::updateImagesDecodePriorities()
S32 num_refs = imagep->getNumRefs();
if (num_refs == min_refs)
{
if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > lazy_flush_timeout)
if(reset_timer)
{
imagep->getLastReferencedTimer()->reset();
}
else if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > lazy_flush_timeout)
{
// Remove the unused image from the image list
deleteImage(imagep);
@ -818,7 +820,11 @@ void LLViewerTextureList::updateImagesDecodePriorities()
}
else if(imagep->isInactive())
{
if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > max_inactive_time)
if(reset_timer)
{
imagep->getLastReferencedTimer()->reset();
}
else if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > max_inactive_time)
{
imagep->setDeletionCandidate() ;
}

View File

@ -112,6 +112,7 @@
#include "llfloaterpathfindingcharacters.h"
#include "llpathfindingpathtool.h"
#include "llscenemonitor.h"
#include "llprogressview.h"
#ifdef _DEBUG
// Debug indices is disabled for now for debug performance - djs 4/24/02
@ -2535,7 +2536,8 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
LLVOCachePartition* vo_part = region->getVOCachePartition();
if(vo_part)
{
vo_part->cull(camera, can_use_occlusion && use_occlusion && !gUseWireframe);
bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe && !gViewerWindow->getProgressView()->getVisible();
vo_part->cull(camera, do_occlusion_cull);
}
}