diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 6e62f649a9..a212baf3b3 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -171,6 +171,9 @@ namespace OpenRA [Desc("Disable separate OpenGL render thread on Windows operating systems.")] public bool DisableWindowsRenderThread = true; + [Desc("Disable the OpenGL debug message callback feature.")] + public bool DisableGLDebugMessageCallback = false; + [Desc("Use OpenGL ES if both ES and regular OpenGL are available.")] public bool PreferGLES = false; diff --git a/OpenRA.Platforms.Default/OpenGL.cs b/OpenRA.Platforms.Default/OpenGL.cs index 1a672a826a..b63f1d6a94 100644 --- a/OpenRA.Platforms.Default/OpenGL.cs +++ b/OpenRA.Platforms.Default/OpenGL.cs @@ -497,6 +497,10 @@ namespace OpenRA.Platforms.Default DetectGLFeatures(); + // Allow users to force-disable the debug message callback feature to work around driver bugs + if (Features.HasFlag(GLFeatures.DebugMessagesCallback) && Game.Settings.Graphics.DisableGLDebugMessageCallback) + Features ^= GLFeatures.DebugMessagesCallback; + if (!Features.HasFlag(GLFeatures.Core)) { WriteGraphicsLog("Unsupported OpenGL version: " + glGetString(GL_VERSION));