aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>2023-05-31 08:08:50 +0100
committerGitHub <noreply@github.com>2023-05-31 09:08:50 +0200
commit0e037d021347e802b28bd74af3459b007b48083e (patch)
treeb7b9aa2edb72ed3058660c276a16ce1dc8c2c183
parent0dca1fbe12c637ccf04ac2853ac7476d41310932 (diff)
macOS Headless Fixes (#5167)1.1.844
* Default hypervisor to disabled * Include MVK on macOS * Properly sign headless builds on macOS * Force Vulkan on macOS * Suggestions
-rw-r--r--src/Ryujinx.Headless.SDL2/Options.cs2
-rw-r--r--src/Ryujinx.Headless.SDL2/Program.cs13
-rw-r--r--src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj8
3 files changed, 19 insertions, 4 deletions
diff --git a/src/Ryujinx.Headless.SDL2/Options.cs b/src/Ryujinx.Headless.SDL2/Options.cs
index 7dffa1b0..d7ad8cf7 100644
--- a/src/Ryujinx.Headless.SDL2/Options.cs
+++ b/src/Ryujinx.Headless.SDL2/Options.cs
@@ -130,7 +130,7 @@ namespace Ryujinx.Headless.SDL2
public float AudioVolume { get; set; }
[Option("use-hypervisor", Required = false, Default = true, HelpText = "Uses Hypervisor over JIT if available.")]
- public bool UseHypervisor { get; set; }
+ public bool? UseHypervisor { get; set; }
[Option("lan-interface-id", Required = false, Default = "0", HelpText = "GUID for the network interface used by LAN.")]
public string MultiplayerLanInterfaceId { get; set; }
diff --git a/src/Ryujinx.Headless.SDL2/Program.cs b/src/Ryujinx.Headless.SDL2/Program.cs
index 643db845..fc1b23eb 100644
--- a/src/Ryujinx.Headless.SDL2/Program.cs
+++ b/src/Ryujinx.Headless.SDL2/Program.cs
@@ -339,6 +339,15 @@ namespace Ryujinx.Headless.SDL2
GraphicsConfig.EnableShaderCache = true;
+ if (OperatingSystem.IsMacOS())
+ {
+ if (option.GraphicsBackend == GraphicsBackend.OpenGl)
+ {
+ option.GraphicsBackend = GraphicsBackend.Vulkan;
+ Logger.Warning?.Print(LogClass.Application, "OpenGL is not supported on macOS, switching to Vulkan!");
+ }
+ }
+
IGamepad gamepad;
if (option.ListInputIds)
@@ -550,7 +559,7 @@ namespace Ryujinx.Headless.SDL2
options.IgnoreMissingServices,
options.AspectRatio,
options.AudioVolume,
- options.UseHypervisor,
+ options.UseHypervisor ?? true,
options.MultiplayerLanInterfaceId);
return new Switch(configuration);
@@ -703,4 +712,4 @@ namespace Ryujinx.Headless.SDL2
return true;
}
}
-}
+} \ No newline at end of file
diff --git a/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj b/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj
index fc912d32..d2585c56 100644
--- a/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj
+++ b/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj
@@ -7,6 +7,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.0.0-dirty</Version>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
+ <SigningCertificate Condition=" '$(SigningCertificate)' == '' ">-</SigningCertificate>
<TieredPGO>true</TieredPGO>
</PropertyGroup>
@@ -15,6 +16,10 @@
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" />
</ItemGroup>
+ <Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="$([MSBuild]::IsOSPlatform('OSX'))">
+ <Exec Command="codesign --entitlements '$(ProjectDir)..\..\distribution\macos\entitlements.xml' -f --deep -s $(SigningCertificate) '$(TargetDir)$(TargetName)'" />
+ </Target>
+
<ItemGroup>
<ProjectReference Include="..\Ryujinx.Graphics.Vulkan\Ryujinx.Graphics.Vulkan.csproj" />
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.csproj" />
@@ -29,6 +34,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" />
+ <PackageReference Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'win10-x64'" />
</ItemGroup>
<ItemGroup>
@@ -63,4 +69,4 @@
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>partial</TrimMode>
</PropertyGroup>
-</Project>
+</Project> \ No newline at end of file