Call display_startup() periodically during initilization to avoid buggy drivers/windows from issuing vpu recover erroneously.

This commit is contained in:
Shyotl
2012-01-23 20:36:25 -06:00
parent 6374f012de
commit c4e0122846

View File

@@ -849,10 +849,13 @@ bool idle_startup()
{
// Initialize all our tools. Must be done after saved settings loaded.
// NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton.
display_startup();
LLToolMgr::getInstance()->initTools();
display_startup();
// Quickly get something onscreen to look at.
gViewerWindow->initWorldUI();
display_startup();
}
if (show_connect_box)
@@ -867,15 +870,18 @@ bool idle_startup()
LL_ERRS("AppInit") << "Need to autologin or use command line with norender!" << LL_ENDL;
}
// Make sure the process dialog doesn't hide things
display_startup();
gViewerWindow->setShowProgress(FALSE);
display_startup();
// Load login history
std::string login_hist_filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
LLSavedLogins login_history = LLSavedLogins::loadFile(login_hist_filepath);
display_startup();
// Show the login dialog.
login_show(login_history);
display_startup();
if (login_history.size() > 0)
{
LLPanelLogin::setFields(*login_history.getEntries().rbegin());
@@ -888,6 +894,7 @@ bool idle_startup()
// </edit>
LLPanelLogin::giveFocus();
}
display_startup();
gSavedSettings.setBOOL("FirstRunThisInstall", FALSE);
@@ -899,9 +906,13 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
}
display_startup();
gViewerWindow->setNormalControlsVisible( FALSE );
display_startup();
gLoginMenuBarView->setVisible( TRUE );
display_startup();
gLoginMenuBarView->setEnabled( TRUE );
display_startup();
// Push our window frontmost
gViewerWindow->getWindow()->show();
@@ -911,7 +922,10 @@ bool idle_startup()
// first made visible.
#ifdef _WIN32
MSG msg;
while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) );
while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) )
{
display_startup();
}
#endif
timeout.reset();
return FALSE;
@@ -921,7 +935,7 @@ bool idle_startup()
{
// Don't do anything. Wait for the login view to call the login_callback,
// which will push us to the next state.
display_startup();
// Sleep so we don't spin the CPU
ms_sleep(1);
return FALSE;
@@ -1940,8 +1954,11 @@ bool idle_startup()
// Finish agent initialization. (Requires gSavedSettings, builds camera)
gAgent.init();
display_startup();
gAgentCamera.init();
display_startup();
set_underclothes_menu_options();
display_startup();
// Since we connected, save off the settings so the user doesn't have to
// type the name/password again if we crash.
@@ -1951,18 +1968,24 @@ bool idle_startup()
// Initialize classes w/graphics stuff.
//
gTextureList.doPrefetchImages();
display_startup();
LLSurface::initClasses();
display_startup();
LLFace::initClass();
display_startup();
LLDrawable::initClass();
display_startup();
// init the shader managers
AscentDayCycleManager::initClass();
display_startup();
// RN: don't initialize VO classes in drone mode, they are too closely tied to rendering
LLViewerObject::initVOClasses();
display_startup();
// This is where we used to initialize gWorldp. Original comment said:
@@ -1970,24 +1993,26 @@ bool idle_startup()
// User might have overridden far clip
LLWorld::getInstance()->setLandFarClip( gAgentCamera.mDrawDistance );
display_startup();
// Before we create the first region, we need to set the agent's mOriginGlobal
// This is necessary because creating objects before this is set will result in a
// bad mPositionAgent cache.
gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
display_startup();
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim, first_sim_size_x, first_sim_size_y);
display_startup();
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
regionp->setSeedCapability(gFirstSimSeedCap);
LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
display_startup();
// Set agent's initial region to be the one we just created.
gAgent.setRegion(regionp);
display_startup();
// Set agent's initial position, which will be read by LLVOAvatar when the avatar
// object is created. I think this must be done after setting the region. JC
gAgent.setPositionAgent(agent_start_position_region);
@@ -2008,6 +2033,7 @@ bool idle_startup()
{
LLStartUp::multimediaInit();
LLStartUp::setStartupState( STATE_FONT_INIT );
display_startup();
return FALSE;
}
@@ -2016,6 +2042,7 @@ bool idle_startup()
{
LLStartUp::fontInit();
LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
display_startup();
return FALSE;
}
@@ -2053,7 +2080,9 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState())
{
display_startup();
update_texture_fetch();
display_startup();
if ( gViewerWindow != NULL)
{ // This isn't the first logon attempt, so show the UI
@@ -2061,7 +2090,7 @@ bool idle_startup()
}
gLoginMenuBarView->setVisible( FALSE );
gLoginMenuBarView->setEnabled( FALSE );
display_startup();
LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0);
gViewerWindow->adjustControlRectanglesForFirstUse(window);
@@ -2108,17 +2137,22 @@ bool idle_startup()
{
//Set up cloud rendertypes. Passed argument is unused.
handleCloudSettingsChanged(LLSD());
display_startup();
// Move the progress view in front of the UI
gViewerWindow->moveProgressViewToFront();
display_startup();
LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
display_startup();
// set initial visibility of debug console
gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
display_startup();
if (gSavedSettings.getBOOL("ShowDebugStats"))
{
LLFloaterStats::showInstance();
display_startup();
}
}
@@ -2129,24 +2163,30 @@ bool idle_startup()
// register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted
register_viewer_callbacks(gMessageSystem);
display_startup();
// Debugging info parameters
gMessageSystem->setMaxMessageTime( 0.5f ); // Spam if decoding all msgs takes more than 500 ms
display_startup();
#ifndef LL_RELEASE_FOR_DOWNLOAD
gMessageSystem->setTimeDecodes( TRUE ); // Time the decode of each msg
gMessageSystem->setTimeDecodesSpamThreshold( 0.05f ); // Spam if a single msg takes over 50ms to decode
#endif
display_startup();
gXferManager->registerCallbacks(gMessageSystem);
display_startup();
LLStartUp::initNameCache();
display_startup();
// *Note: this is where gWorldMap used to be initialized.
// register null callbacks for audio until the audio system is initialized
gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL);
display_startup();
//reset statistics
LLViewerStats::getInstance()->resetStats();
@@ -2156,6 +2196,7 @@ bool idle_startup()
//
// Set up all of our statistics UI stuff.
//
display_startup();
init_stat_view();
}
@@ -2191,6 +2232,7 @@ bool idle_startup()
}
// Initialize FOV
LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle"));
display_startup();
// Move agent to starting location. The position handed to us by
// the space server is in global coordinates, but the agent frame
@@ -2201,6 +2243,7 @@ bool idle_startup()
gAgent.resetAxes(agent_start_look_at);
gAgentCamera.stopCameraAnimation();
gAgentCamera.resetCamera();
display_startup();
// Initialize global class data needed for surfaces (i.e. textures)
if (!gNoRender)
@@ -2216,6 +2259,8 @@ bool idle_startup()
LLGLState::checkTextureChannels();
}
display_startup();
LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
// For all images pre-loaded into viewer cache, decode them.
// Need to do this AFTER we init the sky
@@ -2229,6 +2274,8 @@ bool idle_startup()
}
LLStartUp::setStartupState( STATE_WORLD_WAIT );
display_startup();
// JC - Do this as late as possible to increase likelihood Purify
// will run.
LLMessageSystem* msg = gMessageSystem;
@@ -2256,6 +2303,7 @@ bool idle_startup()
NULL);
timeout.reset();
display_startup();
return FALSE;
}
@@ -2274,8 +2322,10 @@ bool idle_startup()
LLMessageSystem* msg = gMessageSystem;
while (msg->checkAllMessages(gFrameCount, gServicePump))
{
display_startup();
}
msg->processAcks();
display_startup();
return FALSE;
}
@@ -2286,6 +2336,7 @@ bool idle_startup()
{
LL_DEBUGS("AppInit") << "Connecting to region..." << LL_ENDL;
set_startup_status(0.60f, LLTrans::getString("LoginConnectingToRegion"), gAgent.mMOTD);
display_startup();
// register with the message system so it knows we're
// expecting this message
LLMessageSystem* msg = gMessageSystem;
@@ -2301,6 +2352,7 @@ bool idle_startup()
msg->newMessageFast(_PREHASH_EconomyDataRequest);
gAgent.sendReliableMessage();
}
display_startup();
// Create login effect
// But not on first login, because you can't see your avatar then
@@ -2315,6 +2367,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT
timeout.reset();
display_startup();
return FALSE;
}
@@ -2339,14 +2392,16 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "Awaiting AvatarInitComplete, got "
<< msg->getMessageName() << LL_ENDL;
}
display_startup();
}
msg->processAcks();
display_startup();
if (gAgentMovementCompleted)
{
LLStartUp::setStartupState( STATE_INVENTORY_SEND );
}
display_startup();
return FALSE;
}
@@ -2355,9 +2410,10 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_INVENTORY_SEND == LLStartUp::getStartupState())
{
display_startup();
// Inform simulator of our language preference
LLAgentLanguage::update();
display_startup();
// unpack thin inventory
LLUserAuth::options_t options;
options.clear();
@@ -2396,6 +2452,7 @@ bool idle_startup()
}
}
options.clear();
display_startup();
if(LLUserAuth::getInstance()->getOptions("inventory-skeleton", options))
{
if(!gInventory.loadSkeleton(options, gAgent.getID()))
@@ -2403,6 +2460,7 @@ bool idle_startup()
LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL;
}
}
display_startup();
// <edit> testing adding a local inventory folder...
if (gSavedSettings.getBOOL("AscentUseSystemFolder"))
@@ -2436,6 +2494,7 @@ bool idle_startup()
assets_folder->setPreferredType(LLFolderType::FT_NONE);
gInventory.addCategory(assets_folder);
}
display_startup();
// </edit>
options.clear();
@@ -2468,7 +2527,7 @@ bool idle_startup()
}
LLAvatarTracker::instance().addBuddyList(list);
}
display_startup();
options.clear();
if(LLUserAuth::getInstance()->getOptions("ui-config", options))
{
@@ -2487,6 +2546,7 @@ bool idle_startup()
}
}
}
display_startup();
options.clear();
bool show_hud = false;
if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options))
@@ -2512,6 +2572,7 @@ bool idle_startup()
}
}
}
display_startup();
// Either we want to show tutorial because this is the first login
// to a Linden Help Island or the user quit with the tutorial
// visible. JC
@@ -2530,12 +2591,15 @@ bool idle_startup()
{
gEventNotifier.load(options);
}
display_startup();
options.clear();
if(LLUserAuth::getInstance()->getOptions("classified_categories", options))
{
LLClassifiedInfo::loadCategories(options);
}
display_startup();
gInventory.buildParentChildMap();
display_startup();
llinfos << "Setting Inventory changed mask and notifying observers" << llendl;
gInventory.addChangedMask(LLInventoryObserver::ALL, LLUUID::null);
@@ -2550,30 +2614,33 @@ bool idle_startup()
LLAvatarTracker::instance().registerCallbacks(msg);
llinfos << " Landmark" << llendl;
LLLandmark::registerCallbacks(msg);
display_startup();
// request mute list
llinfos << "Requesting Mute List" << llendl;
LLMuteList::getInstance()->requestFromServer(gAgent.getID());
display_startup();
// Get L$ and ownership credit information
llinfos << "Requesting Money Balance" << llendl;
LLStatusBar::sendMoneyBalanceRequest();
display_startup();
// request all group information
llinfos << "Requesting Agent Data" << llendl;
gAgent.sendAgentDataUpdateRequest();
display_startup();
bool shown_at_exit = gSavedSettings.getBOOL("ShowInventory");
// Create the inventory views
llinfos << "Creating Inventory Views" << llendl;
LLInventoryView::showAgentInventory();
display_startup();
// Hide the inventory if it wasn't shown at exit
if(!shown_at_exit)
{
LLInventoryView::toggleVisibility(NULL);
}
display_startup();
// [RLVa:KB] - Checked: 2009-11-27 (RLVa-1.1.0f) | Added: RLVa-1.1.0f
if (rlv_handler_t::isEnabled())
@@ -2584,6 +2651,7 @@ bool idle_startup()
// [/RLVa:KB]
LLStartUp::setStartupState( STATE_MISC );
display_startup();
return FALSE;
}
@@ -2623,6 +2691,7 @@ bool idle_startup()
}
}
display_startup();
// We're successfully logged in.
gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE);
@@ -2638,11 +2707,14 @@ bool idle_startup()
// and make sure it's saved
gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
};
display_startup();
if (!gNoRender)
{
// JC: Initializing audio requests many sounds for download.
init_audio();
display_startup();
// JC: Initialize "active" gestures. This may also trigger
// many gesture downloads, if this is the user's first
@@ -2696,6 +2768,7 @@ bool idle_startup()
}
}
gDisplaySwapBuffers = TRUE;
display_startup();
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFuncFast(_PREHASH_SoundTrigger, hooked_process_sound_trigger);
@@ -2776,8 +2849,10 @@ bool idle_startup()
}
}
display_startup();
//DEV-17797. get null folder. Any items found here moved to Lost and Found
LLInventoryModelBackgroundFetch::instance().findLostItems();
display_startup();
LLStartUp::setStartupState( STATE_PRECACHE );
timeout.reset();
@@ -2786,6 +2861,7 @@ bool idle_startup()
if (STATE_PRECACHE == LLStartUp::getStartupState())
{
display_startup();
F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
// We now have an inventory skeleton, so if this is a user's first
@@ -2802,7 +2878,7 @@ bool idle_startup()
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
display_startup();
// We now have an inventory skeleton, so if this is a user's first
// login, we can start setting up their clothing and avatar
// appearance. This helps to avoid the generic "Ruth" avatar in
@@ -2816,7 +2892,9 @@ bool idle_startup()
// Start loading the wearables, textures, gestures
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
display_startup();
// wait precache-delay and for agent's avatar or a lot longer.
if(((timeout_frac > 1.f) && isAgentAvatarValid())
|| (timeout_frac > 3.f))
@@ -2834,6 +2912,7 @@ bool idle_startup()
{
LLViewerShaderMgr::sInitialized = TRUE;
LLViewerShaderMgr::instance()->setShaders();
display_startup();
}
}
@@ -2863,6 +2942,8 @@ bool idle_startup()
return TRUE;
}
display_startup();
if (wearables_time > MAX_WEARABLES_TIME)
{
LLNotificationsUtil::add("ClothingLoading");
@@ -2894,17 +2975,20 @@ bool idle_startup()
}
}
display_startup();
update_texture_fetch();
display_startup();
set_startup_status(0.9f + 0.1f * wearables_time / MAX_WEARABLES_TIME,
LLTrans::getString("LoginDownloadingClothing").c_str(),
gAgent.mMOTD.c_str());
display_startup();
return TRUE;
}
if (STATE_CLEANUP == LLStartUp::getStartupState())
{
set_startup_status(1.0, "", "");
display_startup();
LLViewerParcelMedia::loadDomainFilterList();
// Let the map know about the inventory.
@@ -2926,6 +3010,7 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL;
gViewerWindow->setShowProgress(FALSE);
gViewerWindow->setProgressCancelButtonVisible(FALSE);
display_startup();
// We're not away from keyboard, even though login might have taken
// a while. JC
@@ -2957,6 +3042,7 @@ bool idle_startup()
LLUserAuth::getInstance()->reset();
LLStartUp::setStartupState( STATE_STARTED );
display_startup();
if (gSavedSettings.getBOOL("SpeedRez"))
{
@@ -2987,6 +3073,7 @@ bool idle_startup()
// reset timers now that we are running "logged in" logic
LLFastTimer::reset();
display_startup();
return TRUE;
}