2021-04-07 08:19:02 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Common.GraphicsDriver
|
|
|
|
|
{
|
|
|
|
|
public static class DriverUtilities
|
|
|
|
|
{
|
|
|
|
|
public static void ToggleOGLThreading(bool enabled)
|
|
|
|
|
{
|
2022-02-06 10:52:39 -05:00
|
|
|
|
Environment.SetEnvironmentVariable("mesa_glthread", enabled.ToString().ToLower());
|
2021-04-07 08:19:02 -04:00
|
|
|
|
Environment.SetEnvironmentVariable("__GL_THREADED_OPTIMIZATIONS", enabled ? "1" : "0");
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
NVThreadedOptimization.SetThreadedOptimization(enabled);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
// NVAPI is not available, or couldn't change the application profile.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|