From 9eeb4c9750dd4ac3052f6ee84d1ce305b3c9cf70 Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Tue, 25 Jun 2019 15:14:32 -0700
Subject: [PATCH] SL-10625

Make intel throttle the CPU with sleeps in all cases and fix calc of microsec frame time.
---
 indra/newview/llappviewer.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 500efa24c4e..5b2e5fff0bc 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1477,8 +1477,10 @@ bool LLAppViewer::doFrame()
 				pingMainloopTimeout("Main:Display");
 				gGLActive = TRUE;
 
+				display();
+
 				static U64 last_call = 0;
-				if (!gTeleportDisplay)
+				if (!gTeleportDisplay || gGLManager.mIsIntel) // SL-10625...throttle early, throttle often with Intel
 				{
 					// Frame/draw throttling
 					U64 elapsed_time = LLTimer::getTotalTime() - last_call;
@@ -1492,8 +1494,6 @@ bool LLAppViewer::doFrame()
 				}
 				last_call = LLTimer::getTotalTime();
 
-				display();
-
 				pingMainloopTimeout("Main:Snapshot");
 				LLFloaterSnapshot::update(); // take snapshots
 					LLFloaterOutfitSnapshot::update();
@@ -5390,7 +5390,7 @@ bool LLAppViewer::onChangeFrameLimit(LLSD const & evt)
 {
 	if (evt.asInteger() > 0)
 	{
-		mMinMicroSecPerFrame = 1000000 / evt.asInteger();
+		mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger()));
 	}
 	else
 	{
-- 
GitLab