diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-09-28 18:01:02 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-10-18 18:38:25 +0800 |
commit | ad3cbb9f75c4ea7f0473225afc034c403b54fc82 (patch) | |
tree | 4e4239e97a405d2820e26a4f2215ad8ccb88af7e /indra/newview/llfeaturemanager.cpp | |
parent | 7fdb350e487acc35b26de6e243ff27f94185d3a5 (diff) | |
parent | 64c055f9be03861661f8c211ae36ba0db489b12d (diff) |
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r-- | indra/newview/llfeaturemanager.cpp | 44 |
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"); |