summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/app_settings/settings.xml22
-rw-r--r--indra/newview/llfeaturemanager.cpp17
-rw-r--r--indra/newview/llglsandbox.cpp1
3 files changed, 35 insertions, 5 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0ccf74e923..60c415bc9e 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8770,6 +8770,28 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>RenderClass0MemoryBandwidth</key>
+ <map>
+ <key>Comment</key>
+ <string>Memory bandwidth at which to default to Class 0 in gigabytes per second. Used as basis for other classes.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>16.0</real>
+ </map>
+ <key>RenderCPUBasis</key>
+ <map>
+ <key>Comment</key>
+ <string>Reference CPU clockspeed to use to bias GPU class (in MHz).</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>3000.0</real>
+ </map>
<key>RenderComplexityColorMin</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 3240f169b3..c3780e42c6 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -402,6 +402,7 @@ bool LLFeatureManager::loadGPUClass()
{
if (!gSavedSettings.getBOOL("SkipBenchmark"))
{
+ F32 class0_gbps = gSavedSettings.getF32("RenderClass0MemoryBandwidth");
//get memory bandwidth from benchmark
F32 gbps;
try
@@ -418,6 +419,12 @@ bool LLFeatureManager::loadGPUClass()
LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL;
}
+ // 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
#if LL_DARWIN
@@ -460,23 +467,23 @@ bool LLFeatureManager::loadGPUClass()
{
mGPUClass = GPU_CLASS_1;
}
- else if (gbps <= 5.f)
+ else if (gbps <= class0_gbps)
{
mGPUClass = GPU_CLASS_0;
}
- else if (gbps <= 8.f)
+ else if (gbps <= class0_gbps*2.f)
{
mGPUClass = GPU_CLASS_1;
}
- else if (gbps <= 16.f)
+ else if (gbps <= class0_gbps*4.f)
{
mGPUClass = GPU_CLASS_2;
}
- else if (gbps <= 40.f)
+ else if (gbps <= class0_gbps*8.f)
{
mGPUClass = GPU_CLASS_3;
}
- else if (gbps <= 80.f)
+ else if (gbps <= class0_gbps*16.f)
{
mGPUClass = GPU_CLASS_4;
}
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 175f1849cf..0c8e248538 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -984,6 +984,7 @@ private:
//-----------------------------------------------------------------------------
// gpu_benchmark()
+// returns measured memory bandwidth of GPU in gigabytes per second
//-----------------------------------------------------------------------------
F32 gpu_benchmark()
{