summaryrefslogtreecommitdiff
path: root/indra/newview/llfeaturemanager.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-19 12:01:51 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-19 12:01:51 -0800
commit62301cb883dd6fadcd5d30acd604f72d2c0b1794 (patch)
treebaa94e42e64a07351c8e9722c578e94b43a811d8 /indra/newview/llfeaturemanager.cpp
parent6036ee9c421154a83a306bc16533e47f9494fd32 (diff)
parent185169cbbecebe2a35dbd937d6fb4e0a30fa1832 (diff)
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r--indra/newview/llfeaturemanager.cpp46
1 files changed, 41 insertions, 5 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 393f8b9d46..6f11d4d4ca 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;
}
@@ -715,14 +749,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;