From 24f8745914f7cec320d707f36895ac393575b861 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 19 Mar 2014 17:57:00 -0500 Subject: MAINT-3131 Use benchmark to determine GPU class instead of GPU table. --- indra/newview/llfeaturemanager.cpp | 63 +++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfeaturemanager.cpp') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index ba6f26d3ef..938ea707f9 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -417,13 +417,67 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) return parse_ok; } +F32 gpu_benchmark(); + bool LLFeatureManager::loadGPUClass() { + //get memory bandwidth from benchmark + F32 gbps = gpu_benchmark(); + + if (gbps < -1.f) + { //couldn't bench, use GLVersion + + 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; + } + } + else if (gbps < 5.f) + { + mGPUClass = GPU_CLASS_0; + } + else if (gbps < 10.f) + { + mGPUClass = GPU_CLASS_1; + } + else if (gbps < 20.f) + { + mGPUClass = GPU_CLASS_2; + } + else if (gbps < 40.f) + { + mGPUClass = GPU_CLASS_3; + } + else if (gbps < 80.f) + { + mGPUClass = GPU_CLASS_4; + } + else + { + mGPUClass = GPU_CLASS_5; + } + // defaults - mGPUClass = GPU_CLASS_UNKNOWN; mGPUString = gGLManager.getRawGLString(); - mGPUSupported = FALSE; + mGPUSupported = TRUE; +#if 0 // first table is in the app dir std::string app_path = gDirUtilp->getAppRODataDir(); app_path += gDirUtilp->getDirDelimiter(); @@ -451,8 +505,8 @@ bool LLFeatureManager::loadGPUClass() { parse_ok = parseGPUTable(app_path); } - - return parse_ok; // indicates that the file parsed correctly, not that the gpu was recognized +#endif + return true; // indicates that the file parsed correctly, not that the gpu was recognized } @@ -719,6 +773,7 @@ void LLFeatureManager::init() void LLFeatureManager::applyRecommendedSettings() { + loadGPUClass(); // apply saved settings // cap the level at 2 (high) U32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5)); -- cgit v1.2.3 From c142696f9dd18dcebee903444225026caf08e6e3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 21 Mar 2014 14:33:46 -0500 Subject: MAINT-3131 Actually fallback to GL version guess instead of treating error value from gpu_benchmark as actual memory bandwidth. --- indra/newview/llfeaturemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfeaturemanager.cpp') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 938ea707f9..5f37c0ea73 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -424,7 +424,7 @@ bool LLFeatureManager::loadGPUClass() //get memory bandwidth from benchmark F32 gbps = gpu_benchmark(); - if (gbps < -1.f) + if (gbps < 0.f) { //couldn't bench, use GLVersion if (gGLManager.mGLVersion < 2.f) -- cgit v1.2.3 From 4caa2746f3b1d336947dcc9e277af8b8c08b44e0 Mon Sep 17 00:00:00 2001 From: davep Date: Fri, 19 Sep 2014 13:01:41 -0500 Subject: MAINT-3131 Discard improbably high memory bandwidth measurements on OSX and default to Class 3 --- indra/newview/llfeaturemanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfeaturemanager.cpp') 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) { -- cgit v1.2.3