diff --git a/Program.cs b/Program.cs index 1b24b0102..f7532b280 100644 --- a/Program.cs +++ b/Program.cs @@ -17,7 +17,7 @@ public static class Program public static string ConfigLocation; public static string Version { get; private set; } public static bool LaunchDebug; - + public static bool GPUFix; static Program() { BaseDirectory = AppDomain.CurrentDomain.BaseDirectory; diff --git a/StartupArgs.cs b/StartupArgs.cs index c6236807e..4614e342f 100644 --- a/StartupArgs.cs +++ b/StartupArgs.cs @@ -24,6 +24,7 @@ public static void ArgsCheck() foreach (string arg in args) { + if (arg.Contains("--gpufix")) Program.GPUFix = true; if (arg.Length > 12 && arg.Substring(0, 12) == "/uri=vrcx://") LaunchCommand = arg.Substring(12); diff --git a/VRCXVR.cs b/VRCXVR.cs index 5cfbcc1b4..da98cf364 100644 --- a/VRCXVR.cs +++ b/VRCXVR.cs @@ -88,11 +88,13 @@ private void ThreadLoop() // REMOVE THIS // nextOverlay = DateTime.MaxValue; + // https://stackoverflow.com/questions/38312597/how-to-choose-a-specific-graphics-device-in-sharpdx-directx-11/38596725#38596725 + Factory f = new Factory1(); + Adapter a = f.GetAdapter(1); + + DeviceCreationFlags flags = DeviceCreationFlags.BgraSupport; - _device = new Device( - DriverType.Hardware, - DeviceCreationFlags.SingleThreaded | DeviceCreationFlags.BgraSupport - ); + _device = Program.GPUFix ? new Device(a, flags) : new Device(DriverType.Hardware, DeviceCreationFlags.SingleThreaded | DeviceCreationFlags.BgraSupport); _texture1 = new Texture2D( _device,