summaryrefslogtreecommitdiff
path: root/indra/newview/llfeaturemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r--indra/newview/llfeaturemanager.cpp44
1 files changed, 40 insertions, 4 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index ac7d7b755b..88024b8390 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -40,7 +40,6 @@
#include "llappviewer.h"
#include "llbufferstream.h"
-#include "llexception.h"
#include "llnotificationsutil.h"
#include "llviewercontrol.h"
#include "llworld.h"
@@ -378,6 +377,33 @@ 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();
+
+ // 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"))
@@ -387,12 +413,14 @@ bool LLFeatureManager::loadGPUClass()
F32 gbps;
try
{
- gbps = LL::seh::catcher(gpu_benchmark);
+#if LL_WINDOWS
+ gbps = logExceptionBenchmark();
+#else
+ gbps = gpu_benchmark();
+#endif
}
catch (const std::exception& e)
{
- // HACK - ensure that profiling is disabled
- LLGLSLShader::finishProfile(false);
gbps = -1.f;
LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL;
}
@@ -628,6 +656,14 @@ void LLFeatureManager::applyBaseMasks()
{
maskFeatures("Intel");
}
+ if (gGLManager.mIsApple)
+ {
+ maskFeatures("AppleGPU");
+ }
+ else
+ {
+ maskFeatures("NonAppleGPU");
+ }
if (gGLManager.mGLVersion < 3.f)
{
maskFeatures("OpenGLPre30");