From b08f9886be1a9778a5215217eb48fe0eb4c65dee Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 22 Jan 2020 20:51:44 +0000 Subject: [PATCH] Add Graphics.DisableGLDebugMessageCallback setting. --- OpenRA.Game/Settings.cs | 3 +++ OpenRA.Platforms.Default/OpenGL.cs | 4 ++++ 2 files changed, 7 insertions(+) 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));