MAINT-3131 fallback to CPU timers for return value of benchmark if ARB_timer_query is unavailable.

Dave Parks 2014-03-21 14:30:14 -05:00
parent fbfd010381
commit 79aa716ed8
1 changed files with 9 additions and 9 deletions

View File

@ -945,8 +945,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;
}
@ -1077,15 +1077,15 @@ F32 gpu_benchmark()
LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << LL_ENDL;
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;
LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL;
}
else