Skip to content
Snippets Groups Projects
Commit 7defa95f authored by David Parks's avatar David Parks
Browse files

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

parent 24f87459
Branches
Tags
No related merge requests found
...@@ -880,8 +880,8 @@ void LLViewerObjectList::renderObjectBeacons() ...@@ -880,8 +880,8 @@ void LLViewerObjectList::renderObjectBeacons()
F32 gpu_benchmark() F32 gpu_benchmark()
{ {
if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery) if (!gGLManager.mHasShaderObjects)
{ //don't bother benchmarking the fixed function or using CPU timers { //don't bother benchmarking the fixed function
return -1.f; return -1.f;
} }
...@@ -1011,6 +1011,8 @@ F32 gpu_benchmark() ...@@ -1011,6 +1011,8 @@ F32 gpu_benchmark()
llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << llendl; llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << llendl;
if (gGLManager.mHasTimerQuery)
{
F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
F32 seconds = ms/1000.f; F32 seconds = ms/1000.f;
...@@ -1018,8 +1020,6 @@ F32 gpu_benchmark() ...@@ -1018,8 +1020,6 @@ F32 gpu_benchmark()
F32 samples_sec = (samples_drawn/1000000000.0)/seconds; F32 samples_sec = (samples_drawn/1000000000.0)/seconds;
gbps = samples_sec*8; gbps = samples_sec*8;
if (gGLManager.mHasTimerQuery)
{
llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << llendl; llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << llendl;
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment