From 7defa95f6778778d850aa1aba3ea8cb16396d0dd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 21 Mar 2014 14:30:14 -0500
Subject: [PATCH] MAINT-3131 fallback to CPU timers for return value of
 benchmark if ARB_timer_query is unavailable.

---
 indra/newview/llglsandbox.cpp | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 92553e875d1..f620bf19fbb 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -880,8 +880,8 @@ void LLViewerObjectList::renderObjectBeacons()
 
 F32 gpu_benchmark()
 {
-	if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery)
-	{ //don't bother benchmarking the fixed function or using CPU timers
+	if (!gGLManager.mHasShaderObjects)
+	{ //don't bother benchmarking the fixed function
 		return -1.f;
 	}
 
@@ -1011,15 +1011,15 @@ F32 gpu_benchmark()
 
 	llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << llendl;
 	
-	F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
-	F32 seconds = ms/1000.f;
-
-	F64 samples_drawn = res*res*count*samples;
-	F32 samples_sec = (samples_drawn/1000000000.0)/seconds;
-	gbps = samples_sec*8;
-
 	if (gGLManager.mHasTimerQuery)
 	{
+		F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
+		F32 seconds = ms/1000.f;
+
+		F64 samples_drawn = res*res*count*samples;
+		F32 samples_sec = (samples_drawn/1000000000.0)/seconds;
+		gbps = samples_sec*8;
+
 		llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << llendl;
 	}
 	else
-- 
GitLab