diff options
author | Graham Linden <none@none> | 2014-11-17 14:55:00 -0800 |
---|---|---|
committer | Graham Linden <none@none> | 2014-11-17 14:55:00 -0800 |
commit | 962a342c65ff541baf0a066a47643c8b9fc172a4 (patch) | |
tree | 4487527cf9d847e6d11e5d7e829cb16cc2eb686c /indra/newview/llglsandbox.cpp | |
parent | c9b26b11e6131b7345c9e3c90d6fb9d410d58631 (diff) | |
parent | de2fe42a5277d1c9609372ac395767ca976d94e7 (diff) |
Merge fix attempt 3 to avoid crash in gpu_benchmark and get more insight
Diffstat (limited to 'indra/newview/llglsandbox.cpp')
-rwxr-xr-x | indra/newview/llglsandbox.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 7cf17c90e9..687838a344 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -920,7 +920,10 @@ F32 gpu_benchmark() //number of samples to take const S32 samples = 64; - LLGLSLShader::initProfile(); + if (gGLManager.mHasTimerQuery) + { + LLGLSLShader::initProfile(); + } LLRenderTarget dest[count]; U32 source[count]; @@ -977,15 +980,18 @@ F32 gpu_benchmark() buff->flush(); gBenchmarkProgram.bind(); - buff->setBuffer(LLVertexBuffer::MAP_VERTEX); - - //wait for any previoius GL commands to finish - glFinish(); 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(); @@ -1023,9 +1029,11 @@ 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; } else { + LL_INFOS() << "GPU BENCHMARK ESTIMATE." << gbps << " Gbps" << LL_ENDL; results.push_back(gbps); } } @@ -1033,10 +1041,12 @@ F32 gpu_benchmark() gBenchmarkProgram.unbind(); - LLGLSLShader::finishProfile(false); - - LLImageGL::deleteTextures(count, source); + if (gGLManager.mHasTimerQuery) + { + LLGLSLShader::finishProfile(false); + } + LLImageGL::deleteTextures(count, source); std::sort(results.begin(), results.end()); |