Start Metal Backend

Revert build yml changes
This commit is contained in:
Isaac Marovitz
2024-08-31 22:42:56 +02:00
committed by Isaac Marovitz
parent 5dbba07e33
commit ebaf1d8258
24 changed files with 2576 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ using Ryujinx.Graphics.GAL.Multithreading;
using Ryujinx.Graphics.Gpu;
using Ryujinx.Graphics.OpenGL;
using Ryujinx.Graphics.Vulkan;
using Ryujinx.Graphics.Metal;
using Ryujinx.HLE;
using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS;
@@ -1067,10 +1068,12 @@ namespace Ryujinx.Ava
StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
Device.EnableDeviceVsync,
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
ConfigurationState.Instance.Graphics.GraphicsBackend.Value.ToText(),
dockedMode,
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
LocaleManager.Instance[LocaleKeys.Game] + $": {Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)",
$"FIFO: {Device.Statistics.GetFifoPercent():00.00} %"));
$"FIFO: {Device.Statistics.GetFifoPercent():00.00} %",
$"GPU: {_renderer.GetHardwareInfo().GpuDriver}"));
}
public async Task ShowExitPrompt()

1225
src/Ryujinx/AppHost.cs.orig Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -188,6 +188,10 @@ namespace Ryujinx.Ava
{
ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.Vulkan;
}
else if (CommandLineState.OverrideGraphicsBackend.ToLower() == "metal")
{
ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.Metal;
}
}
// Check if docked mode was overriden.

View File

@@ -0,0 +1,25 @@
using SPB.Windowing;
using SPB.Platform.Metal;
using System;
namespace Ryujinx.UI.Renderer
{
public class EmbeddedWindowMetal : EmbeddedWindow
{
public SimpleMetalWindow CreateSurface()
{
SimpleMetalWindow simpleMetalWindow;
if (OperatingSystem.IsMacOS())
{
simpleMetalWindow = new SimpleMetalWindow(new NativeHandle(NsView), new NativeHandle(MetalLayer));
}
else
{
throw new PlatformNotSupportedException();
}
return simpleMetalWindow;
}
}
}

View File

@@ -111,6 +111,8 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
public bool IsMetalAvailable => OperatingSystem.IsMacOS();
public bool IsOpenGLAvailable => !OperatingSystem.IsMacOS();
public bool IsHypervisorAvailable => OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64;

View File

@@ -43,6 +43,9 @@
<ComboBoxItem IsEnabled="{Binding IsOpenGLAvailable}">
<TextBlock Text="OpenGL" />
</ComboBoxItem>
<ComboBoxItem IsVisible="{Binding IsMetalAvailable}">
<TextBlock Text="Metal" />
</ComboBoxItem>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" IsVisible="{Binding IsVulkanSelected}">