Disable the threaded renderer on Windows.

A DisableWindowsRenderThread graphics setting is
added to allow players to optionally reenable it.
This commit is contained in:
Paul Chote
2018-08-04 14:39:26 +01:00
committed by reaperrr
parent 599e87c4aa
commit 3661dbdfd0
2 changed files with 13 additions and 1 deletions

View File

@@ -130,6 +130,9 @@ namespace OpenRA
[Desc("Disable high resolution DPI scaling on Windows operating systems.")]
public bool DisableWindowsDPIScaling = true;
[Desc("Disable separate OpenGL render thread on Windows operating systems.")]
public bool DisableWindowsRenderThread = true;
public int BatchSize = 8192;
public int SheetSize = 2048;

View File

@@ -187,6 +187,15 @@ namespace OpenRA.Platforms.Default
// Run graphics rendering on a dedicated thread.
// The calling thread will then have more time to process other tasks, since rendering happens in parallel.
// If the calling thread is the main game thread, this means it can run more logic and render ticks.
// This is disabled on Windows because it breaks the ability to minimize/restore the window from the taskbar for reasons that we dont understand.
var threadedRenderer = Platform.CurrentPlatform != PlatformType.Windows || !Game.Settings.Graphics.DisableWindowsRenderThread;
if (threadedRenderer)
{
var ctx = new Sdl2GraphicsContext(this);
ctx.InitializeOpenGL();
context = ctx;
}
else
context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize);
SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE);