diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2021-11-19 14:42:49 -0500 | 
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2021-11-19 14:43:20 -0500 | 
| commit | 53cf740d874f376f212a5d706ca70cbf35fee259 (patch) | |
| tree | f8ccf9a74a0ee72e41ce40e9ee64765bd0171248 | |
| parent | 176b2acdacd2703eea15584f8e763abfc50f6266 (diff) | |
SL-16094: Service mainloop WorkQueue every LLAppViewer::idle() call
even if idle() exits early.
| -rw-r--r-- | indra/newview/llappviewer.cpp | 28 | 
1 files changed, 14 insertions, 14 deletions
| diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 93e5c2e341..e7f104d6fd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4854,6 +4854,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. @@ -5226,20 +5240,6 @@ void LLAppViewer::idle()  		}  	} -	// 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); -  	// Handle shutdown process, for example,  	// wait for floaters to close, send quit message,  	// forcibly quit if it has taken too long | 
