aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/GraphicsDriver/DriverUtilities.cs
diff options
context:
space:
mode:
authorEmulationFanatic <62343878+EmulationFanatic@users.noreply.github.com>2021-05-19 11:39:19 -0700
committerGitHub <noreply@github.com>2021-05-19 11:39:19 -0700
commitb5c72b44dee2fd977d7cca5aa3c29ef1e2286aa7 (patch)
treeae064aca256cb6193f6908cc9698660043754008 /Ryujinx.Common/GraphicsDriver/DriverUtilities.cs
parent0129250c2e169c7386f7e2868cc055f8ec55c005 (diff)
parent778011c12ae7905173e02665f397a96686863b89 (diff)
Merge pull request #2177 from riperiperi/feature/parallel-shader-cache
Allow parallel shader compilation when loading a shader cache
Diffstat (limited to 'Ryujinx.Common/GraphicsDriver/DriverUtilities.cs')
-rw-r--r--Ryujinx.Common/GraphicsDriver/DriverUtilities.cs22
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.
+ }
+ }
+ }
+}