DriverUtilities.cs 630 B

12345678910111213141516171819202122
  1. using System;
  2. namespace Ryujinx.Common.GraphicsDriver
  3. {
  4. public static class DriverUtilities
  5. {
  6. public static void ToggleOGLThreading(bool enabled)
  7. {
  8. Environment.SetEnvironmentVariable("mesa_glthread", enabled.ToString());
  9. Environment.SetEnvironmentVariable("__GL_THREADED_OPTIMIZATIONS", enabled ? "1" : "0");
  10. try
  11. {
  12. NVThreadedOptimization.SetThreadedOptimization(enabled);
  13. }
  14. catch
  15. {
  16. // NVAPI is not available, or couldn't change the application profile.
  17. }
  18. }
  19. }
  20. }