MAINT-1991 Attempt to mitigate crashes in GL drivers by encouraging people to update their drivers.

Reviewed by Simon
master
Dave Parks 2012-11-30 17:03:12 -06:00
parent 3df1e46588
commit e83700b56d
4 changed files with 66 additions and 6 deletions

View File

@ -1030,11 +1030,20 @@ bool LLAppViewer::init()
}
#if LL_WINDOWS
if (gGLManager.mIsIntel &&
LLFeatureManager::getInstance()->getGPUClass() > 0 &&
gGLManager.mGLVersion <= 3.f)
if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion())
{
LLNotificationsUtil::add("IntelOldDriver");
if (gGLManager.mIsIntel)
{
LLNotificationsUtil::add("IntelOldDriver");
}
else if (gGLManager.mIsNVIDIA)
{
LLNotificationsUtil::add("NVIDIAOldDriver");
}
else if (gGLManager.mIsATI)
{
LLNotificationsUtil::add("AMDOldDriver");
}
}
#endif

View File

@ -419,7 +419,7 @@ void LLFeatureManager::parseGPUTable(std::string filename)
// setup the tokenizer
std::string buf(buffer);
std::string cls, label, expr, supported;
std::string cls, label, expr, supported, stats_based, expected_gl_version;
boost_tokenizer tokens(buf, boost::char_separator<char>("\t\n"));
boost_tokenizer::iterator token_iter = tokens.begin();
@ -440,6 +440,14 @@ void LLFeatureManager::parseGPUTable(std::string filename)
{
supported = *token_iter++;
}
if (token_iter != tokens.end())
{
stats_based = *token_iter++;
}
if (token_iter != tokens.end())
{
expected_gl_version = *token_iter++;
}
if (label.empty() || expr.empty() || cls.empty() || supported.empty())
{
@ -469,6 +477,7 @@ void LLFeatureManager::parseGPUTable(std::string filename)
mGPUString = label;
mGPUClass = (EGPUClass) strtol(cls.c_str(), NULL, 10);
mGPUSupported = (BOOL) strtol(supported.c_str(), NULL, 10);
sscanf(expected_gl_version.c_str(), "%f", &mExpectedGLVersion);
}
}
#if LL_EXPORT_GPU_TABLE

View File

@ -103,7 +103,8 @@ public:
mTableVersion(0),
mSafe(FALSE),
mGPUClass(GPU_CLASS_UNKNOWN),
mGPUSupported(FALSE)
mExpectedGLVersion(0.f),
mGPUSupported(FALSE)
{
}
~LLFeatureManager() {cleanupFeatureTables();}
@ -118,6 +119,7 @@ public:
EGPUClass getGPUClass() { return mGPUClass; }
std::string& getGPUString() { return mGPUString; }
BOOL isGPUSupported() { return mGPUSupported; }
F32 getExpectedGLVersion() { return mExpectedGLVersion; }
void cleanupFeatureTables();
@ -157,6 +159,7 @@ protected:
S32 mTableVersion;
BOOL mSafe; // Reinitialize everything to the "safe" mask
EGPUClass mGPUClass;
F32 mExpectedGLVersion; //expected GL version according to gpu table
std::string mGPUString;
BOOL mGPUSupported;
};

View File

@ -1291,6 +1291,45 @@ Visit [_URL] for more information?
<tag>fail</tag>
</notification>
<notification
icon="alertmodal.tga"
name="AMDOldDriver"
type="alertmodal">
There is likely a newer driver for your graphics chip. Updating graphics drivers can substantially improve performance.
Visit [_URL] to check for driver updates?
<tag>confirm</tag>
<url option="0" name="url">
http://support.amd.com/us/Pages/AMDSupportHub.aspx
</url>
<usetemplate
ignoretext="My graphics driver is out of date"
name="okcancelignore"
notext="No"
yestext="Yes"/>
<tag>fail</tag>
</notification>
<notification
icon="alertmodal.tga"
name="NVIDIAOldDriver"
type="alertmodal">
There is likely a newer driver for your graphics chip. Updating graphics drivers can substantially improve performance.
Visit [_URL] to check for driver updates?
<tag>confirm</tag>
<url option="0" name="url">
http://www.nvidia.com/Download/index.aspx?lang=en-us
</url>
<usetemplate
ignoretext="My graphics driver is out of date"
name="okcancelignore"
notext="No"
yestext="Yes"/>
<tag>fail</tag>
</notification>
<notification
icon="alertmodal.tga"
name="UnknownGPU"