summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavep <none@none>2014-09-19 13:01:41 -0500
committerdavep <none@none>2014-09-19 13:01:41 -0500
commit4caa2746f3b1d336947dcc9e277af8b8c08b44e0 (patch)
tree3cf850d16fb63a947620f057a751341ee62c4b42
parent8682750eab88ac54030f04239ea2b4d497ad9567 (diff)
MAINT-3131 Discard improbably high memory bandwidth measurements on OSX and default to Class 3
-rwxr-xr-xindra/newview/llfeaturemanager.cpp6
-rwxr-xr-xindra/newview/llglsandbox.cpp15
2 files changed, 18 insertions, 3 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 92e6f70566..4db0422634 100755
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -426,7 +426,10 @@ bool LLFeatureManager::loadGPUClass()
if (gbps < 0.f)
{ //couldn't bench, use GLVersion
-
+#if LL_DARWIN
+ //GLVersion is misleading on OSX, just default to class 3 if we can't bench
+ mGPUClass = GPU_CLASS_3;
+#else
if (gGLManager.mGLVersion < 2.f)
{
mGPUClass = GPU_CLASS_0;
@@ -447,6 +450,7 @@ bool LLFeatureManager::loadGPUClass()
{
mGPUClass = GPU_CLASS_4;
}
+#endif
}
else if (gbps < 5.f)
{
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 0548de3895..4b8ac2b3cf 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -928,7 +928,7 @@ F32 gpu_benchmark()
std::vector<F32> results;
//build a random texture
- U8 pixels[res*res*4];
+ U8* pixels = new U8[res*res*4];
for (U32 i = 0; i < res*res*4; ++i)
{
@@ -950,6 +950,8 @@ F32 gpu_benchmark()
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RGBA, res,res,GL_RGBA, GL_UNSIGNED_BYTE, pixels);
}
+ delete [] pixels;
+
//make a dummy triangle to draw with
LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, GL_STATIC_DRAW_ARB);
buff->allocateBuffer(3, 0, true);
@@ -1031,7 +1033,16 @@ F32 gpu_benchmark()
F32 gbps = results[results.size()/2];
LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << LL_ENDL;
-
+
+#if LL_DARWIN
+ if (gbps > 512.f)
+ {
+ LL_INFOS() << "Memory bandwidth is improbably high and likely incorrect." << LL_ENDL;
+ //OSX is probably lying, discard result
+ gbps = -1.f;
+ }
+#endif
+
if (gGLManager.mHasTimerQuery)
{
F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;