diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index 75b8c72817601754ba258fe2d095971a57cf5940..e94a72952624ae0b3141c8d16ddf0bcb3674fb77 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -288,6 +288,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>AlchemyMainLoopSleep</key> + <map> + <key>Comment</key> + <string>Sleep main loop after 90-ish fps threshold to reduce needless gpu strain</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>AlchemyMapShowAgentCount</key> <map> <key>Comment</key> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5760b3a70140a6dadb0b1f59286c2c76c8dad429..c4b1c9d10608a3bb41cde385fa356c8f5b22ca6b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1492,20 +1492,24 @@ bool LLAppViewer::doFrame() display(); - static U64 last_call = 0; - if (!gTeleportDisplay || gGLManager.mIsIntel) // SL-10625...throttle early, throttle often with Intel + static const LLCachedControl<bool> sleep_main_loop(gSavedSettings, "AlchemyMainLoopSleep", true); + if (sleep_main_loop) { - // Frame/draw throttling - U64 elapsed_time = LLTimer::getTotalTime() - last_call; - if (elapsed_time < mMinMicroSecPerFrame) + static U64 last_call = 0; + if (!gTeleportDisplay || gGLManager.mIsIntel) // SL-10625...throttle early, throttle often with Intel { - LL_RECORD_BLOCK_TIME(FTM_SLEEP); - // llclamp for when time function gets funky - U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); - micro_sleep(sleep_time, 0); + // Frame/draw throttling + U64 elapsed_time = LLTimer::getTotalTime() - last_call; + if (elapsed_time < mMinMicroSecPerFrame) + { + LL_RECORD_BLOCK_TIME(FTM_SLEEP); + // llclamp for when time function gets funky + U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); + micro_sleep(sleep_time, 0); + } } + last_call = LLTimer::getTotalTime(); } - last_call = LLTimer::getTotalTime(); pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots