diff options
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r-- | indra/newview/llfeaturemanager.cpp | 79 |
1 files changed, 24 insertions, 55 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e934041e2e..a2aae91ae1 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -408,6 +408,7 @@ bool LLFeatureManager::loadGPUClass() { if (!gSavedSettings.getBOOL("SkipBenchmark")) { + F32 class1_gbps = gSavedSettings.getF32("RenderClass1MemoryBandwidth"); //get memory bandwidth from benchmark F32 gbps; try @@ -424,65 +425,37 @@ bool LLFeatureManager::loadGPUClass() LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL; } + mGPUMemoryBandwidth = gbps; + + // bias by CPU speed + F32 cpu_basis_mhz = gSavedSettings.getF32("RenderCPUBasis"); + F32 cpu_mhz = (F32) gSysCPU.getMHz(); + F32 cpu_bias = llclamp(cpu_mhz / cpu_basis_mhz, 0.5f, 1.f); + gbps *= cpu_bias; + if (gbps < 0.f) - { //couldn't bench, use GLVersion + { //couldn't bench, default to Low #if LL_DARWIN //GLVersion is misleading on OSX, just default to class 3 if we can't bench LL_WARNS("RenderInit") << "Unable to get an accurate benchmark; defaulting to class 3" << LL_ENDL; mGPUClass = GPU_CLASS_3; #else - if (gGLManager.mGLVersion <= 2.f) - { - mGPUClass = GPU_CLASS_0; - } - else if (gGLManager.mGLVersion <= 3.f) - { - mGPUClass = GPU_CLASS_1; - } - else if (gGLManager.mGLVersion < 3.3f) - { - mGPUClass = GPU_CLASS_2; - } - else if (gGLManager.mGLVersion < 4.f) - { - mGPUClass = GPU_CLASS_3; - } - else - { - mGPUClass = GPU_CLASS_4; - } - if (gGLManager.mIsIntel && mGPUClass > GPU_CLASS_1) - { - // Intels are generally weaker then other GPUs despite having advanced features - mGPUClass = (EGPUClass)(mGPUClass - 1); - } - #endif - } - else if (gGLManager.mGLVersion <= 2.f) - { - mGPUClass = GPU_CLASS_0; - } - else if (gGLManager.mGLVersion <= 3.f) - { - mGPUClass = GPU_CLASS_1; - } - else if (gbps <= 5.f) - { mGPUClass = GPU_CLASS_0; + #endif } - else if (gbps <= 8.f) + else if (gbps <= class1_gbps) { mGPUClass = GPU_CLASS_1; } - else if (gbps <= 16.f) + else if (gbps <= class1_gbps *2.f) { mGPUClass = GPU_CLASS_2; } - else if (gbps <= 40.f) + else if (gbps <= class1_gbps*4.f) { mGPUClass = GPU_CLASS_3; } - else if (gbps <= 80.f) + else if (gbps <= class1_gbps*8.f) { mGPUClass = GPU_CLASS_4; } @@ -607,7 +580,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) void LLFeatureManager::setGraphicsLevel(U32 level, bool skipFeatures) { LLViewerShaderMgr::sSkipReload = true; - + flush_glerror(); // Whatever may have already happened (e.g., to cause us to change), don't let confuse it with new initializations. applyBaseMasks(); // if we're passed an invalid level, default to "Low" @@ -679,22 +652,18 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("TexUnit8orLess"); } - if (gGLManager.mHasMapBufferRange) - { - maskFeatures("MapBufferRange"); - } if (gGLManager.mVRAM > 512) { maskFeatures("VRAMGT512"); } - -#if LL_DARWIN - const LLOSInfo& osInfo = LLOSInfo::instance(); - if (osInfo.mMajorVer == 10 && osInfo.mMinorVer < 7) - { - maskFeatures("OSX_10_6_8"); - } -#endif + if (gGLManager.mVRAM < 2048) + { + maskFeatures("VRAMLT2GB"); + } + if (gGLManager.mGLVersion < 3.99f) + { + maskFeatures("GL3"); + } // now mask by gpu string // Replaces ' ' with '_' in mGPUString to deal with inability for parser to handle spaces |