summaryrefslogtreecommitdiff
path: root/indra/newview/llglsandbox.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2014-11-18 12:54:13 -0800
committerGraham Linden <graham@lindenlab.com>2014-11-18 12:54:13 -0800
commita882d7a02b9e8a58cdbfa945682a313718886ab4 (patch)
tree8de380c053fb15b0aa177384f3a611f2e3c84757 /indra/newview/llglsandbox.cpp
parent962a342c65ff541baf0a066a47643c8b9fc172a4 (diff)
Fix for gpu_bench crash without parallels knock-on
Diffstat (limited to 'indra/newview/llglsandbox.cpp')
-rwxr-xr-xindra/newview/llglsandbox.cpp35
1 files changed, 12 insertions, 23 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 687838a344..08ec8031e8 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -881,13 +881,14 @@ void LLViewerObjectList::renderObjectBeacons()
F32 gpu_benchmark()
{
- if (!gGLManager.mHasShaderObjects)
- { //don't bother benchmarking the fixed function
+ if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery)
+ { // don't bother benchmarking the fixed function
+ // or venerable drivers which don't support accurate timing anyway
+ // and are likely to be correctly identified by the GPU table already.
return -1.f;
}
-
- if (gBenchmarkProgram.mProgramObject == 0)
+ if (gBenchmarkProgram.mProgramObject == 0)
{
LLViewerShaderMgr::instance()->initAttribsAndUniforms();
@@ -983,15 +984,11 @@ F32 gpu_benchmark()
bool busted_finish = false;
- LL_INFOS() << "GPU BENCHMARK START." << LL_ENDL;
-
for (S32 c = -1; c < samples; ++c)
{
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
glFinish();
- LL_INFOS() << "GPU BENCHMARK ITERATION." << LL_ENDL;
-
LLTimer timer;
timer.start();
@@ -1029,11 +1026,10 @@ F32 gpu_benchmark()
if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f)
{ //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored
busted_finish = true;
- LL_INFOS() << "GPU BENCHMARK DETECTED GL DRIVER WITH NOT SO MUCH WORKING glFinish." << LL_ENDL;
+ LL_INFOS() << "GPU Benchmark detected GL driver with broken glFinish implementation. Neat." << LL_ENDL;
}
else
{
- LL_INFOS() << "GPU BENCHMARK ESTIMATE." << gbps << " Gbps" << LL_ENDL;
results.push_back(gbps);
}
}
@@ -1063,21 +1059,14 @@ F32 gpu_benchmark()
}
#endif
- if (gGLManager.mHasTimerQuery)
- {
- F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
- F32 seconds = ms/1000.f;
+ 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;
+ 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
- {
- LL_INFOS() << "ARB_timer_query unavailable." << LL_ENDL;
- }
+ LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL;
return gbps;
}