summaryrefslogtreecommitdiff
path: root/indra/newview/llfeaturemanager.cpp
diff options
context:
space:
mode:
authordavep <none@none>2014-09-19 11:58:16 -0500
committerdavep <none@none>2014-09-19 11:58:16 -0500
commit8682750eab88ac54030f04239ea2b4d497ad9567 (patch)
tree96cb4d0b8da8f0998e4dd7ddde3bba688c4feaf7 /indra/newview/llfeaturemanager.cpp
parenteef4acc5367a486b0c52c6ce5e1aba995fefd99c (diff)
parent749d1665643b33d6c5b7b97e43f4eae996fbf465 (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rwxr-xr-xindra/newview/llfeaturemanager.cpp63
1 files changed, 59 insertions, 4 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index d0555477ea..92e6f70566 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 < 0.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
}
@@ -730,6 +784,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));