some initial metal commits cherry-picked
This commit is contained in:
@@ -30,6 +30,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;
|
||||
@@ -1137,6 +1138,7 @@ namespace Ryujinx.Ava
|
||||
StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
|
||||
vSyncMode,
|
||||
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
|
||||
ConfigurationState.Instance.Graphics.GraphicsBackend.Value.ToText(),
|
||||
dockedMode,
|
||||
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
|
||||
$"{Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)",
|
||||
|
||||
1225
src/Ryujinx/AppHost.cs.orig
Normal file
1225
src/Ryujinx/AppHost.cs.orig
Normal file
File diff suppressed because it is too large
Load Diff
@@ -198,6 +198,7 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
"opengl" => GraphicsBackend.OpenGl,
|
||||
"vulkan" => GraphicsBackend.Vulkan,
|
||||
"metal" => GraphicsBackend.Metal,
|
||||
_ => ConfigurationState.Instance.Graphics.GraphicsBackend
|
||||
};
|
||||
|
||||
|
||||
25
src/Ryujinx/UI/Renderer/EmbeddedWindowMetal.cs
Normal file
25
src/Ryujinx/UI/Renderer/EmbeddedWindowMetal.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,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;
|
||||
|
||||
@@ -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}">
|
||||
|
||||
Reference in New Issue
Block a user