diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2021-04-07 13:19:02 +0100 |
|---|---|---|
| committer | riperiperi <rhy3756547@hotmail.com> | 2021-04-18 17:34:00 +0100 |
| commit | 1239c82d2f2fa59a42561a4a278a9cdca5eca462 (patch) | |
| tree | 2885fc1498de539d9c27878ed9788bb6ecf081c5 /Ryujinx.Common/GraphicsDriver/DriverUtilities.cs | |
| parent | b1c3e01691507709bc4a6a23f02396f3b97803e5 (diff) | |
Forcibly enable threaded optimization on boot.
Diffstat (limited to 'Ryujinx.Common/GraphicsDriver/DriverUtilities.cs')
| -rw-r--r-- | Ryujinx.Common/GraphicsDriver/DriverUtilities.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Ryujinx.Common/GraphicsDriver/DriverUtilities.cs b/Ryujinx.Common/GraphicsDriver/DriverUtilities.cs new file mode 100644 index 00000000..60c176f8 --- /dev/null +++ b/Ryujinx.Common/GraphicsDriver/DriverUtilities.cs @@ -0,0 +1,22 @@ +using System; + +namespace Ryujinx.Common.GraphicsDriver +{ + public static class DriverUtilities + { + public static void ToggleOGLThreading(bool enabled) + { + Environment.SetEnvironmentVariable("mesa_glthread", enabled.ToString()); + Environment.SetEnvironmentVariable("__GL_THREADED_OPTIMIZATIONS", enabled ? "1" : "0"); + + try + { + NVThreadedOptimization.SetThreadedOptimization(enabled); + } + catch + { + // NVAPI is not available, or couldn't change the application profile. + } + } + } +} |
