Skip to content
Snippets Groups Projects
Commit 4caa2746 authored by davep's avatar davep
Browse files

MAINT-3131 Discard improbably high memory bandwidth measurements on OSX and default to Class 3

parent 8682750e
No related branches found
No related tags found
No related merge requests found
...@@ -426,7 +426,10 @@ bool LLFeatureManager::loadGPUClass() ...@@ -426,7 +426,10 @@ bool LLFeatureManager::loadGPUClass()
if (gbps < 0.f) if (gbps < 0.f)
{ //couldn't bench, use GLVersion { //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) if (gGLManager.mGLVersion < 2.f)
{ {
mGPUClass = GPU_CLASS_0; mGPUClass = GPU_CLASS_0;
...@@ -447,6 +450,7 @@ bool LLFeatureManager::loadGPUClass() ...@@ -447,6 +450,7 @@ bool LLFeatureManager::loadGPUClass()
{ {
mGPUClass = GPU_CLASS_4; mGPUClass = GPU_CLASS_4;
} }
#endif
} }
else if (gbps < 5.f) else if (gbps < 5.f)
{ {
......
...@@ -928,7 +928,7 @@ F32 gpu_benchmark() ...@@ -928,7 +928,7 @@ F32 gpu_benchmark()
std::vector<F32> results; std::vector<F32> results;
//build a random texture //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) for (U32 i = 0; i < res*res*4; ++i)
{ {
...@@ -950,6 +950,8 @@ F32 gpu_benchmark() ...@@ -950,6 +950,8 @@ F32 gpu_benchmark()
LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RGBA, res,res,GL_RGBA, GL_UNSIGNED_BYTE, pixels); 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 //make a dummy triangle to draw with
LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, GL_STATIC_DRAW_ARB); LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, GL_STATIC_DRAW_ARB);
buff->allocateBuffer(3, 0, true); buff->allocateBuffer(3, 0, true);
...@@ -1032,6 +1034,15 @@ F32 gpu_benchmark() ...@@ -1032,6 +1034,15 @@ F32 gpu_benchmark()
LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << LL_ENDL; 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) if (gGLManager.mHasTimerQuery)
{ {
F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment