diff options
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r-- | indra/newview/llfeaturemanager.cpp | 72 |
1 files changed, 26 insertions, 46 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9f12648470..fcc3423b4d 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -40,6 +40,7 @@ #include "llappviewer.h" #include "llbufferstream.h" +#include "llexception.h" #include "llnotificationsutil.h" #include "llviewercontrol.h" #include "llworld.h" @@ -70,8 +71,8 @@ const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; #if 0 // consuming code in #if 0 below #endif -LLFeatureInfo::LLFeatureInfo(const std::string& name, const BOOL available, const F32 level) - : mValid(TRUE), mName(name), mAvailable(available), mRecommendedLevel(level) +LLFeatureInfo::LLFeatureInfo(const std::string& name, const bool available, const F32 level) + : mValid(true), mName(name), mAvailable(available), mRecommendedLevel(level) { } @@ -84,7 +85,7 @@ LLFeatureList::~LLFeatureList() { } -void LLFeatureList::addFeature(const std::string& name, const BOOL available, const F32 level) +void LLFeatureList::addFeature(const std::string& name, const bool available, const F32 level) { if (mFeatures.count(name)) { @@ -99,7 +100,7 @@ void LLFeatureList::addFeature(const std::string& name, const BOOL available, co mFeatures[name] = fi; } -BOOL LLFeatureList::isFeatureAvailable(const std::string& name) +bool LLFeatureList::isFeatureAvailable(const std::string& name) { if (mFeatures.count(name)) { @@ -108,9 +109,9 @@ BOOL LLFeatureList::isFeatureAvailable(const std::string& name) LL_WARNS_ONCE("RenderInit") << "Feature " << name << " not on feature list!" << LL_ENDL; - // changing this to TRUE so you have to explicitly disable + // changing this to true so you have to explicitly disable // something for it to be disabled - return TRUE; + return true; } F32 LLFeatureList::getRecommendedValue(const std::string& name) @@ -125,7 +126,7 @@ F32 LLFeatureList::getRecommendedValue(const std::string& name) return 0; } -BOOL LLFeatureList::maskList(LLFeatureList &mask) +bool LLFeatureList::maskList(LLFeatureList &mask) { LL_DEBUGS_ONCE() << "Masking with " << mask.mName << LL_ENDL; // @@ -168,7 +169,7 @@ BOOL LLFeatureList::maskList(LLFeatureList &mask) dump(); LL_CONT << LL_ENDL; - return TRUE; + return true; } void LLFeatureList::dump() @@ -196,7 +197,7 @@ static const std::vector<std::string> sGraphicsLevelNames = boost::assign::list_ U32 LLFeatureManager::getMaxGraphicsLevel() const { - return sGraphicsLevelNames.size() - 1; + return static_cast<U32>(sGraphicsLevelNames.size()) - 1; } bool LLFeatureManager::isValidGraphicsLevel(U32 level) const @@ -243,13 +244,13 @@ LLFeatureList *LLFeatureManager::findMask(const std::string& name) return NULL; } -BOOL LLFeatureManager::maskFeatures(const std::string& name) +bool LLFeatureManager::maskFeatures(const std::string& name) { LLFeatureList *maskp = findMask(name); if (!maskp) { LL_DEBUGS("RenderInit") << "Unknown feature mask " << name << LL_ENDL; - return FALSE; + return false; } LL_INFOS("RenderInit") << "Applying GPU Feature list: " << name << LL_ENDL; return maskList(*maskp); @@ -294,7 +295,7 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) if (!file) { LL_WARNS("RenderInit") << "Unable to open feature table " << filename << LL_ENDL; - return FALSE; + return false; } // Check file version @@ -377,33 +378,6 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) F32 gpu_benchmark(); -#if LL_WINDOWS - -F32 logExceptionBenchmark() -{ - // FIXME: gpu_benchmark uses many C++ classes on the stack to control state. - // SEH exceptions with our current exception handling options do not call - // destructors for these classes, resulting in an undefined state should - // this handler be invoked. - F32 gbps = -1; - __try - { - gbps = gpu_benchmark(); - } - __except (msc_exception_filter(GetExceptionCode(), GetExceptionInformation())) - { - // HACK - ensure that profiling is disabled - LLGLSLShader::finishProfile(false); - - // convert to C++ styled exception - char integer_string[32]; - sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); - throw std::exception(integer_string); - } - return gbps; -} -#endif - bool LLFeatureManager::loadGPUClass() { if (!gSavedSettings.getBOOL("SkipBenchmark")) @@ -413,14 +387,12 @@ bool LLFeatureManager::loadGPUClass() F32 gbps; try { -#if LL_WINDOWS - gbps = logExceptionBenchmark(); -#else - gbps = gpu_benchmark(); -#endif + gbps = LL::seh::catcher(gpu_benchmark); } catch (const std::exception& e) { + // HACK - ensure that profiling is disabled + LLGLSLShader::finishProfile(); gbps = -1.f; LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL; } @@ -486,7 +458,7 @@ bool LLFeatureManager::loadGPUClass() // defaults mGPUString = gGLManager.getRawGLString(); - mGPUSupported = TRUE; + mGPUSupported = true; return true; // indicates that a gpu value was established } @@ -568,7 +540,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) // handle all the different types if(ctrl->isType(TYPE_BOOLEAN)) { - gSavedSettings.setBOOL(mIt->first, (BOOL)getRecommendedValue(mIt->first)); + gSavedSettings.setBOOL(mIt->first, (bool)getRecommendedValue(mIt->first)); } else if (ctrl->isType(TYPE_S32)) { @@ -656,6 +628,14 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("Intel"); } + if (gGLManager.mIsApple) + { + maskFeatures("AppleGPU"); + } + else + { + maskFeatures("NonAppleGPU"); + } if (gGLManager.mGLVersion < 3.f) { maskFeatures("OpenGLPre30"); |