diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llstartup.h | 8 | ||||
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 2 |
4 files changed, 36 insertions, 10 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 177558d38f..5b3cbff9b8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4953,6 +4953,20 @@ void LLAppViewer::idle() LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); + // Service the WorkQueue we use for replies from worker threads. + // Use function statics for the timeslice setting so we only have to fetch + // and convert MainWorkTime once. + static F32 MainWorkTimeRaw = gSavedSettings.getF32("MainWorkTime"); + static F32Milliseconds MainWorkTimeMs(MainWorkTimeRaw); + // MainWorkTime is specified in fractional milliseconds, but std::chrono + // uses integer representations. What if we want less than a microsecond? + // Use nanoseconds. We're very sure we will never need to specify a + // MainWorkTime that would be larger than we could express in + // std::chrono::nanoseconds. + static std::chrono::nanoseconds MainWorkTimeNanoSec{ + std::chrono::nanoseconds::rep(MainWorkTimeMs.value() * 1000000)}; + gMainloopWork.runFor(MainWorkTimeNanoSec); + // Cap out-of-control frame times // Too low because in menus, swapping, debugger, etc. // Too high because idle called with no objects in view, etc. @@ -5325,9 +5339,6 @@ void LLAppViewer::idle() } } - // Execute deferred tasks. - LLDeferredTaskList::instance().run(); - // Handle shutdown process, for example, // wait for floaters to close, send quit message, // forcibly quit if it has taken too long diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c178f27db7..8d21b04511 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -35,6 +35,7 @@ #else # include <sys/stat.h> // mkdir() #endif +#include <memory> // std::unique_ptr #include "llviewermedia_streamingaudio.h" #include "llaudioengine.h" @@ -252,9 +253,10 @@ static bool mBenefitsSuccessfullyInit = false; const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds -boost::scoped_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState")); -boost::scoped_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener()); -boost::scoped_ptr<LLViewerStats::PhaseMap> LLStartUp::sPhases(new LLViewerStats::PhaseMap); +std::unique_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState")); +std::unique_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener()); +std::unique_ptr<LLViewerStats::PhaseMap> LLStartUp::sPhases(new LLViewerStats::PhaseMap); +std::unique_ptr<LL::ThreadPool> gGeneralThreadPool; // // local function declaration @@ -1489,6 +1491,17 @@ bool idle_startup() gAgentCamera.resetCamera(); display_startup(); + // start up the ThreadPool we'll use for textures et al. + LLSD poolSizes{ gSavedSettings.getLLSD("ThreadPoolSizes") }; + LLSD sizeSpec{ poolSizes["General"] }; + LLSD::Integer poolSize{ sizeSpec.isInteger()? sizeSpec.asInteger() : 3 }; + LL_DEBUGS("ThreadPool") << "Instantiating General pool with " + << poolSize << " threads" << LL_ENDL; + // We don't want anyone, especially the main thread, to have to block + // due to this ThreadPool being full. + gGeneralThreadPool.reset(new LL::ThreadPool("General", poolSize, 1024*1024)); + gGeneralThreadPool->start(); + // Initialize global class data needed for surfaces (i.e. textures) LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL; // Initialize all of the viewer object classes for the first time (doing things like texture fetches. diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 116aeb36a7..fe8e215f76 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -27,7 +27,7 @@ #ifndef LL_LLSTARTUP_H #define LL_LLSTARTUP_H -#include <boost/scoped_ptr.hpp> +#include <memory> // unique_ptr class LLViewerTexture ; class LLEventPump; @@ -130,9 +130,9 @@ private: static std::string startupStateToString(EStartupState state); static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState - static boost::scoped_ptr<LLEventPump> sStateWatcher; - static boost::scoped_ptr<LLStartupListener> sListener; - static boost::scoped_ptr<LLViewerStats::PhaseMap> sPhases; + static std::unique_ptr<LLEventPump> sStateWatcher; + static std::unique_ptr<LLStartupListener> sListener; + static std::unique_ptr<LLViewerStats::PhaseMap> sPhases; }; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index e20c64e48e..9f76543647 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -260,7 +260,9 @@ static bool handleAnisotropicChanged(const LLSD& newvalue) static bool handleVSyncChanged(const LLSD& newvalue) { +#if LL_WINDOWS gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean()); +#endif return true; } |