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.cpp66
1 files changed, 62 insertions, 4 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index ac7d7b755b..b25ef02e13 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;
}
@@ -627,6 +655,32 @@ void LLFeatureManager::applyBaseMasks()
if (gGLManager.mIsIntel)
{
maskFeatures("Intel");
+ // check against 3.33 to avoid applying this fallback twice
+ if (gGLManager.mGLVersion < 4.59f && gGLManager.mGLVersion > 3.33f)
+ {
+ // if we don't have OpenGL 4.6 on intel, set it to OpenGL 3.3
+ // we also want to trigger the GL3 fallbacks on these chipsets
+ // this is expected to be mainly pre-Haswell Intel HD Graphics 4X00 and 5X00.
+ // A lot of these chips claim 4.3 or 4.4 support, but don't seem to work.
+ // https://code.blender.org/2019/04/supported-gpus-in-blender-2-80/
+ // https://docs.blender.org/manual/en/latest/troubleshooting/gpu/windows/intel.html#legacy-intel-hd-4000-5000
+ // https://www.intel.com/content/www/us/en/support/articles/000005524/graphics.html
+ // this will disable things like reflection probes, HDR, FXAA and SMAA
+ LL_INFOS("RenderInit") << "Applying Intel integrated pre-Haswell fallback. Downgrading feature usage to OpenGL 3.3" << LL_ENDL;
+ gGLManager.mGLVersion = llmin(gGLManager.mGLVersion, 3.33f);
+ gGLManager.mGLVersionString += " 3.3 fallback"; // for ViewerStats reporting
+ // and select GLSL version for OpenGL 3.2
+ gGLManager.mGLSLVersionMajor = 3;
+ gGLManager.mGLSLVersionMinor = 20;
+ }
+ }
+ if (gGLManager.mIsApple)
+ {
+ maskFeatures("AppleGPU");
+ }
+ else
+ {
+ maskFeatures("NonAppleGPU");
}
if (gGLManager.mGLVersion < 3.f)
{
@@ -651,6 +705,10 @@ void LLFeatureManager::applyBaseMasks()
if (gGLManager.mGLVersion < 3.99f)
{
maskFeatures("GL3");
+
+ // make sure to disable background context activity in GL3 mode
+ LLImageGLThread::sEnabledMedia = false;
+ LLImageGLThread::sEnabledTextures = false;
}
// now mask by gpu string