mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +08:00
Merge pull request #27733 from smoogipoo/fix-linux-startup-exception
Fix NVAPI startup exception on non-Windows platforms
This commit is contained in:
commit
2120f54f13
@ -8,11 +8,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
|
|
||||||
namespace osu.Desktop
|
namespace osu.Desktop
|
||||||
{
|
{
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
|
[SupportedOSPlatform("windows")]
|
||||||
internal static class NVAPI
|
internal static class NVAPI
|
||||||
{
|
{
|
||||||
private const string osu_filename = "osu!.exe";
|
private const string osu_filename = "osu!.exe";
|
||||||
|
@ -70,6 +70,7 @@ namespace osu.Desktop
|
|||||||
// NVIDIA profiles are based on the executable name of a process.
|
// NVIDIA profiles are based on the executable name of a process.
|
||||||
// Lazer and stable share the same executable name.
|
// Lazer and stable share the same executable name.
|
||||||
// Stable sets this setting to "Off", which may not be what we want, so let's force it back to the default "Auto" on startup.
|
// Stable sets this setting to "Off", which may not be what we want, so let's force it back to the default "Auto" on startup.
|
||||||
|
if (OperatingSystem.IsWindows())
|
||||||
NVAPI.ThreadedOptimisations = NvThreadControlSetting.OGL_THREAD_CONTROL_DEFAULT;
|
NVAPI.ThreadedOptimisations = NvThreadControlSetting.OGL_THREAD_CONTROL_DEFAULT;
|
||||||
|
|
||||||
// Back up the cwd before DesktopGameHost changes it
|
// Back up the cwd before DesktopGameHost changes it
|
||||||
|
Loading…
Reference in New Issue
Block a user