From d3a616122f46dc1100bf9ef751b8530a94aa3799 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 3 Mar 2022 09:58:25 -0800 Subject: SL-15232: Test to scroll mouse wheel to map position on main map/minimap --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 254bf05d05..0428feddc1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -589,7 +589,7 @@ static void settings_to_globals() gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); - LLWorldMapView::sMapScale = gSavedSettings.getF32("MapScale"); + LLWorldMapView::setScale(gSavedSettings.getF32("MapScale")); #if LL_DARWIN gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); @@ -3404,7 +3404,7 @@ void LLAppViewer::cleanupSavedSettings() } } - gSavedSettings.setF32("MapScale", LLWorldMapView::sMapScale ); + gSavedSettings.setF32("MapScale", LLWorldMapView::getScale()); // Some things are cached in LLAgent. if (gAgent.isInitialized()) -- cgit v1.2.3 From c6cba3a67d4a346d1d5cf0cc6e6a8fe8c640e13f Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 10 Mar 2022 16:38:07 -0800 Subject: SL-15232: Clean up LLWorldMapView a bit. Avoid a static variable hack and convert a few related variables/methods to non-static as well --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0428feddc1..a06a9eb9fe 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -589,7 +589,7 @@ static void settings_to_globals() gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); - LLWorldMapView::setScale(gSavedSettings.getF32("MapScale")); + LLWorldMapView::setScaleSetting(gSavedSettings.getF32("MapScale")); #if LL_DARWIN gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); @@ -3404,7 +3404,7 @@ void LLAppViewer::cleanupSavedSettings() } } - gSavedSettings.setF32("MapScale", LLWorldMapView::getScale()); + gSavedSettings.setF32("MapScale", LLWorldMapView::getScaleSetting()); // Some things are cached in LLAgent. if (gAgent.isInitialized()) -- cgit v1.2.3 From 3e60b53d52d09e3f1412a9476743a77e555104d9 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 6 May 2022 14:46:49 -0700 Subject: SL-16182: Offload audio decoding from the main thread to the general work queue. The work queue callback binds "this". This is deemed safe due to current dependencies, but see the associated comment in the return callback. There was some trial and error to get a this-binded lambda to compile. Due to LLVorbisDecodeState writing to disk off-thread, limit audio decodes proportional to general worker thread count. Guess the thread count for now. --- indra/newview/llappviewer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 979a888814..b5ed8d8647 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5020,8 +5020,7 @@ void LLAppViewer::idle() audio_update_wind(false); // this line actually commits the changes we've made to source positions, etc. - const F32 max_audio_decode_time = 0.002f; // 2 ms decode time - gAudiop->idle(max_audio_decode_time); + gAudiop->idle(); } } -- cgit v1.2.3 From 75668d45221a48728b67c63ba3ef41c728f51214 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 16 Jun 2022 23:47:26 +0300 Subject: SL-17585 Crash at LLAppViewer::initConfiguration --- indra/newview/llappviewer.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b5ed8d8647..cd2174eea4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2489,10 +2489,24 @@ bool LLAppViewer::initConfiguration() //Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); LLXMLNodePtr root; - BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL); + BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL); if (!success) { - LL_ERRS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL; + LL_WARNS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL; + if (gDirUtilp->fileExists(settings_file_list)) + { + LL_ERRS() << "Cannot load default configuration file settings_files.xml. " + << "Please reinstall viewer from https://secondlife.com/support/downloads/ " + << "and contact https://support.secondlife.com if issue persists after reinstall." + << LL_ENDL; + } + else + { + LL_ERRS() << "Default configuration file settings_files.xml not found. " + << "Please reinstall viewer from https://secondlife.com/support/downloads/ " + << "and contact https://support.secondlife.com if issue persists after reinstall." + << LL_ENDL; + } } mSettingsLocationList = new SettingsFiles(); -- cgit v1.2.3 From 0d250e632c7816ada792b2ec8a63a3b0267daf8d Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 1 Jun 2022 13:41:13 -0700 Subject: SL-17329: Fix texture cache not respecting DiskCachePercentOfTotal --- indra/newview/llappviewer.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cd2174eea4..50600a979d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4259,12 +4259,17 @@ bool LLAppViewer::initCache() // initialize the new disk cache using saved settings const std::string cache_dir_name = gSavedSettings.getString("DiskCacheDirName"); + const U32 MB = 1024 * 1024; + const U64 MIN_CACHE_SIZE = 256 * MB; + const U64 MAX_CACHE_SIZE = 9984ll * MB; + const U64 setting_cache_total_size = (U64)gSavedSettings.getU32("CacheSize") * MB; + const U64 cache_total_size = llclamp(setting_cache_total_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); + const F64 disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); + const F64 texture_cache_percent = 100.0 - disk_cache_percent; + // note that the maximum size of this cache is defined as a percentage of the // total cache size - the 'CacheSize' pref - for all caches. - const unsigned int cache_total_size_mb = gSavedSettings.getU32("CacheSize"); - const double disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); - const unsigned int disk_cache_mb = cache_total_size_mb * disk_cache_percent / 100; - const uintmax_t disk_cache_bytes = disk_cache_mb * 1024 * 1024; + const U32 disk_cache_size = cache_total_size * disk_cache_percent / 100; const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo"); bool texture_cache_mismatch = false; @@ -4315,7 +4320,7 @@ bool LLAppViewer::initCache() } const std::string cache_dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, cache_dir_name); - LLDiskCache::initParamSingleton(cache_dir, disk_cache_bytes, enable_cache_debug_info); + LLDiskCache::initParamSingleton(cache_dir, disk_cache_size, enable_cache_debug_info); if (!read_only) { @@ -4338,22 +4343,14 @@ bool LLAppViewer::initCache() LLSplashScreen::update(LLTrans::getString("StartupInitializingTextureCache")); // Init the texture cache - // Allocate 80% of the cache size for textures - const S32 MB = 1024 * 1024; - const S64 MIN_CACHE_SIZE = 256 * MB; - const S64 MAX_CACHE_SIZE = 9984ll * MB; - - S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; - cache_size = llclamp(cache_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); + // Allocate the remaining percent which is not allocated to the disk cache + const U32 texture_cache_size = cache_total_size * texture_cache_percent / 100; - S64 texture_cache_size = cache_size; - - S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); - texture_cache_size -= extra; + LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()); - return true; + return true; } void LLAppViewer::addOnIdleCallback(const boost::function& cb) -- cgit v1.2.3 From 4f834711660e17055cdbc285f0d426aec94ddc13 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 24 Jun 2022 09:20:40 -0700 Subject: SL-17329: Fix cache sizes due to overflow. Improve typing. --- indra/newview/llappviewer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 50600a979d..0adbdb3647 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4262,14 +4262,14 @@ bool LLAppViewer::initCache() const U32 MB = 1024 * 1024; const U64 MIN_CACHE_SIZE = 256 * MB; const U64 MAX_CACHE_SIZE = 9984ll * MB; - const U64 setting_cache_total_size = (U64)gSavedSettings.getU32("CacheSize") * MB; - const U64 cache_total_size = llclamp(setting_cache_total_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); - const F64 disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); - const F64 texture_cache_percent = 100.0 - disk_cache_percent; + const uintmax_t setting_cache_total_size = (uintmax_t)gSavedSettings.getU32("CacheSize") * MB; + const uintmax_t cache_total_size = llclamp(setting_cache_total_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); + const F32 disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); + const F32 texture_cache_percent = 100.0 - disk_cache_percent; // note that the maximum size of this cache is defined as a percentage of the // total cache size - the 'CacheSize' pref - for all caches. - const U32 disk_cache_size = cache_total_size * disk_cache_percent / 100; + const uintmax_t disk_cache_size = cache_total_size * disk_cache_percent / 100; const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo"); bool texture_cache_mismatch = false; @@ -4344,7 +4344,7 @@ bool LLAppViewer::initCache() // Init the texture cache // Allocate the remaining percent which is not allocated to the disk cache - const U32 texture_cache_size = cache_total_size * texture_cache_percent / 100; + const S64 texture_cache_size = S64(cache_total_size * texture_cache_percent / 100); LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); -- cgit v1.2.3 From db5806f004a789f6b5ed65c691473ae5ea2aa97e Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 24 Jun 2022 13:31:33 -0700 Subject: SL-17329: Address Mac build error --- indra/newview/llappviewer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0adbdb3647..b74cb4aa65 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4260,16 +4260,16 @@ bool LLAppViewer::initCache() const std::string cache_dir_name = gSavedSettings.getString("DiskCacheDirName"); const U32 MB = 1024 * 1024; - const U64 MIN_CACHE_SIZE = 256 * MB; - const U64 MAX_CACHE_SIZE = 9984ll * MB; - const uintmax_t setting_cache_total_size = (uintmax_t)gSavedSettings.getU32("CacheSize") * MB; + const uintmax_t MIN_CACHE_SIZE = 256 * MB; + const uintmax_t MAX_CACHE_SIZE = 9984ll * MB; + const uintmax_t setting_cache_total_size = uintmax_t(gSavedSettings.getU32("CacheSize")) * MB; const uintmax_t cache_total_size = llclamp(setting_cache_total_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); - const F32 disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); - const F32 texture_cache_percent = 100.0 - disk_cache_percent; + const F64 disk_cache_percent = gSavedSettings.getF32("DiskCachePercentOfTotal"); + const F64 texture_cache_percent = 100.0 - disk_cache_percent; // note that the maximum size of this cache is defined as a percentage of the // total cache size - the 'CacheSize' pref - for all caches. - const uintmax_t disk_cache_size = cache_total_size * disk_cache_percent / 100; + const uintmax_t disk_cache_size = uintmax_t(cache_total_size * disk_cache_percent / 100); const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo"); bool texture_cache_mismatch = false; -- cgit v1.2.3