diff options
author | Kitty Barnett <develop@catznip.com> | 2024-09-17 19:16:25 +0200 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2024-09-17 19:16:25 +0200 |
commit | 25f8cbece402c0987e2035eb7721e21a9d2761c3 (patch) | |
tree | f2408e7d1f7b58f49f8cefc5dda7dd56d08c98f8 /indra/newview/llglsandbox.cpp | |
parent | 6f4d7c2d6d363aee60d2f3d1fe4ed4a251aaa11b (diff) | |
parent | f378d2f95ad751ccf7456f79baba61d6c39f5c36 (diff) |
Merge branch 'develop' into rlva/base
Diffstat (limited to 'indra/newview/llglsandbox.cpp')
-rw-r--r-- | indra/newview/llglsandbox.cpp | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 19cb4d04e2..0248f5710f 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -1075,6 +1075,9 @@ F32 gpu_benchmark() return -1.f; } LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RGBA, res,res,GL_RGBA, GL_UNSIGNED_BYTE, pixels); + // disable mipmaps and use point filtering to cause cache misses + gGL.getTexUnit(0)->setHasMipMaps(false); + gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); if (alloc_timer.getElapsedTimeF32() > time_limit) { @@ -1118,57 +1121,6 @@ F32 gpu_benchmark() LLGLSLShader::unbind(); - F32 time_passed = 0; // seconds - - { //run CPU timer benchmark - glFinish(); - gBenchmarkProgram.bind(); - for (S32 c = -1; c < samples && time_passed < time_limit; ++c) - { - LLTimer timer; - timer.start(); - - for (U32 i = 0; i < count; ++i) - { - dest[i].bindTarget(); - texHolder.bind(i); - buff->setBuffer(); - buff->drawArrays(LLRender::TRIANGLES, 0, 3); - dest[i].flush(); - } - - //wait for current batch of copies to finish - glFinish(); - - F32 time = timer.getElapsedTimeF32(); - time_passed += time; - - if (c >= 0) // <-- ignore the first sample as it tends to be artificially slow - { - //store result in gigabytes per second - F32 gb = (F32)((F64)(res * res * 8 * count)) / (1000000000); - F32 gbps = gb / time; - results.push_back(gbps); - } - } - gBenchmarkProgram.unbind(); - } - - std::sort(results.begin(), results.end()); - - F32 gbps = results[results.size()/2]; - - LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to CPU timers, " << (F32)results.size() << " tests took " << time_passed << " seconds" << LL_ENDL; - -#if LL_DARWIN - if (gbps > 512.f) - { - LL_WARNS("Benchmark") << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL; - //OSX is probably lying, discard result - return -1.f; - } -#endif - // run GPU timer benchmark { ShaderProfileHelper initProfile; @@ -1191,8 +1143,9 @@ F32 gpu_benchmark() F32 seconds = ms/1000.f; F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn; - F32 samples_sec = (F32)((samples_drawn/1000000000.0)/seconds); - gbps = samples_sec*4; // 4 bytes per sample + F64 gpixels_drawn = samples_drawn / 1000000000.0; + F32 samples_sec = (F32)(gpixels_drawn/seconds); + F32 gbps = samples_sec*4; // 4 bytes per sample LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; |