From 9611356556c3e6da26dae7482e315641766b4eac Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 28 Aug 2012 13:52:14 -0500 Subject: MAINT-1491 Integration of statistically generated GPU table -- enable shadows by default where appropriate. --- indra/newview/llfeaturemanager.cpp | 46 +++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfeaturemanager.cpp') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index ec2493dd2e..ff7b6689af 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -57,6 +57,7 @@ #include "lldxhardware.h" #endif +#define LL_EXPORT_GPU_TABLE 0 #if LL_DARWIN const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; @@ -386,6 +387,13 @@ void LLFeatureManager::parseGPUTable(std::string filename) *i = tolower(*i); } +#if LL_EXPORT_GPU_TABLE + llofstream json; + json.open("gpu_table.json"); + + json << "var gpu_table = [" << std::endl; +#endif + bool gpuFound; U32 lineNumber; for (gpuFound = false, lineNumber = 0; !gpuFound && !file.eof(); lineNumber++) @@ -438,7 +446,13 @@ void LLFeatureManager::parseGPUTable(std::string filename) LL_WARNS("RenderInit") << "invald gpu_table.txt:" << lineNumber << ": '" << buffer << "'" << LL_ENDL; continue; } - +#if LL_EXPORT_GPU_TABLE + json << "{'label' : '" << label << "',\n" << + "'regexp' : '" << expr << "',\n" << + "'class' : '" << cls << "',\n" << + "'supported' : '" << supported << "'\n},\n"; +#endif + for (U32 i = 0; i < expr.length(); i++) /*Flawfinder: ignore*/ { expr[i] = tolower(expr[i]); @@ -449,12 +463,18 @@ void LLFeatureManager::parseGPUTable(std::string filename) if(boost::regex_search(renderer, re)) { // if we found it, stop! +#if !LL_EXPORT_GPU_TABLE gpuFound = true; +#endif mGPUString = label; mGPUClass = (EGPUClass) strtol(cls.c_str(), NULL, 10); mGPUSupported = (BOOL) strtol(supported.c_str(), NULL, 10); } } +#if LL_EXPORT_GPU_TABLE + json << "];\n\n"; + json.close(); +#endif file.close(); if ( gpuFound ) @@ -585,7 +605,7 @@ void LLFeatureManager::applyRecommendedSettings() { // apply saved settings // cap the level at 2 (high) - S32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_2)); + S32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5)); llinfos << "Applying Recommended Features" << llendl; @@ -678,18 +698,32 @@ void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures) { //same as low, but with "Basic Shaders" enabled maskFeatures("Low"); } + maskFeatures("Class0"); break; case 1: maskFeatures("Mid"); + maskFeatures("Class1"); break; case 2: maskFeatures("High"); + maskFeatures("Class2"); break; case 3: - maskFeatures("Ultra"); + maskFeatures("High"); + maskFeatures("Class3"); + break; + case 4: + maskFeatures("High"); + maskFeatures("Class4"); break; + case 5: + maskFeatures("High"); + maskFeatures("Class5"); + break; + default: maskFeatures("Low"); + maskFeatures("Class0"); break; } @@ -714,14 +748,16 @@ void LLFeatureManager::applyBaseMasks() mFeatures = maskp->getFeatures(); // mask class - if (mGPUClass >= 0 && mGPUClass < 4) + if (mGPUClass >= 0 && mGPUClass < 6) { const char* class_table[] = { "Class0", "Class1", "Class2", - "Class3" + "Class3", + "Class4", + "Class5", }; LL_INFOS("RenderInit") << "Setting GPU Class to " << class_table[mGPUClass] << LL_ENDL; -- cgit v1.2.3