diff --git a/autobuild.xml b/autobuild.xml
index 51e377361e..e451d1fe04 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1689,6 +1689,15 @@
llca
- license
- mit
- license_file
- LICENSES/ca-license.txt
- copyright
- Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
-
version
- 202402012004.0
- name
- llca
+ 202407221423.0
llphysicsextensions_source
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index ec022453df..bb80343313 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -39,6 +39,10 @@ add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE})
# -- which we do. Without one or the other, we get a ton of Boost warnings.
add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS)
+# Force enable SSE2 instructions in GLM per the manual
+# https://github.com/g-truc/glm/blob/master/manual.md#section2_10
+add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1)
+
# Configure crash reporting
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 3a3546a8ef..57e01134e9 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -152,9 +152,14 @@ if(WINDOWS)
# Check each of them.
foreach(release_msvc_file
msvcp${MSVC_VER}.dll
+ msvcp${MSVC_VER}_1.dll
+ msvcp${MSVC_VER}_2.dll
+ msvcp${MSVC_VER}_atomic_wait.dll
+ msvcp${MSVC_VER}_codecvt_ids.dll
#msvcr${MSVC_VER}.dll # Can't build with older VS versions anyway - no need trying to copy this file
vcruntime${MSVC_VER}.dll
vcruntime${MSVC_VER}_1.dll
+ vcruntime${MSVC_VER}_threads.dll
)
if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 0f5d87953e..a1692ad18b 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -90,7 +90,7 @@ bool LLApp::sDisableCrashlogger = false;
// Local flag for whether or not to do logging in signal handlers.
//static
-bool LLApp::sLogInSignal = false;
+bool LLApp::sLogInSignal = true;
// static
// Keeps track of application status
@@ -373,6 +373,9 @@ static std::map statusDesc
// static
void LLApp::setStatus(EAppStatus status)
{
+ auto status_it = statusDesc.find(status);
+ std::string status_text = status_it != statusDesc.end() ? std::string(status_it->second) : std::to_string(status);
+ LL_INFOS() << "status: " << status_text << LL_ENDL;
// notify everyone waiting on sStatus any time its value changes
sStatus.set_all(status);
@@ -381,18 +384,7 @@ void LLApp::setStatus(EAppStatus status)
if (! LLEventPumps::wasDeleted())
{
// notify interested parties of status change
- LLSD statsd;
- auto found = statusDesc.find(status);
- if (found != statusDesc.end())
- {
- statsd = found->second;
- }
- else
- {
- // unknown status? at least report value
- statsd = LLSD::Integer(status);
- }
- LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", statsd));
+ LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", status_text));
}
}
@@ -687,6 +679,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
{
LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL;
}
+
if (LLApp::isError())
{
// Received second fatal signal while handling first, just die right now
@@ -724,11 +717,11 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
clear_signals();
raise(signum);
return;
- } else {
- if (LLApp::sLogInSignal)
- {
- LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
- }
+ }
+
+ if (LLApp::sLogInSignal)
+ {
+ LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
}
}
}
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index a2c99131b1..09ce1abba6 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -951,7 +951,7 @@ LLSDBinaryParser::~LLSDBinaryParser()
// virtual
S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
/**
* Undefined: '!'
* Boolean: '1' for true '0' for false
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index af0132ec65..80b2419032 100644
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
@@ -276,14 +276,15 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
// Estimate the number of layers. This is consistent with what's done for j2c encoding in LLImageJ2CKDU::encodeImpl().
constexpr S32 precision = 8; // assumed bitrate per component channel, might change in future for HDR support
+ constexpr S32 max_components = 4; // assumed the file has four components; three color and alpha
S32 nb_layers = 1;
const S32 surface = w*h;
S32 s = 64*64;
- S32 totalbytes = (S32)(s * comp * precision * rate); // first level computed before loop
+ S32 totalbytes = (S32)(s * max_components * precision * rate); // first level computed before loop
while (surface > s)
{
if (nb_layers <= (5 - discard_level))
- totalbytes += (S32)(s * comp * precision * rate);
+ totalbytes += (S32)(s * max_components * precision * rate);
nb_layers++;
s *= 4;
}
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 8eb2ad458e..8f98b536a6 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -55,7 +55,6 @@ const U32 PENDING_TIMEOUT_SECS = 5 * 60;
// Globals
LLCacheName* gCacheName = NULL;
-std::map LLCacheName::sCacheName;
/// ---------------------------------------------------------------------------
/// class LLCacheNameEntry
@@ -221,7 +220,7 @@ public:
Impl(LLMessageSystem* msg);
~Impl();
- bool getName(const LLUUID& id, std::string& first, std::string& last);
+ bool getName(const LLUUID& id, std::string& first, std::string& last, std::map& default_names);
// Fix stale legacy requests
//boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback);
@@ -257,9 +256,9 @@ LLCacheName::LLCacheName(LLMessageSystem* msg)
LLCacheName::LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host)
: impl(* new Impl(msg))
{
- sCacheName["waiting"] = "(Loading...)";
- sCacheName["nobody"] = "(nobody)";
- sCacheName["none"] = "(none)";
+ mCacheName["waiting"] = "(Loading...)";
+ mCacheName["nobody"] = "(nobody)";
+ mCacheName["none"] = "(none)";
setUpstream(upstream_host);
}
@@ -284,7 +283,7 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg)
LLCacheName::Impl::~Impl()
{
- for_each(mCache.begin(), mCache.end(), DeletePairedPointer());
+ std::for_each(mCache.begin(), mCache.end(), DeletePairedPointer());
mCache.clear();
for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer());
mReplyQueue.clear();
@@ -426,11 +425,11 @@ void LLCacheName::exportFile(std::ostream& ostr)
}
-bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last)
+bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last, std::map& default_names)
{
if(id.isNull())
{
- first = sCacheName["nobody"];
+ first = default_names["nobody"];
last.clear();
return true;
}
@@ -444,7 +443,7 @@ bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::strin
}
else
{
- first = sCacheName["waiting"];
+ first = default_names["waiting"];
last.clear();
if (!isRequestPending(id))
{
@@ -458,8 +457,8 @@ bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::strin
// static
void LLCacheName::localizeCacheName(std::string key, std::string value)
{
- if (key!="" && value!= "" )
- sCacheName[key]=value;
+ if (!key.empty() && !value.empty())
+ mCacheName[key]=value;
else
LL_WARNS()<< " Error localizing cache key " << key << " To "<< value< Returns first name, last name
bool LLCacheName::getFirstLastName(const LLUUID& id, std::string& first, std::string& last)
{
- return impl.getName(id, first, last);
+ return impl.getName(id, first, last, mCacheName);
}
//
@@ -483,7 +482,7 @@ bool LLCacheName::getGroupName(const LLUUID& id, std::string& group)
{
if(id.isNull())
{
- group = sCacheName["none"];
+ group = mCacheName["none"];
return true;
}
@@ -504,7 +503,7 @@ bool LLCacheName::getGroupName(const LLUUID& id, std::string& group)
}
else
{
- group = sCacheName["waiting"];
+ group = mCacheName["waiting"];
if (!impl.isRequestPending(id))
{
impl.mAskGroupQueue.insert(id);
@@ -678,7 +677,7 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, co
{
LLCacheNameSignal signal;
signal.connect(callback);
- signal(id, sCacheName["nobody"], is_group);
+ signal(id, mCacheName["nobody"], is_group);
return res;
}
@@ -848,14 +847,14 @@ void LLCacheName::dumpStats()
void LLCacheName::clear()
{
- for_each(impl.mCache.begin(), impl.mCache.end(), DeletePairedPointer());
+ std::for_each(impl.mCache.begin(), impl.mCache.end(), DeletePairedPointer());
impl.mCache.clear();
}
//static
std::string LLCacheName::getDefaultName()
{
- return sCacheName["waiting"];
+ return mCacheName["waiting"];
}
//static
diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h
index 6f3a3f83dc..e225946e03 100644
--- a/indra/llmessage/llcachename.h
+++ b/indra/llmessage/llcachename.h
@@ -132,15 +132,16 @@ public:
void dumpStats(); // Dumps the sizes of the cache and associated queues.
void clear(); // Deletes all entries from the cache
- static std::string getDefaultName();
+ std::string getDefaultName();
// Returns "Resident", the default last name for SLID-based accounts
// that have no last name.
static std::string getDefaultLastName();
- static void localizeCacheName(std::string key, std::string value);
- static std::map sCacheName;
+ void localizeCacheName(std::string key, std::string value);
+
private:
+ std::map mCacheName;
class Impl;
Impl& impl;
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index 4b80a4e452..a7cfcd9f8e 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -34,6 +34,9 @@
#include "llpluginmessageclasses.h"
#include "llsdserialize.h"
#include "stringize.h"
+#include "threadpool.h"
+#include "workqueue.h"
+
#include "llapr.h"
#include "llrand.h" // FIRE-3877; So we can choose a random port number
@@ -81,29 +84,8 @@ protected:
};
-
-class LLPluginProcessCreationThread : public LLThread
-{
-public:
- LLPluginProcessCreationThread(LLPluginProcessParent *parent) :
- LLThread("LLPluginProcessCreationThread", gAPRPoolp),
- pParent(parent)
- {
- }
-protected:
- // Inherited from LLThread, should run once
- /*virtual*/ void run(void)
- {
- pParent->createPluginProcess();
- }
-private:
- LLPluginProcessParent *pParent;
-
-};
-
LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner):
- mIncomingQueueMutex(),
- pProcessCreationThread(NULL)
+ mIncomingQueueMutex()
{
if(!sInstancesMutex)
{
@@ -132,18 +114,6 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner):
LLPluginProcessParent::~LLPluginProcessParent()
{
LL_DEBUGS("Plugin") << "destructor" << LL_ENDL;
- if (pProcessCreationThread)
- {
- if (!pProcessCreationThread->isStopped())
- {
- // Shouldn't happen at this stage
- LL_WARNS("Plugin") << "Shutting down active pProcessCreationThread" << LL_ENDL;
- pProcessCreationThread->shutdown();
- ms_sleep(20);
- }
- delete pProcessCreationThread;
- pProcessCreationThread = NULL;
- }
// Destroy any remaining shared memory regions
sharedMemoryRegionsType::iterator iter;
@@ -359,35 +329,6 @@ bool LLPluginProcessParent::accept()
return result;
}
-bool LLPluginProcessParent::createPluginProcess()
-{
- if (!mProcess)
- {
- // Only argument to the launcher is the port number we're listening on
- mProcessParams.args.add(stringize(mBoundPort));
- mProcess = LLProcess::create(mProcessParams);
- return mProcess != NULL;
- }
-
- return false;
-}
-
-void LLPluginProcessParent::clearProcessCreationThread()
-{
- if (pProcessCreationThread)
- {
- if (!pProcessCreationThread->isStopped())
- {
- pProcessCreationThread->shutdown();
- }
- else
- {
- delete pProcessCreationThread;
- pProcessCreationThread = NULL;
- }
- }
-}
-
void LLPluginProcessParent::idle(void)
{
bool idle_again;
@@ -561,29 +502,71 @@ void LLPluginProcessParent::idle(void)
case STATE_LISTENING:
{
+ // Only argument to the launcher is the port number we're listening on
+ mProcessParams.args.add(stringize(mBoundPort));
+
// Launch the plugin process.
- if (mDebug && !pProcessCreationThread)
+ if (mDebug && !mProcess)
{
- createPluginProcess();
- if (!mProcess)
+ if (!(mProcess = LLProcess::create(mProcessParams)))
{
errorState();
}
}
- else if (pProcessCreationThread == NULL)
+ else if (!mProcess && !mProcessCreationRequested)
{
- // exe plugin process allocation can be hindered by a number
- // of factors, don't hold whole viewer because of it, use thread
- pProcessCreationThread = new LLPluginProcessCreationThread(this);
- pProcessCreationThread->start();
- }
- else if (!mProcess && pProcessCreationThread->isStopped())
- {
- delete pProcessCreationThread;
- pProcessCreationThread = NULL;
- errorState();
- }
+ mProcessCreationRequested = true;
+ LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop");
+ // *NOTE: main_queue->postTo casts this refcounted smart pointer to a weak
+ // pointer
+ LL::WorkQueue::ptr_t general_queue = LL::WorkQueue::getInstance("General");
+ llassert_always(main_queue);
+ llassert_always(general_queue);
+ auto process_params = mProcessParams;
+
+ bool posted = main_queue->postTo(
+ general_queue,
+ [process_params]() // Work done on general queue
+ {
+ return LLProcess::create(process_params);
+ },
+ [this](LLProcessPtr new_process) // Callback to main thread
+ mutable {
+ ptr_t that;
+ {
+ // this grabs a copy of the smart pointer to ourselves to ensure that we do not
+ // get destroyed until after this method returns.
+ LLCoros::LockType lock(*sInstancesMutex);
+ mapInstances_t::iterator it = sInstances.find(this);
+ if (it != sInstances.end())
+ that = (*it).second;
+ }
+
+ if (that)
+ {
+ if (new_process)
+ {
+ that->mProcess = new_process;
+ }
+ else
+ {
+ that->mProcessCreationRequested = false;
+ that->errorState();
+ }
+ }
+
+ });
+ if (!posted)
+ {
+ LL_WARNS("Plugin") << "Failed to dispath process creation to threadpool" << LL_ENDL;
+ if (!(mProcess = LLProcess::create(mProcessParams)))
+ {
+ mProcessCreationRequested = false;
+ errorState();
+ }
+ }
+ }
if (mProcess)
{
@@ -614,15 +597,6 @@ void LLPluginProcessParent::idle(void)
// This will allow us to time out if the process never starts.
mHeartbeat.start();
mHeartbeat.setTimerExpirySec(mPluginLaunchTimeout);
-
- // pProcessCreationThread should have stopped by this point,
- // but check just in case it paused on statistics sync
- if (pProcessCreationThread && pProcessCreationThread->isStopped())
- {
- delete pProcessCreationThread;
- pProcessCreationThread = NULL;
- }
-
setState(STATE_LAUNCHED);
}
}
@@ -725,7 +699,6 @@ void LLPluginProcessParent::idle(void)
killSockets();
setState(STATE_DONE);
dirtyPollSet();
- clearProcessCreationThread();
break;
case STATE_DONE:
diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h
index c52484e9c2..d929c37ebb 100644
--- a/indra/llplugin/llpluginprocessparent.h
+++ b/indra/llplugin/llpluginprocessparent.h
@@ -69,11 +69,6 @@ public:
const std::string &plugin_filename,
bool debug);
- // Creates a process
- // returns true if process already exists or if created,
- // false if failed to create
- bool createPluginProcess();
-
void idle(void);
// returns true if the plugin is on its way to steady state
@@ -168,15 +163,13 @@ private:
bool accept();
- void clearProcessCreationThread();
-
LLSocket::ptr_t mListenSocket;
LLSocket::ptr_t mSocket;
U32 mBoundPort;
LLProcess::Params mProcessParams;
LLProcessPtr mProcess;
- LLThread *pProcessCreationThread;
+ bool mProcessCreationRequested = false;
std::string mPluginFile;
std::string mPluginDir;
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 36c17b566a..e8762de875 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -900,6 +900,20 @@ bool LLComboBox::handleUnicodeCharHere(llwchar uni_char)
return result;
}
+// virtual
+bool LLComboBox::handleScrollWheel(S32 x, S32 y, S32 clicks)
+{
+ if (mList->getVisible()) return mList->handleScrollWheel(x, y, clicks);
+ if (mAllowTextEntry) // We might be editable
+ if (!mList->getFirstSelected()) // We aren't in the list, don't kill their text
+ return false;
+
+ setCurrentByIndex(llclamp(getCurrentIndex() + clicks, 0, getItemCount() - 1));
+ prearrangeList();
+ onCommit();
+ return true;
+}
+
void LLComboBox::setTextEntry(const LLStringExplicit& text)
{
if (mTextEntry)
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index 15381a1fd2..bb3c7ce66e 100644
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -115,6 +115,7 @@ public:
virtual bool handleToolTip(S32 x, S32 y, MASK mask);
virtual bool handleKeyHere(KEY key, MASK mask);
virtual bool handleUnicodeCharHere(llwchar uni_char);
+ virtual bool handleScrollWheel(S32 x, S32 y, S32 clicks);
// LLUICtrl interface
virtual void clear(); // select nothing
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 31cc420551..57d9c92c3a 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1292,24 +1292,64 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
{
S32 delta_x = 0;
S32 delta_y = 0;
+
+ // take translation of dependee floater into account
+ delta_x += new_rect.mLeft - old_rect.mLeft;
+ delta_y += new_rect.mBottom - old_rect.mBottom;
+
// check to see if it snapped to right or top, and move if dependee floater is resizing
LLRect dependent_rect = floaterp->getRect();
- if (dependent_rect.mLeft - getRect().mLeft >= old_rect.getWidth() || // dependent on my right?
- dependent_rect.mRight == getRect().mLeft + old_rect.getWidth()) // dependent aligned with my right
+ if ((dependent_rect.mLeft - getRect().mLeft >= old_rect.getWidth() || // dependent on my right?
+ dependent_rect.mRight == getRect().mLeft + old_rect.getWidth()) // dependent aligned with my right
+ && dependent_rect.mBottom <= old_rect.mTop + 1)
{
// was snapped directly onto right side or aligned with it
delta_x += new_rect.getWidth() - old_rect.getWidth();
+
+ // make sure dependent still touches floater and din't go too high,
+ // it can go over edge, but should't detach completely
+ if (delta_y > 0
+ && dependent_rect.mBottom + delta_y > new_rect.mTop)
+ {
+ delta_y = llmax(new_rect.mTop - dependent_rect.mBottom, 0);
+ }
}
- if (dependent_rect.mBottom - getRect().mBottom >= old_rect.getHeight() ||
- dependent_rect.mTop == getRect().mBottom + old_rect.getHeight())
+ else if (dependent_rect.mRight == old_rect.mLeft)
+ {
+ // make sure dependent still touches floater and don't go too high
+ if (delta_y > 0
+ && dependent_rect.mBottom <= old_rect.mTop
+ && dependent_rect.mBottom + delta_y > new_rect.mTop)
+ {
+ delta_y = llmax(new_rect.mTop - dependent_rect.mBottom, 0);
+ }
+ }
+
+ if ((dependent_rect.mBottom - getRect().mBottom >= old_rect.getHeight() ||
+ dependent_rect.mTop == getRect().mBottom + old_rect.getHeight())
+ && dependent_rect.mLeft <= old_rect.mRight + 1)
{
// was snapped directly onto top side or aligned with it
delta_y += new_rect.getHeight() - old_rect.getHeight();
- }
- // take translation of dependee floater into account as well
- delta_x += new_rect.mLeft - old_rect.mLeft;
- delta_y += new_rect.mBottom - old_rect.mBottom;
+ // make sure dependent still touches floater
+ // and din't go too far to the right
+ if (delta_x > 0
+ && dependent_rect.mLeft + delta_x > new_rect.mRight)
+ {
+ delta_x = llmax(new_rect.mRight - dependent_rect.mLeft, 0);
+ }
+ }
+ else if (dependent_rect.mTop == old_rect.mBottom)
+ {
+ // make sure dependent still touches floater and don't go too far to the right
+ if (delta_x > 0
+ && dependent_rect.mLeft <= old_rect.mRight
+ && dependent_rect.mLeft + delta_x > new_rect.mRight)
+ {
+ delta_x = llmax(new_rect.mRight - dependent_rect.mLeft, 0);
+ }
+ }
dependent_rect.translate(delta_x, delta_y);
floaterp->setShape(dependent_rect, by_user);
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index e7c9aae910..aef19f6dc4 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -217,7 +217,7 @@ LLLayoutStack::Params::Params()
open_time_constant("open_time_constant", 0.02f),
close_time_constant("close_time_constant", 0.03f),
resize_bar_overlap("resize_bar_overlap", 1),
- border_size("border_size", LLCachedControl(*LLUI::getInstance()->mSettingGroups["config"], "UIResizeBarHeight", 0)),
+ border_size("border_size", LLUI::getInstance()->mSettingGroups["config"]->getS32("UIResizeBarHeight")),
show_drag_handle("show_drag_handle", false),
drag_handle_first_indent("drag_handle_first_indent", 0),
drag_handle_second_indent("drag_handle_second_indent", 0),
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index b71e5aa897..04e46e2c61 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1632,7 +1632,11 @@ const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const
item = getFirstSelected();
if (item)
{
- return item->getColumn(column)->getValue().asString();
+ auto col = item->getColumn(column);
+ if(col)
+ {
+ return col->getValue().asString();
+ }
}
return LLStringUtil::null;
diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h
index 54eefc8554..62b40636d2 100644
--- a/indra/llwebrtc/llwebrtc.h
+++ b/indra/llwebrtc/llwebrtc.h
@@ -230,7 +230,7 @@ class LLWebRTCSignalingObserver
// allows for management of this peer connection.
class LLWebRTCPeerConnectionInterface
{
- public:
+public:
struct InitOptions
{
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 83b1a6c7d6..36340cfd07 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -2084,7 +2084,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
}
else
{
- LLCachedControl dynamic_camera_strength(gSavedSettings, "DynamicCameraStrength");
+ static LLCachedControl dynamic_camera_strength(gSavedSettings, "DynamicCameraStrength");
target_lag = vel * dynamic_camera_strength / 30.f;
}
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index daba7cff6f..8b4b38388e 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -408,7 +408,8 @@ bool LLControlAvatar::updateCharacter(LLAgent &agent)
//virtual
void LLControlAvatar::updateDebugText()
{
- if (gSavedSettings.getBOOL("DebugAnimatedObjects"))
+ static LLCachedControl debug_animated_objects(gSavedSettings, "DebugAnimatedObjects");
+ if (debug_animated_objects)
{
S32 total_linkset_count = 0;
if (mRootVolp)
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 8692d9ed01..82765b40b2 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -957,7 +957,7 @@ void LLDrawable::updateTexture()
bool LLDrawable::updateGeometry()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE;
llassert(mVObjp.notNull());
bool res = mVObjp && mVObjp->updateGeometry(this);
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index ebbf023008..8c4aff5596 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -209,7 +209,7 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
forwardRender();
// final pass, render to depth for depth of field effects
- if (!LLPipeline::sImpostorRender && gSavedSettings.getBOOL("RenderDepthOfField") && !gCubeSnapshot && !LLPipeline::sRenderingHUDs && getType() == LLDrawPool::POOL_ALPHA_POST_WATER)
+ if (!LLPipeline::sImpostorRender && LLPipeline::RenderDepthOfField && !gCubeSnapshot && !LLPipeline::sRenderingHUDs && getType() == LLDrawPool::POOL_ALPHA_POST_WATER)
{
//update depth buffer sampler
simple_shader = fullbright_shader = &gDeferredFullbrightAlphaMaskProgram;
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 6ddf18e4f5..f70454b897 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -117,11 +117,8 @@ U32 LLDrawPoolTerrain::getVertexDataMask()
void LLDrawPoolTerrain::prerender()
{
- // Use faster LLCachedControls for frequently visited locations
- //sPBRDetailMode = gSavedSettings.getS32("RenderTerrainPBRDetail");
- static LLCachedControl renderTerrainPBRDetail(gSavedSettings, "RenderTerrainPBRDetail");
- sPBRDetailMode = renderTerrainPBRDetail();
- //
+ static LLCachedControl render_terrain_pbr_detail(gSavedSettings, "RenderTerrainPBRDetail");
+ sPBRDetailMode = render_terrain_pbr_detail;
}
void LLDrawPoolTerrain::boostTerrainDetailTextures()
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 044122fb44..36b60c6c48 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -437,7 +437,7 @@ void LLFloaterAvatarPicker::populateNearMe()
if (!LLAvatarNameCache::get(av, &av_name))
{
element["columns"][0]["column"] = "name";
- element["columns"][0]["value"] = LLCacheName::getDefaultName();
+ element["columns"][0]["value"] = gCacheName->getDefaultName();
all_loaded = false;
}
else
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 82f4fc58c8..7feff5a2fd 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -992,11 +992,14 @@ void LLFloaterIMContainer::onAddButtonClicked()
{
LLView * button = findChild("conversations_pane_buttons_expanded")->findChild("add_btn");
LLFloater* root_floater = gFloaterView->getParentFloater(this);
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
-
- if (picker && root_floater)
+ if (button && root_floater)
{
- root_floater->addDependentFloater(picker);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
+
+ if (picker)
+ {
+ root_floater->addDependentFloater(picker);
+ }
}
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ca10684467..ba76362fd4 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3343,13 +3343,16 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload
gIMMgr->addSession(correct_session_name, type, session_id, payload["voice_channel_info"]);
- std::string url = gAgent.getRegion()->getCapability(
+ std::string url = gAgent.getRegionCapability(
"ChatSessionRequest");
if (voice)
{
- LLCoros::instance().launch("chatterBoxInvitationCoro",
- boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"]));
+ if(!url.empty())
+ {
+ LLCoros::instance().launch("chatterBoxInvitationCoro",
+ boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"]));
+ }
// send notification message to the corresponding chat
if (payload["notify_box_type"].asString() == "VoiceInviteGroup" || payload["notify_box_type"].asString() == "VoiceInviteAdHoc")
@@ -4783,9 +4786,12 @@ public:
// Send request for chat history, if enabled.
if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))
{
- std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
- LLCoros::instance().launch("chatterBoxHistoryCoro",
- boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0));
+ std::string url = gAgent.getRegionCapability("ChatSessionRequest");
+ if (!url.empty())
+ {
+ LLCoros::instance().launch("chatterBoxHistoryCoro",
+ boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0));
+ }
}
}
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index b8b22d5b96..9f0cad346f 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1022,7 +1022,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
}
- if (obj->getType() != LLAssetType::AT_CATEGORY)
+ if (obj && obj->getType() != LLAssetType::AT_CATEGORY)
{
items.push_back(std::string("Paste Separator"));
}
@@ -6919,7 +6919,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act
if (item && (item->getCreatorUUID() != gAgent.getID()) &&
(!item->getCreatorUUID().isNull()))
{
- std::string callingcard_name = LLCacheName::getDefaultName();
+ std::string callingcard_name = gCacheName->getDefaultName();
LLAvatarName av_name;
if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name))
{
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index afcbe59b4f..4a2d051b8a 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -711,7 +711,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
}
// Select any newly created object that has the auto rename at top of folder root set.
- if(mFolderRoot.get()->getRoot()->needsAutoRename())
+ if(mFolderRoot.get() && mFolderRoot.get()->getRoot()->needsAutoRename())
{
setSelection(item_id, false);
}
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 4fd6992e7b..aa9f91a857 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1776,9 +1776,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
file.read(buffer, bytes);
if (headerReceived(mesh_params, buffer, bytes) == MESH_OK)
{
- std::string mid;
- mesh_params.getSculptID().toString(mid);
- LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mid << " - was retrieved from the cache." << LL_ENDL;
+ LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mesh_params.getSculptID() << " - was retrieved from the cache." << LL_ENDL;
// Found mesh in cache
return true;
@@ -1798,9 +1796,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
if (!http_url.empty())
{
- std::string mid;
- mesh_params.getSculptID().toString(mid);
- LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mid << " - was retrieved from the simulator." << LL_ENDL;
+ LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mesh_params.getSculptID() << " - was retrieved from the simulator." << LL_ENDL;
//grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits
//within the first 4KB
@@ -1891,9 +1887,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
{
delete[] buffer;
- std::string mid;
- mesh_id.toString(mid);
- LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mid << " - was retrieved from the cache." << LL_ENDL;
+ LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the cache." << LL_ENDL;
return true;
}
@@ -1912,9 +1906,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
if (!http_url.empty())
{
- std::string mid;
- mesh_id.toString(mid);
- LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mid << " - was retrieved from the simulator." << LL_ENDL;
+ LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the simulator." << LL_ENDL;
LLMeshHandlerBase::ptr_t handler(new LLMeshLODHandler(mesh_params, lod, offset, size));
// [UDP Assets]
@@ -4808,12 +4800,8 @@ F32 LLMeshRepository::getStreamingCostLegacy(LLMeshHeader& header, F32 radius, S
*unscaled_value = weighted_avg;
}
- // replace often called setting with LLCachedControl
- // return weighted_avg/gSavedSettings.getU32("MeshTriangleBudget")*15000.f;
-
- static LLCachedControl< U32 > MeshTriangleBudget( gSavedSettings, "MeshTriangleBudget");
- return weighted_avg/MeshTriangleBudget*15000.f;
- //
+ static LLCachedControl mesh_triangle_budget(gSavedSettings, "MeshTriangleBudget");
+ return weighted_avg / mesh_triangle_budget * 15000.f;
}
LLMeshCostData::LLMeshCostData()
@@ -4965,7 +4953,8 @@ F32 LLMeshCostData::getEstTrisForStreamingCost()
F32 LLMeshCostData::getRadiusBasedStreamingCost(F32 radius)
{
- return getRadiusWeightedTris(radius)/gSavedSettings.getU32("MeshTriangleBudget")*15000.f;
+ static LLCachedControl mesh_triangle_budget(gSavedSettings, "MeshTriangleBudget");
+ return getRadiusWeightedTris(radius)/mesh_triangle_budget*15000.f;
}
F32 LLMeshCostData::getTriangleBasedStreamingCost()
@@ -5576,12 +5565,9 @@ bool LLMeshRepository::meshUploadEnabled()
bool LLMeshRepository::meshRezEnabled()
{
+ static LLCachedControl mesh_enabled(gSavedSettings, "MeshEnabled");
LLViewerRegion *region = gAgent.getRegion();
- // Use faster LLCachedControls for frequently visited locations
- //if(gSavedSettings.getBOOL("MeshEnabled") &&
- static LLCachedControl meshEnabled(gSavedSettings, "MeshEnabled");
- if(meshEnabled &&
- //
+ if(mesh_enabled &&
region)
{
return region->meshRezEnabled();
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index bb9061f6ab..6ee0d1761b 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -702,10 +702,18 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
if ("collapse_all" == command_name)
{
+ if (!mCurrentSelectedList)
+ {
+ return false;
+ }
return has_expanded_folders(mCurrentSelectedList->getRootFolder());
}
else if ("expand_all" == command_name)
{
+ if (!mCurrentSelectedList)
+ {
+ return false;
+ }
return has_collapsed_folders(mCurrentSelectedList->getRootFolder());
}
else if ("sort_by_date" == command_name)
@@ -1036,12 +1044,12 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
// then ask LLFolderView permissions
- LLFolderView* root_folder = mCurrentSelectedList->getRootFolder();
+ LLFolderView* root_folder = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr;
if ("copy" == command_name)
{
// we shouldn't be able to copy folders from My Inventory Panel
- return can_be_modified && root_folder->canCopy();
+ return can_be_modified && root_folder && root_folder->canCopy();
}
else if ("collapse" == command_name)
{
@@ -1058,7 +1066,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
if ("cut" == command_name)
{
- can_be_modified = root_folder->canCut();
+ can_be_modified = root_folder && root_folder->canCut();
}
else if ("rename" == command_name)
{
@@ -1070,7 +1078,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
}
else if("paste" == command_name)
{
- can_be_modified = root_folder->canPaste();
+ can_be_modified = root_folder && root_folder->canPaste();
}
else
{
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 90afcc81d9..422ec05cbd 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -504,7 +504,7 @@ public:
void LLSpatialGroup::setState(U32 state, S32 mode)
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
llassert(state <= LLSpatialGroup::STATE_MASK);
@@ -553,7 +553,7 @@ public:
void LLSpatialGroup::clearState(U32 state, S32 mode)
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
llassert(state <= LLSpatialGroup::STATE_MASK);
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index c8d141324f..8fe837d56c 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -346,12 +346,15 @@ static bool handleAnisotropicChanged(const LLSD& newvalue)
static bool handleVSyncChanged(const LLSD& newvalue)
{
LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean();
- gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
-
- if (newvalue.asBoolean())
+ if (gViewerWindow && gViewerWindow->getWindow())
{
- U32 current_target = gSavedSettings.getU32("TargetFPS");
- gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
+
+ if (newvalue.asBoolean())
+ {
+ U32 current_target = gSavedSettings.getU32("TargetFPS");
+ gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ }
}
return true;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 5a44d48a7d..032cf0ad85 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -761,7 +761,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
gPipeline.resetFrameStats(); // Reset per-frame statistics.
- if (!gDisconnected)
+ if (!gDisconnected && !LLApp::isExiting())
{
// Render mirrors and associated hero probes before we render the rest of the scene.
// This ensures the scene state in the hero probes are exactly the same as the rest of the scene before we render it.
@@ -1747,11 +1747,7 @@ void render_ui_2d()
}
- // gSavedSettings replacement
- //if (gSavedSettings.getBOOL("RenderUIBuffer"))
- static LLCachedControl renderUIBuffer(gSavedSettings, "RenderUIBuffer");
- if (renderUIBuffer)
- //
+ if (LLPipeline::RenderUIBuffer)
{
if (LLView::sIsRectDirty)
{
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index f5396b54a6..ca9b683d20 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4521,7 +4521,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
U32 local_id;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
- LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port);
+ gObjectList.getUUIDFromLocal(id, local_id, ip, port);
if (id == LLUUID::null)
{
LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index efd0b63880..d3ce31050d 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2009,14 +2009,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if(mesgsys != NULL)
{
- LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+ gObjectList.getUUIDFromLocal(parent_uuid,
parent_id,
mesgsys->getSenderIP(),
mesgsys->getSenderPort());
}
else
{
- LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+ gObjectList.getUUIDFromLocal(parent_uuid,
parent_id,
mRegionp->getHost().getAddress(),
mRegionp->getHost().getPort());
@@ -2150,7 +2150,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Debugging for suspected problems with local ids.
//LLUUID parent_uuid;
- //LLViewerObjectList::getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() );
+ //gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() );
//if (parent_uuid != cur_parentp->getID() )
//{
// LL_ERRS() << "Local ID match but UUID mismatch of viewer object" << LL_ENDL;
@@ -2173,14 +2173,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if(mesgsys != NULL)
{
- LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+ gObjectList.getUUIDFromLocal(parent_uuid,
parent_id,
gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort());
}
else
{
- LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+ gObjectList.getUUIDFromLocal(parent_uuid,
parent_id,
mRegionp->getHost().getAddress(),
mRegionp->getHost().getPort());
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index c5ffe66b8a..f6a71ee4b2 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -107,8 +107,6 @@ extern LLPipeline gPipeline;
// Statics for object lookup tables.
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
-std::map LLViewerObjectList::sIPAndPortToIndex;
-std::map LLViewerObjectList::sIndexAndLocalIDToUUID;
LLViewerObjectList::LLViewerObjectList()
: mNewObjectSignal() // FIRE-16647: Default object properties randomly aren't applied
@@ -147,17 +145,17 @@ void LLViewerObjectList::getUUIDFromLocal(LLUUID &id,
{
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
if (!index)
{
index = sSimulatorMachineIndex++;
- sIPAndPortToIndex[ipport] = index;
+ mIPAndPortToIndex[ipport] = index;
}
U64 indexid = (((U64)index) << 32) | (U64)local_id;
- id = get_if_there(sIndexAndLocalIDToUUID, indexid, LLUUID::null);
+ id = get_if_there(mIndexAndLocalIDToUUID, indexid, LLUUID::null);
}
U64 LLViewerObjectList::getIndex(const U32 local_id,
@@ -166,7 +164,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
{
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
if (!index)
{
@@ -186,14 +184,14 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
U32 ip = objectp->getRegion()->getHost().getAddress();
U32 port = objectp->getRegion()->getHost().getPort();
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
// LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
U64 indexid = (((U64)index) << 32) | (U64)local_id;
- std::map::iterator iter = sIndexAndLocalIDToUUID.find(indexid);
- if (iter == sIndexAndLocalIDToUUID.end())
+ std::map::iterator iter = mIndexAndLocalIDToUUID.find(indexid);
+ if (iter == mIndexAndLocalIDToUUID.end())
{
return false;
}
@@ -201,7 +199,7 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
// Found existing entry
if (iter->second == objectp->getID())
{ // Full UUIDs match, so remove the entry
- sIndexAndLocalIDToUUID.erase(iter);
+ mIndexAndLocalIDToUUID.erase(iter);
return true;
}
// UUIDs did not match - this would zap a valid entry, so don't erase it
@@ -219,17 +217,17 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
{
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
if (!index)
{
index = sSimulatorMachineIndex++;
- sIPAndPortToIndex[ipport] = index;
+ mIPAndPortToIndex[ipport] = index;
}
U64 indexid = (((U64)index) << 32) | (U64)local_id;
- sIndexAndLocalIDToUUID[indexid] = id;
+ mIndexAndLocalIDToUUID[indexid] = id;
//LL_INFOS() << "Adding object to table, full ID " << id
// << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 2df6717447..8e1596ed02 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -187,18 +187,18 @@ public:
// used to discount stats from this frame
bool mWasPaused;
- static void getUUIDFromLocal(LLUUID &id,
+ void getUUIDFromLocal(LLUUID &id,
const U32 local_id,
const U32 ip,
const U32 port);
- static void setUUIDAndLocal(const LLUUID &id,
+ void setUUIDAndLocal(const LLUUID &id,
const U32 local_id,
const U32 ip,
const U32 port); // Requires knowledge of message system info!
- static bool removeFromLocalIDTable(const LLViewerObject* objectp);
+ bool removeFromLocalIDTable(const LLViewerObject* objectp);
// Used ONLY by the orphaned object code.
- static U64 getIndex(const U32 local_id, const U32 ip, const U32 port);
+ U64 getIndex(const U32 local_id, const U32 ip, const U32 port);
S32 mNumUnknownUpdates;
S32 mNumDeadObjectUpdates;
@@ -238,9 +238,9 @@ protected:
S32 mCurLazyUpdateIndex;
static U32 sSimulatorMachineIndex;
- static std::map sIPAndPortToIndex;
+ std::map mIPAndPortToIndex;
- static std::map sIndexAndLocalIDToUUID;
+ std::map mIndexAndLocalIDToUUID;
friend class LLViewerObject;
@@ -293,7 +293,7 @@ extern LLViewerObjectList gObjectList;
*/
inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id)
{
- std::map >::iterator iter = mUUIDObjectMap.find(id);
+ auto iter = mUUIDObjectMap.find(id);
if(iter != mUUIDObjectMap.end())
{
return iter->second;
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 5e778ca9e0..22a34c8ded 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -520,7 +520,7 @@ void LLViewerTexture::updateClass()
// try to leave half a GB for everyone else, but keep at least 768MB for ourselves
F32 target = llmax(budget - 512.f, MIN_VRAM_BUDGET);
- sFreeVRAMMegabytes = target - used;
+ sFreeVRAMMegabytes = llmax(target - used, 0.f);
F32 over_pct = (used - target) / target;
@@ -1330,6 +1330,14 @@ void LLViewerFetchedTexture::destroyTexture()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
+ // Only actually destroy if VRAM is getting tight
+ static LLCachedControl fsMinVRAMTextureDestroyThreshold(gSavedSettings, "FSMinVRAMTextureDestroyThreshold");
+ if (sFreeVRAMMegabytes >= fsMinVRAMTextureDestroyThreshold)
+ {
+ return;
+ }
+ //
+
if (mNeedsCreateTexture)//return if in the process of generating a new texture.
{
return;
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index ca020e263d..5b2efa4893 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -939,7 +939,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
}
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- bool onFace = false;
for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
{
for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi)
@@ -948,7 +947,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
if (face && face->getViewerObject())
{
- onFace = true;
F32 radius;
F32 cos_angle_to_view_dir;
bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
@@ -1046,8 +1044,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
imagep->getLastReferencedTimer()->reset();
//reset texture state.
- if(!onFace)
- imagep->setInactive();
+ imagep->setInactive();
}
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4f6991cf97..25aeca6add 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2980,9 +2980,7 @@ void LLViewerWindow::draw()
//S32 screen_x, screen_y;
- //if (!gSavedSettings.getBOOL("RenderUIBuffer"))
- static LLCachedControl renderUIBuffer(gSavedSettings, "RenderUIBuffer");
- if (!renderUIBuffer)
+ if (!LLPipeline::RenderUIBuffer)
{
LLView::sDirtyRect = getWindowRectScaled();
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 04177ce019..ec0e5b0601 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4694,20 +4694,14 @@ void LLVOAvatar::updateDebugText()
{
// Leave mDebugText uncleared here, in case a derived class has added some state first
- // Use cached controls
- //if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
- static LLCachedControl debug_avatar_appearance_message(gSavedSettings, "DebugAvatarAppearanceMessage");
- if (debug_avatar_appearance_message)
- //
+ static LLCachedControl debug_av_appearance_message(gSavedSettings, "DebugAvatarAppearanceMessage");
+ if (debug_av_appearance_message)
{
updateAppearanceMessageDebugText();
}
- // Use cached controls
- //if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
- static LLCachedControl debug_avatar_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
- if (debug_avatar_composite_baked)
- //
+ static LLCachedControl debug_av_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
+ if (debug_av_composite_baked)
{
if (!mBakedTextureDebugText.empty())
addDebugText(mBakedTextureDebugText);
@@ -9548,7 +9542,8 @@ LLMotion* LLVOAvatar::findMotion(const LLUUID& id) const
// colorized if using deferred rendering.
void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
{
- if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
+ static LLCachedControl debug_av_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
+ if (debug_av_composite_baked)
{
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 2179f41a0a..5bcec34147 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -332,7 +332,7 @@ bool LLXMLRPCTransaction::Impl::process()
if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(),
root, nullptr))
{
- LL_WARNS() << "Failed parsing XML in response; request URI: "
+ LL_WARNS() << "Failed parsing XML in response; request URI: "
<< mURI << LL_ENDL;
}
else if (parseResponse(root))
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5e51ff41e9..9cc020b45a 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4722,7 +4722,8 @@ void LLPipeline::renderDebug()
mReflectionMapManager.renderDebug();
}
- if (gSavedSettings.getBOOL("RenderReflectionProbeVolumes") && !hud_only)
+ static LLCachedControl render_ref_probe_volumes(gSavedSettings, "RenderReflectionProbeVolumes");
+ if (render_ref_probe_volumes && !hud_only)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("probe debug display");
@@ -9196,7 +9197,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
gGL.diffuseColor4f(1, 1, 1, 1);
- S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
+ S32 shadow_detail = RenderShadowDetail;
// if not using VSM, disable color writes
if (shadow_detail <= 2)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 6ad6235c21..cd2504c0d8 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -692,8 +692,13 @@ class Windows_x86_64_Manifest(ViewerManifest):
# These need to be installed as a SxS assembly, currently a 'private' assembly.
# See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
self.path("msvcp140.dll")
+ self.path_optional("msvcp140_1.dll")
+ self.path_optional("msvcp140_2.dll")
+ self.path_optional("msvcp140_atomic_wait.dll")
+ self.path_optional("msvcp140_codecvt_ids.dll")
self.path("vcruntime140.dll")
self.path_optional("vcruntime140_1.dll")
+ self.path_optional("vcruntime140_threads.dll")
# SLVoice executable
with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')):