From 70bbcf7c2d14e7e6e97e0297e01e0dae3565af13 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 8 Apr 2010 16:41:56 -0700 Subject: EXT-5849 - crash in LLView::drawChildren() added logging to help track down cause --- indra/llui/llfloater.cpp | 2 ++ indra/llui/llview.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index ab14c08948..6b436bc0cd 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -563,6 +563,7 @@ void LLFloater::handleVisibilityChange ( BOOL new_visibility ) void LLFloater::openFloater(const LLSD& key) { + llinfos << "Opening floater " << getName() << llendl; mKey = key; // in case we need to open ourselves again if (getSoundFlags() != SILENT @@ -603,6 +604,7 @@ void LLFloater::openFloater(const LLSD& key) void LLFloater::closeFloater(bool app_quitting) { + llinfos << "Closing floater " << getName() << llendl; if (app_quitting) { LLFloater::sQuitting = true; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index d0dbc99bc7..7f0c93ec8a 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1321,6 +1321,8 @@ void LLView::drawChildren() if (viewp->getVisible() && viewp->getRect().isValid()) { + // check for bad data + llassert_always(viewp->getVisible() == TRUE); // Only draw views that are within the root view localRectToScreen(viewp->getRect(),&screenRect); if ( rootRect.overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect)) -- cgit v1.2.3 From e02e45fd76487fd2f0782b84ed5336a8f43cecac Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 29 Mar 2010 18:36:47 -0700 Subject: Fix for EXT-6615 (SL webkit no longer reports "Second Life" in the HTTP_USER_AGENT) The issue here is that initBrowserWindow() was doing the wrong thing if it got called after the set_user_agent message was received. Made the handler for the set_user_agent message save the string in a member variable (mUserAgent). Initialize mUserAgent to the default string in the MediaPluginWebKit constructor. initBrowserWindow() now sets the user agent string from mUserAgent instead of from a literal. --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 0462fce236..5260636e11 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -89,6 +89,7 @@ private: std::string mProfileDir; std::string mHostLanguage; + std::string mUserAgent; bool mCookiesEnabled; bool mJavascriptEnabled; bool mPluginsEnabled; @@ -300,7 +301,7 @@ private: LLQtWebKit::getInstance()->addObserver( mBrowserWindowId, this ); // append details to agent string - LLQtWebKit::getInstance()->setBrowserAgentId( "LLPluginMedia Web Browser" ); + LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); #if !LL_QTWEBKIT_USES_PIXMAPS // don't flip bitmap @@ -675,6 +676,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ mHostLanguage = "en"; // default to english mJavascriptEnabled = true; // default to on mPluginsEnabled = true; // default to on + mUserAgent = "LLPluginMedia Web Browser"; } MediaPluginWebKit::~MediaPluginWebKit() @@ -1086,8 +1088,8 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) } else if(message_name == "set_user_agent") { - std::string user_agent = message_in.getValue("user_agent"); - LLQtWebKit::getInstance()->setBrowserAgentId( user_agent ); + mUserAgent = message_in.getValue("user_agent"); + LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); } else if(message_name == "init_history") { -- cgit v1.2.3 From d34588b7a7f280a49efb51e29a2cc3138a9db024 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 8 Apr 2010 17:08:32 -0600 Subject: fix for EXT-6278: profile picture is blurry / fuzzy if IM is opened first. --- indra/newview/llviewertexture.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9fbffdac35..84c5c454bd 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1426,15 +1426,15 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) //virtual void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height) { - if(mKnownDrawWidth != width || mKnownDrawHeight != height) + if(mKnownDrawWidth < width || mKnownDrawHeight < height) { - mKnownDrawWidth = width; - mKnownDrawHeight = height; + mKnownDrawWidth = llmax(mKnownDrawWidth, width) ; + mKnownDrawHeight = llmax(mKnownDrawHeight, height) ; mKnownDrawSizeChanged = TRUE ; mFullyLoaded = FALSE ; } - addTextureStats((F32)(width * height)); + addTextureStats((F32)(mKnownDrawWidth * mKnownDrawHeight)); } //virtual -- cgit v1.2.3 From 3b9e4f43ed80da14cff984e2cde29dee534e66cd Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Thu, 8 Apr 2010 17:40:17 -0700 Subject: Enabling Watchdog. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 92226f4148..55e28fc59b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10600,7 +10600,7 @@ Type Boolean Value - 0 + 1 WaterEditPresets -- cgit v1.2.3 From 88df86bcc3ed96b727ce408ef79134a910f807b1 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 7 Apr 2010 11:51:41 -0600 Subject: fix for all wierd crashes happening to lltexturecache.cpp, cuased by running viewer 2.0 and viewer 1.23 at the same time. Specifically for the following jiras: EXT-6692: crash at LLTextureCache::readEntryFromHeaderImmediately [secondlife-bin lltexturecache.cpp:1145] EXT-6691: crash at LLTextureCache::writeEntryToHeaderImmediately [secondlife-bin lltexturecache.cpp:1126] possible fix for EXT-6567: crash at LLImageBase::allocateData [secondlife-bin llimage.cpp:170] --- indra/newview/llappviewer.cpp | 43 +++++++++++++++++++++++----------- indra/newview/llappviewer.h | 2 ++ indra/newview/lltexturecache.cpp | 50 ++++++++++++++++++++++++++++++++++------ indra/newview/lltexturecache.h | 3 ++- 4 files changed, 77 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 11c252406a..cdd553b9b4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3000,9 +3000,36 @@ void LLAppViewer::migrateCacheDirectory() #endif // LL_WINDOWS || LL_DARWIN } +//static +S32 LLAppViewer::getCacheVersion() +{ + static const S32 cache_version = 7; + + return cache_version ; +} + bool LLAppViewer::initCache() { mPurgeCache = false; + BOOL disable_texture_cache = FALSE ; + BOOL read_only = mSecondInstance ? TRUE : FALSE; + LLAppViewer::getTextureCache()->setReadOnly(read_only) ; + + if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getCacheVersion()) + { + if(read_only) + { + disable_texture_cache = TRUE ; //if the cache version of this viewer is different from the running one, this viewer can not use the texture cache. + } + else + { + mPurgeCache = true; // Purge cache if the version number is different. + gSavedSettings.setS32("LocalCacheVersion", LLAppViewer::getCacheVersion()); + } + } + + if(!read_only) + { // Purge cache if user requested it if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) @@ -3010,16 +3037,6 @@ bool LLAppViewer::initCache() gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); mPurgeCache = true; } - // Purge cache if it belongs to an old version - else - { - static const S32 cache_version = 6; - if (gSavedSettings.getS32("LocalCacheVersion") != cache_version) - { - mPurgeCache = true; - gSavedSettings.setS32("LocalCacheVersion", cache_version); - } - } // We have moved the location of the cache directory over time. migrateCacheDirectory(); @@ -3034,6 +3051,7 @@ bool LLAppViewer::initCache() gSavedSettings.setString("CacheLocation", new_cache_location); gSavedSettings.setString("CacheLocationTopFolder", gDirUtilp->getBaseFileName(new_cache_location)); } + } if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"))) { @@ -3042,7 +3060,7 @@ bool LLAppViewer::initCache() gSavedSettings.setString("CacheLocationTopFolder", ""); } - if (mPurgeCache) + if (mPurgeCache && !read_only) { LLSplashScreen::update(LLTrans::getString("StartupClearingCache")); purgeCache(); @@ -3052,13 +3070,12 @@ bool LLAppViewer::initCache() // Init the texture cache // Allocate 80% of the cache size for textures - BOOL read_only = mSecondInstance ? TRUE : FALSE; const S32 MB = 1024*1024; S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; const S64 MAX_CACHE_SIZE = 1024*MB; cache_size = llmin(cache_size, MAX_CACHE_SIZE); S64 texture_cache_size = ((cache_size * 8)/10); - S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, read_only); + S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, disable_texture_cache); texture_cache_size -= extra; LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS")); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index a915b7fa50..60645c46d4 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -102,6 +102,8 @@ public: static LLImageDecodeThread* getImageDecodeThread() { return sImageDecodeThread; } static LLTextureFetch* getTextureFetch() { return sTextureFetch; } + static S32 getCacheVersion() ; + const std::string& getSerialNumber() { return mSerialNumber; } bool getPurgeCache() const { return mPurgeCache; } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 7a0712f8aa..290ac8dc04 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -742,7 +742,7 @@ LLTextureCache::LLTextureCache(bool threaded) mHeaderMutex(NULL), mListMutex(NULL), mHeaderAPRFile(NULL), - mReadOnly(FALSE), + mReadOnly(TRUE), //do not allow to change the texture cache until setReadOnly() is called. mTexturesSizeTotal(0), mDoPurge(FALSE) { @@ -929,13 +929,16 @@ U32 LLTextureCache::sCacheMaxEntries = MAX_REASONABLE_FILE_SIZE / TEXTURE_CACHE_ S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit const char* entries_filename = "texture.entries"; const char* cache_filename = "texture.cache"; -const char* textures_dirname = "textures"; +const char* old_textures_dirname = "textures"; +//change the location of the texture cache to prevent from being deleted by old version viewers. +const char* textures_dirname = "texturecache"; void LLTextureCache::setDirNames(ELLPath location) { std::string delem = gDirUtilp->getDirDelimiter(); - mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, entries_filename); - mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, cache_filename); + + mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, entries_filename); + mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, cache_filename); mTexturesDirName = gDirUtilp->getExpandedFilename(location, textures_dirname); } @@ -947,15 +950,37 @@ void LLTextureCache::purgeCache(ELLPath location) { setDirNames(location); llassert_always(mHeaderAPRFile == NULL); - LLAPRFile::remove(mHeaderEntriesFileName, getLocalAPRFilePool()); - LLAPRFile::remove(mHeaderDataFileName, getLocalAPRFilePool()); + + //remove the legacy cache if exists + std::string texture_dir = mTexturesDirName ; + mTexturesDirName = gDirUtilp->getExpandedFilename(location, old_textures_dirname); + if(LLFile::isdir(mTexturesDirName)) + { + std::string file_name = gDirUtilp->getExpandedFilename(location, entries_filename); + LLAPRFile::remove(file_name, getLocalAPRFilePool()); + + file_name = gDirUtilp->getExpandedFilename(location, cache_filename); + LLAPRFile::remove(file_name, getLocalAPRFilePool()); + + purgeAllTextures(true); + } + mTexturesDirName = texture_dir ; } + + //remove the current texture cache. purgeAllTextures(true); } -S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only) +//is called in the main thread before initCache(...) is called. +void LLTextureCache::setReadOnly(BOOL read_only) { mReadOnly = read_only; +} + +//called in the main thread. +S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL disable_texture_cache) +{ + llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized. S64 header_size = (max_size * 2) / 10; S64 max_entries = header_size / TEXTURE_CACHE_ENTRY_SIZE; @@ -968,6 +993,15 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only) sCacheMaxTexturesSize = max_size; max_size -= sCacheMaxTexturesSize; + if(disable_texture_cache) //the texture cache is disabled + { + llinfos << "The texture cache is disabled!" << llendl ; + setReadOnly(TRUE) ; + purgeAllTextures(true); + + return max_size ; + } + LL_INFOS("TextureCache") << "Headers: " << sCacheMaxEntries << " Textures size: " << sCacheMaxTexturesSize/(1024*1024) << " MB" << LL_ENDL; @@ -986,6 +1020,8 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only) readHeaderCache(); purgeTextures(true); // calc mTexturesSize and make some room in the texture cache if we need it + llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized. + return max_size; // unused cache space } diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index ca8815ee7e..5dc06ff401 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -110,7 +110,8 @@ public: /*virtual*/ S32 update(U32 max_time_ms); void purgeCache(ELLPath location); - S64 initCache(ELLPath location, S64 maxsize, BOOL read_only); + void setReadOnly(BOOL read_only) ; + S64 initCache(ELLPath location, S64 maxsize, BOOL disable_texture_cache); handle_t readFromCache(const std::string& local_filename, const LLUUID& id, U32 priority, S32 offset, S32 size, ReadResponder* responder); -- cgit v1.2.3 From 8dd401e4a12c4ec277b4474cea2ef0824f5c09b8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 1 Apr 2010 11:39:01 -0600 Subject: fix for EXT-6678: crash at LLTextureCache::openAndReadEntry [secondlife-bin lltexturecache.cpp:1111] --- indra/newview/lltexturecache.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 290ac8dc04..dce7d8da40 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1144,7 +1144,16 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create { readEntryFromHeaderImmediately(idx, entry) ; } - llassert_always(entry.mImageSize > entry.mBodySize); + if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why + { + llwarns << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << llendl ; + + //erase this entry and the cached texture from the cache. + std::string tex_filename = getTextureFileName(id); + removeEntry(idx, entry, tex_filename) ; + mUpdatedEntryMap.erase(idx) ; + idx = -1 ; + } } return idx; } -- cgit v1.2.3 From 7bd603544e07b54acc2828e8b9763445d82b8c80 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 2 Apr 2010 10:33:20 -0600 Subject: add some debug code for EXT-5394: Crash in LLViewerMediaImpl::calculateInterest() --- indra/newview/llviewermedia.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2fcd3f1114..0f5a984188 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2701,7 +2701,13 @@ void LLViewerMediaImpl::calculateInterest() if(!mObjectList.empty()) { // Just use the first object in the list. We could go through the list and find the closest object, but this should work well enough. - LLVector3d global_delta = gAgent.getPositionGlobal() - (*mObjectList.begin())->getPositionGlobal(); + std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; + LLVOVolume* objp = *iter ; + llassert_always(objp != NULL) ; + + LLVector3d obj_global = objp->getPositionGlobal() ; + LLVector3d agent_global = gAgent.getPositionGlobal() ; + LLVector3d global_delta = agent_global - obj_global ; mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same. } -- cgit v1.2.3 From a0022e65ec41b1ce0868d75643338510921d1b6b Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 29 Mar 2010 11:28:42 -0600 Subject: fix for EXT-6566: crash at LLTextureCache::updatedHeaderEntriesFile [secondlife-bin lltexturecache.cpp:1292] --- indra/newview/lltexturecache.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index dce7d8da40..aa081ff7bb 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1266,9 +1266,17 @@ U32 LLTextureCache::openAndReadEntries(std::vector& entries) mFreeList.clear(); mTexturesSizeTotal = 0; - LLAPRFile* aprfile = openHeaderEntriesFile(true, 0); + LLAPRFile* aprfile = NULL; + if(mUpdatedEntryMap.empty()) + { + aprfile = openHeaderEntriesFile(true, (S32)sizeof(EntriesInfo)); + } + else //update the header file first. + { + aprfile = openHeaderEntriesFile(false, 0); updatedHeaderEntriesFile() ; aprfile->seek(APR_SET, (S32)sizeof(EntriesInfo)); + } for (U32 idx=0; idx Date: Mon, 29 Mar 2010 11:32:47 -0600 Subject: fix for EXT-6435: crash at writeEntriesAndClose: ASSERT (num_entries == mHeaderEntriesInfo.mEntries) --- indra/newview/lltexturecache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index aa081ff7bb..67b0ca216e 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -852,8 +852,8 @@ bool LLTextureCache::updateTextureEntryList(const LLUUID& id, S32 bodysize) } else if (oldbodysize != entry.mBodySize) { - // TODO: change to llwarns - llerrs << "Entry mismatch in mTextureSizeMap / mHeaderIDMap" + // only happens to 64 bits systems, do not know why. + llwarns << "Entry mismatch in mTextureSizeMap / mHeaderIDMap" << " idx=" << idx << " oldsize=" << oldbodysize << " entrysize=" << entry.mBodySize << llendl; } updateEntry(idx, entry, entry.mImageSize, bodysize); -- cgit v1.2.3 From 09d488e20bed2f8c8397ca483e83bc59687fff87 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 25 Mar 2010 17:14:27 -0600 Subject: more fix for EXT-5711: Some textures loading from cache seems jammed. and possible fix for EXT-5704: FPS drop, and this could be cause freez and crash. --- indra/llcommon/llqueuedthread.cpp | 5 ++++- indra/newview/llappviewer.cpp | 38 +++++++++++++++++++++++++------------- indra/newview/lltexturefetch.cpp | 23 ++++++++++++++++------- indra/newview/llviewertexture.cpp | 14 +++++++------- 4 files changed, 52 insertions(+), 28 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 06ceeb2bc3..809a626c93 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -133,8 +133,11 @@ S32 LLQueuedThread::updateQueue(U32 max_time_ms) if (mThreaded) { pending = getPending(); + if(pending > 0) + { unpause(); } + } else { while (pending > 0) @@ -459,7 +462,7 @@ S32 LLQueuedThread::processNextRequest() req->setStatus(STATUS_QUEUED); mRequestQueue.insert(req); unlockData(); - if (mThreaded && start_priority <= PRIORITY_LOW) + if (mThreaded && start_priority < PRIORITY_NORMAL) { ms_sleep(1); // sleep the thread a little } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cdd553b9b4..3e7ef26bcd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1107,12 +1107,15 @@ bool LLAppViewer::mainLoop() ms_sleep(500); } - + static const F64 FRAME_SLOW_THRESHOLD = 0.5; //2 frames per seconds const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms const F64 max_idle_time = run_multiple_threads ? min_idle_time : llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second idleTimer.reset(); - while(1) + bool is_slow = (frameTimer.getElapsedTimeF64() > FRAME_SLOW_THRESHOLD) ; + S32 total_work_pending = 0; + S32 total_io_pending = 0; + while(!is_slow)//do not unpause threads if the frame rates are very low. { S32 work_pending = 0; S32 io_pending = 0; @@ -1143,6 +1146,8 @@ bool LLAppViewer::mainLoop() ms_sleep(llmin(io_pending/100,100)); // give the vfs some time to catch up } + total_work_pending += work_pending ; + total_io_pending += io_pending ; F64 frame_time = frameTimer.getElapsedTimeF64(); F64 idle_time = idleTimer.getElapsedTimeF64(); if (frame_time >= min_frame_time && @@ -1152,25 +1157,32 @@ bool LLAppViewer::mainLoop() break; } } - if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && - (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) - { - gFrameStalls++; - } - frameTimer.reset(); // Prevent the worker threads from running while rendering. // if (LLThread::processorCount()==1) //pause() should only be required when on a single processor client... if (run_multiple_threads == FALSE) { - LLFastTimer ftm(FTM_PAUSE_THREADS); - + //LLFastTimer ftm(FTM_PAUSE_THREADS); //not necessary. + + if(!total_work_pending) //pause texture fetching threads if nothing to process. + { LLAppViewer::getTextureCache()->pause(); LLAppViewer::getImageDecodeThread()->pause(); - // LLAppViewer::getTextureFetch()->pause(); // Don't pause the fetch (IO) thread + LLAppViewer::getTextureFetch()->pause(); + } + if(!total_io_pending) //pause file threads if nothing to process. + { + LLVFSThread::sLocal->pause(); + LLLFSThread::sLocal->pause(); + } + } + + if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && + (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) + { + gFrameStalls++; } - //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering. - //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering. + frameTimer.reset(); resumeMainloopTimeout(); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 1c7b3a0fe0..2ea6e5936d 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -292,7 +292,10 @@ public: const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - if ((gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog")) || (gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"))) + static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog"); + static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); + + if (log_to_viewer_log || log_to_sim) { mFetcher->mTextureInfo.setRequestStartTime(mID, mStartTime); U64 timeNow = LLTimer::getTotalTime(); @@ -715,10 +718,10 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == LOAD_FROM_NETWORK) { - bool get_url = gSavedSettings.getBOOL("ImagePipelineUseHTTP"); - if (!mUrl.empty()) get_url = false; + static LLCachedControl use_http(gSavedSettings,"ImagePipelineUseHTTP"); + // if (mHost != LLHost::invalid) get_url = false; - if ( get_url ) + if ( use_http && mUrl.empty())//get http url. { LLViewerRegion* region = NULL; if (mHost == LLHost::invalid) @@ -1717,7 +1720,8 @@ S32 LLTextureFetch::update(U32 max_time_ms) { S32 res; - mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); + static LLCachedControl band_width(gSavedSettings,"ThrottleBandwidthKBPS"); + mMaxBandwidth = band_width ; res = LLWorkerThread::update(max_time_ms); @@ -1923,7 +1927,9 @@ void LLTextureFetch::sendRequestListToSimulators() // llinfos << "IMAGE REQUEST: " << req->mID << " Discard: " << req->mDesiredDiscard // << " Packet: " << packet << " Priority: " << req->mImagePriority << llendl; - if ((gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog")) || (gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"))) + static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog"); + static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); + if (log_to_viewer_log || log_to_sim) { mTextureInfo.setRequestStartTime(req->mID, LLTimer::getTotalTime()); mTextureInfo.setRequestOffset(req->mID, 0); @@ -2144,7 +2150,10 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1 if(packet_num >= (worker->mTotalPackets - 1)) { - if ((gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog")) || (gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"))) + static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog"); + static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); + + if (log_to_viewer_log || log_to_sim) { U64 timeNow = LLTimer::getTotalTime(); mTextureInfo.setRequestSize(id, worker->mFileSize); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 84c5c454bd..a5adb11c53 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1578,12 +1578,12 @@ F32 LLViewerFetchedTexture::calcDecodePriority() } else if (!isJustBound() && mCachedRawImageReady) { - //if(mBoostLevel < BOOST_HIGH) - //{ - // // We haven't rendered this in a while, de-prioritize it - // desired_discard += 2; - //} - //else + if(mBoostLevel < BOOST_HIGH) + { + // We haven't rendered this in a while, de-prioritize it + desired_discard += 2; + } + else { // We haven't rendered this in the last half second, and we have a cached raw image, leave the desired discard as-is desired_discard = cur_discard; @@ -1591,7 +1591,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority() } S32 ddiscard = cur_discard - desired_discard; - ddiscard = llclamp(ddiscard, 0, MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY); + ddiscard = llclamp(ddiscard, -1, MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY); priority = (ddiscard + 1) * PRIORITY_DELTA_DISCARD_LEVEL_FACTOR; } -- cgit v1.2.3 From 69e6c4d947064104f674c0f2dee6750c845d30cf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 7 Apr 2010 16:29:06 -0700 Subject: EXT-6693 - [crashhunters] crash in LLPopupView::handleMouseEvent --- indra/newview/llpopupview.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index b010f4d72f..7cde350d5a 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -104,8 +104,13 @@ BOOL LLPopupView::handleMouseEvent(boost::function func S32 x, S32 y, bool close_popups) { - for (popup_list_t::iterator popup_it = mPopups.begin(); - popup_it != mPopups.end();) + BOOL handled = FALSE; + + // make a copy of list of popups, in case list is modified during mouse event handling + popup_list_t popups(mPopups); + for (popup_list_t::iterator popup_it = popups.begin(), popup_end = popups.end(); + popup_it != popup_end; + ++popup_it) { LLView* popup = popup_it->get(); if (!popup @@ -121,23 +126,19 @@ BOOL LLPopupView::handleMouseEvent(boost::function func { if (func(popup, popup_x, popup_y)) { - return TRUE; + handled = TRUE; + break; } } if (close_popups) { - popup_list_t::iterator cur_popup_it = popup_it++; - mPopups.erase(cur_popup_it); + mPopups.remove(*popup_it); popup->onTopLost(); } - else - { - ++popup_it; - } } - return FALSE; + return handled; } -- cgit v1.2.3 From b182122546d84d2c13b64c2fe72c6c9c7c0c4ae1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 30 Mar 2010 15:51:40 +0100 Subject: EXT-6589 "Are you sure you want to teleport.." dialog has broken "[LOCATION]" tag --- indra/newview/llpanelplaces.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index f9ba6f625d..b4bf2125cc 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -551,7 +551,9 @@ void LLPanelPlaces::onTeleportButtonClicked() { LLSD payload; payload["asset_id"] = mItem->getAssetUUID(); - LLNotificationsUtil::add("TeleportFromLandmark", LLSD(), payload); + LLSD args; + args["LOCATION"] = mItem->getName(); + LLNotificationsUtil::add("TeleportFromLandmark", args, payload); } else if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || -- cgit v1.2.3 From 22d6992f95c2417d89be89cc12361bffb246b6ff Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 31 Mar 2010 15:24:10 +0100 Subject: EXT-2418 - improved cursors for sit/open/buy - the neglected Linux part. --- indra/llwindow/llwindowsdl.cpp | 3 +++ indra/newview/res-sdl/toolbuy.BMP | Bin 0 -> 3126 bytes indra/newview/res-sdl/toolopen.BMP | Bin 0 -> 3126 bytes indra/newview/res-sdl/toolsit.BMP | Bin 0 -> 3126 bytes 4 files changed, 3 insertions(+) create mode 100644 indra/newview/res-sdl/toolbuy.BMP create mode 100644 indra/newview/res-sdl/toolopen.BMP create mode 100644 indra/newview/res-sdl/toolsit.BMP (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index efa0110f8b..4b7daf553b 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2074,6 +2074,9 @@ void LLWindowSDL::initCursors() mSDLCursors[UI_CURSOR_TOOLPAUSE] = makeSDLCursorFromBMP("toolpause.BMP",0,0); mSDLCursors[UI_CURSOR_TOOLMEDIAOPEN] = makeSDLCursorFromBMP("toolmediaopen.BMP",0,0); mSDLCursors[UI_CURSOR_PIPETTE] = makeSDLCursorFromBMP("lltoolpipette.BMP",2,28); + mSDLCursors[UI_CURSOR_TOOLSIT] = makeSDLCursorFromBMP("toolsit.BMP",20,15); + mSDLCursors[UI_CURSOR_TOOLBUY] = makeSDLCursorFromBMP("toolbuy.BMP",20,15); + mSDLCursors[UI_CURSOR_TOOLOPEN] = makeSDLCursorFromBMP("toolopen.BMP",20,15); if (getenv("LL_ATI_MOUSE_CURSOR_BUG") != NULL) { llinfos << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << llendl; diff --git a/indra/newview/res-sdl/toolbuy.BMP b/indra/newview/res-sdl/toolbuy.BMP new file mode 100644 index 0000000000..07e9273721 Binary files /dev/null and b/indra/newview/res-sdl/toolbuy.BMP differ diff --git a/indra/newview/res-sdl/toolopen.BMP b/indra/newview/res-sdl/toolopen.BMP new file mode 100644 index 0000000000..5b87979304 Binary files /dev/null and b/indra/newview/res-sdl/toolopen.BMP differ diff --git a/indra/newview/res-sdl/toolsit.BMP b/indra/newview/res-sdl/toolsit.BMP new file mode 100644 index 0000000000..8ce59ae97a Binary files /dev/null and b/indra/newview/res-sdl/toolsit.BMP differ -- cgit v1.2.3 From c5756c3f0f024c7d95cd7766573f8191befc7427 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 9 Apr 2010 00:09:12 -0600 Subject: merged from viewer-trunk, fix for EXT-6780: to make LLImageBase::allocateData() thread-safe. Also include some debug code for EXT-6567: crash at LLImageBase::allocateData(). --- indra/llimage/llimage.cpp | 30 +++++++++++++++++++++--------- indra/llimage/llimage.h | 14 ++++++-------- indra/newview/llviewermenufile.cpp | 5 ++--- 3 files changed, 29 insertions(+), 20 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7d0de18c7c..0874f574c5 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -93,9 +93,10 @@ LLImageBase::LLImageBase() mWidth(0), mHeight(0), mComponents(0), + mBadBufferAllocation(false), + mAllowOverSize(false), mMemType(LLMemType::MTYPE_IMAGEBASE) { - mBadBufferAllocation = FALSE ; } // virtual @@ -134,8 +135,6 @@ void LLImageBase::sanityCheck() } } -BOOL LLImageBase::sSizeOverride = FALSE; - // virtual void LLImageBase::deleteData() { @@ -157,23 +156,32 @@ U8* LLImageBase::allocateData(S32 size) llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl; } } - if (size < 1 || (size > 4096*4096*16 && sSizeOverride == FALSE)) + + //make this function thread-safe. + static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16 ; //256 MB + if (size < 1 || size > MAX_BUFFER_SIZE) { llinfos << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << llendl ; + if(mAllowOverSize) + { + llinfos << "Oversize: " << size << llendl ; + } + else + { llerrs << "LLImageBase::allocateData: bad size: " << size << llendl; } - + } if (!mData || size != mDataSize) { deleteData(); // virtual - mBadBufferAllocation = FALSE ; + mBadBufferAllocation = false ; mData = new U8[size]; if (!mData) { llwarns << "allocate image data: " << size << llendl; size = 0 ; mWidth = mHeight = 0 ; - mBadBufferAllocation = TRUE ; + mBadBufferAllocation = true ; } mDataSize = size; } @@ -222,7 +230,7 @@ U8* LLImageBase::getData() return mData; } -BOOL LLImageBase::isBufferInvalid() +bool LLImageBase::isBufferInvalid() { return mBadBufferAllocation || mData == NULL ; } @@ -258,7 +266,11 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) : LLImageBase() { mMemType = LLMemType::MTYPE_IMAGERAW; - llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE ); + //llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE ); + if(S32(width) * S32(height) * S32(components) > MAX_IMAGE_DATA_SIZE) + { + llwarns << "over size: width: " << (S32)width << " height: " << (S32)height << " components: " << (S32)components << llendl ; + } allocateDataSize(width, height, components); ++sRawImageCount; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 686f583886..10444e7f89 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -48,7 +48,7 @@ const S32 MAX_IMAGE_SIZE = (1<playSnapshotAnimAndSound(); - LLImageBase::setSizeOverride(TRUE); LLPointer formatted; switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))) { @@ -426,12 +425,12 @@ class LLFileTakeSnapshotToDisk : public view_listener_t break; default: llwarns << "Unknown Local Snapshot format" << llendl; - LLImageBase::setSizeOverride(FALSE); return true; } + formatted->enableOverSize() ; formatted->encode(raw, 0); - LLImageBase::setSizeOverride(FALSE); + formatted->disableOverSize() ; gViewerWindow->saveImageNumbered(formatted); } return true; -- cgit v1.2.3 From 7d78d1ea4064c8912a6509a9e9527347413db3ce Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 9 Apr 2010 12:38:47 -0700 Subject: EXT-6693 - [crashhunters] crash in LLPopupView::handleMouseEvent reviewed by Monroe --- indra/newview/llpopupview.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 7cde350d5a..4523bf2ba4 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -116,7 +116,6 @@ BOOL LLPopupView::handleMouseEvent(boost::function func if (!popup || !predicate(popup)) { - ++popup_it; continue; } -- cgit v1.2.3 From 55ea80076bafcd1baf6a8ccf713267b8c2c24185 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 9 Apr 2010 14:30:15 -0700 Subject: EXT-6422 Infinite loop in LLMotionController::activateMotionInstance reviewed by monroe --- indra/llcharacter/llkeyframemotion.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 5a2e3f73f9..f4dc3b927b 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -658,7 +658,12 @@ BOOL LLKeyframeMotion::onActivate() // If the keyframe anim has an associated emote, trigger it. if( mJointMotionList->mEmoteName.length() > 0 ) { - mCharacter->startMotion( gAnimLibrary.stringToAnimState(mJointMotionList->mEmoteName) ); + LLUUID emote_anim_id = gAnimLibrary.stringToAnimState(mJointMotionList->mEmoteName); + // don't start emote if already active to avoid recursion + if (!mCharacter->isMotionActive(emote_anim_id)) + { + mCharacter->startMotion( emote_anim_id ); + } } mLastLoopedTime = 0.f; -- cgit v1.2.3 From 0dee7a3ece05f418c1deb422771cfed8d89826b3 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 9 Apr 2010 22:02:32 -0600 Subject: debug code for EXT-6791: Intel 965 Crash in glCopyTexSubImage2D. --- indra/llrender/llimagegl.cpp | 16 +++++++++++----- indra/llrender/llimagegl.h | 2 +- indra/newview/lldynamictexture.cpp | 2 ++ indra/newview/lldynamictexture.h | 13 +++++++++++++ indra/newview/llfloateranimpreview.cpp | 6 ++++++ indra/newview/llfloateranimpreview.h | 2 ++ indra/newview/llfloaterimagepreview.cpp | 10 ++++++++++ indra/newview/llfloaterimagepreview.h | 4 ++++ indra/newview/lltexlayer.cpp | 6 ++++++ indra/newview/lltexlayer.h | 1 + indra/newview/lltoolmorph.cpp | 12 ++++++++++++ indra/newview/lltoolmorph.h | 3 +++ 12 files changed, 71 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 36ac3ff119..68b556c3bb 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -105,9 +105,9 @@ void check_all_images() } } -void LLImageGL::checkTexSize() const +void LLImageGL::checkTexSize(bool forced) const { - if (gDebugGL && mTarget == GL_TEXTURE_2D) + if ((forced || gDebugGL) && mTarget == GL_TEXTURE_2D) { GLint texname; glGetIntegerv(GL_TEXTURE_BINDING_2D, &texname); @@ -129,6 +129,8 @@ void LLImageGL::checkTexSize() const glGetTexLevelParameteriv(mTarget, 0, GL_TEXTURE_WIDTH, (GLint*)&x); glGetTexLevelParameteriv(mTarget, 0, GL_TEXTURE_HEIGHT, (GLint*)&y) ; stop_glerror() ; + llcallstacks << "w: " << x << " h: " << y << llcallstacksendl ; + if(!x || !y) { return ; @@ -138,11 +140,13 @@ void LLImageGL::checkTexSize() const error = TRUE; if (gDebugSession) { - gFailLog << "wrong texture size and discard level!" << std::endl; + gFailLog << "wrong texture size and discard level!" << + mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << std::endl; } else { - llerrs << "wrong texture size and discard level!" << llendl ; + llerrs << "wrong texture size and discard level: width: " << + mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << llendl ; } } @@ -1044,7 +1048,9 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ { if (gGL.getTexUnit(0)->bind(this, false, true)) { - //checkTexSize() ; + checkTexSize(true) ; + llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height << llcallstacksendl ; + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); mGLTextureCreated = true; stop_glerror(); diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index f0870c3fc4..41239d24c8 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -157,7 +157,7 @@ public: void updatePickMask(S32 width, S32 height, const U8* data_in); BOOL getMask(const LLVector2 &tc); - void checkTexSize() const ; + void checkTexSize(bool forced = false) const ; // Sets the addressing mode used to sample the texture // (such as wrapping, mirrored wrapping, and clamp) diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index c7c79401a0..c423473740 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -167,6 +167,8 @@ void LLViewerDynamicTexture::postRender(BOOL success) { generateGLTexture() ; } + llcallstacks << "class type: " << (S32)getType() << llcallstacksendl ; + success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight); } } diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h index 2a944eaada..caf2603519 100644 --- a/indra/newview/lldynamictexture.h +++ b/indra/newview/lldynamictexture.h @@ -41,6 +41,19 @@ class LLViewerDynamicTexture : public LLViewerTexture { +public: + enum + { + LL_VIEWER_DYNAMIC_TEXTURE = LLViewerTexture::DYNAMIC_TEXTURE, + LL_TEX_LAYER_SET_BUFFER = LLViewerTexture::INVALID_TEXTURE_TYPE + 1, + LL_VISUAL_PARAM_HINT, + LL_VISUAL_PARAM_RESET, + LL_PREVIEW_ANIMATION, + LL_IMAGE_PREVIEW_SCULPTED, + LL_IMAGE_PREVIEW_AVATAR, + INVALID_DYNAMIC_TEXTURE + }; + protected: /*virtual*/ ~LLViewerDynamicTexture(); diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 5ec58c8dd6..72dc182461 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -1069,6 +1069,12 @@ LLPreviewAnimation::~LLPreviewAnimation() mDummyAvatar->markDead(); } +//virtual +S8 LLPreviewAnimation::getType() const +{ + return LLViewerDynamicTexture::LL_PREVIEW_ANIMATION ; +} + //----------------------------------------------------------------------------- // update() //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index 3ee1f419ab..84f131a322 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -50,6 +50,8 @@ protected: public: LLPreviewAnimation(S32 width, S32 height); + /*virtual*/ S8 getType() const ; + BOOL render(); void requestUpdate(); void rotate(F32 yaw_radians, F32 pitch_radians); diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 6b754bd065..ef9da30552 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -629,6 +629,11 @@ LLImagePreviewAvatar::~LLImagePreviewAvatar() mDummyAvatar->markDead(); } +//virtual +S8 LLImagePreviewAvatar::getType() const +{ + return LLViewerDynamicTexture::LL_IMAGE_PREVIEW_AVATAR ; +} void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male) { @@ -808,6 +813,11 @@ LLImagePreviewSculpted::~LLImagePreviewSculpted() { } +//virtual +S8 LLImagePreviewSculpted::getType() const +{ + return LLViewerDynamicTexture::LL_IMAGE_PREVIEW_SCULPTED ; +} void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) { diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index 4a12543650..466bd1d0ec 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -54,6 +54,8 @@ protected: public: LLImagePreviewSculpted(S32 width, S32 height); + /*virtual*/ S8 getType() const ; + void setPreviewTarget(LLImageRaw *imagep, F32 distance); void setTexture(U32 name) { mTextureName = name; } @@ -85,6 +87,8 @@ protected: public: LLImagePreviewAvatar(S32 width, S32 height); + /*virtual*/ S8 getType() const ; + void setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male); void setTexture(U32 name) { mTextureName = name; } void clearPreviewTexture(const std::string& mesh_name); diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 386b636367..8cb319b122 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -98,6 +98,12 @@ LLTexLayerSetBuffer::~LLTexLayerSetBuffer() } } +//virtual +S8 LLTexLayerSetBuffer::getType() const +{ + return LLViewerDynamicTexture::LL_TEX_LAYER_SET_BUFFER ; +} + //virtual void LLTexLayerSetBuffer::restoreGLTexture() { diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index 5be58f64a9..ae280dd063 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -325,6 +325,7 @@ public: LLTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height); virtual ~LLTexLayerSetBuffer(); + /*virtual*/ S8 getType() const ; virtual void preRender(BOOL clear_depth); virtual void postRender(BOOL success); virtual BOOL render(); diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 5f825b461e..79846b9160 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -108,6 +108,12 @@ LLVisualParamHint::~LLVisualParamHint() LLVisualParamHint::sInstances.erase( this ); } +//virtual +S8 LLVisualParamHint::getType() const +{ + return LLViewerDynamicTexture::LL_VISUAL_PARAM_HINT ; +} + //----------------------------------------------------------------------------- // static // requestHintUpdates() @@ -290,6 +296,12 @@ LLVisualParamReset::LLVisualParamReset() : LLViewerDynamicTexture(1, 1, 1, ORDER { } +//virtual +S8 LLVisualParamReset::getType() const +{ + return LLViewerDynamicTexture::LL_VISUAL_PARAM_RESET ; +} + //----------------------------------------------------------------------------- // render() //----------------------------------------------------------------------------- diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index b7df718ba2..c332c296bd 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -64,6 +64,8 @@ public: LLViewerVisualParam *param, F32 param_weight); + /*virtual*/ S8 getType() const ; + BOOL needsRender(); void preRender(BOOL clear_depth); BOOL render(); @@ -107,6 +109,7 @@ protected: public: LLVisualParamReset(); /*virtual */ BOOL render(); + /*virtual*/ S8 getType() const ; static BOOL sDirty; }; -- cgit v1.2.3 From d64ccab573e9455815dede58f8027a8f2337a728 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 9 Apr 2010 23:48:50 -0600 Subject: the first round of the debug code for EXT-6792: Crash on ATI 3200 --- indra/newview/llappviewer.cpp | 2 ++ indra/newview/pipeline.cpp | 10 +++++++++- indra/newview/pipeline.h | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3e7ef26bcd..f19a33301a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2577,6 +2577,8 @@ void LLAppViewer::handleViewerCrash() { llinfos << "Handle viewer crash entry." << llendl; + llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ; + //print out recorded call stacks if there are any. LLError::LLCallStacks::print(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 259ca21e93..e82fccde27 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2957,8 +2957,12 @@ void LLPipeline::renderHighlights() } } +//debug use +U32 LLPipeline::sCurRenderPoolType = 0 ; + void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) { + llpushcallstacks ; LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_GEOM); LLFastTimer t(FTM_RENDER_GEOMETRY); @@ -3066,6 +3070,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) cur_type = poolp->getType(); + //debug use + sCurRenderPoolType = cur_type ; + if (occlude && cur_type >= LLDrawPool::POOL_GRASS) { occlude = FALSE; @@ -7098,6 +7105,7 @@ inline float sgn(float a) void LLPipeline::generateWaterReflection(LLCamera& camera_in) { + llpushcallstacks ; if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); @@ -7833,7 +7841,7 @@ void LLPipeline::renderHighlight(const LLViewerObject* obj, F32 fade) void LLPipeline::generateHighlight(LLCamera& camera) { //render highlighted object as white into offscreen render target - + llpushcallstacks ; if (mHighlightObject.notNull()) { mHighlightSet.insert(HighlightItem(mHighlightObject)); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 6aecc23aac..60e0b0ae8c 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -686,6 +686,9 @@ protected: public: static BOOL sRenderBeacons; static BOOL sRenderHighlight; + + //debug use + static U32 sCurRenderPoolType ; }; void render_bbox(const LLVector3 &min, const LLVector3 &max); -- cgit v1.2.3