Merge branch 'master' into master

This commit is contained in:
Vladimir Sokolov 2025-02-01 20:52:57 +10:00 committed by GitHub
commit 25c47368db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 27 deletions

View File

@ -10,14 +10,18 @@ namespace Ryujinx.Common.Helper
public static bool IsMacOS => OperatingSystem.IsMacOS(); public static bool IsMacOS => OperatingSystem.IsMacOS();
public static bool IsWindows => OperatingSystem.IsWindows(); public static bool IsWindows => OperatingSystem.IsWindows();
public static bool IsLinux => OperatingSystem.IsLinux(); public static bool IsLinux => OperatingSystem.IsLinux();
public static bool IsArm => RuntimeInformation.OSArchitecture is Architecture.Arm64;
public static bool IsX64 => RuntimeInformation.OSArchitecture is Architecture.X64;
public static bool IsIntelMac => IsMacOS && RuntimeInformation.OSArchitecture is Architecture.X64; public static bool IsIntelMac => IsMacOS && IsX64;
public static bool IsArmMac => IsMacOS && RuntimeInformation.OSArchitecture is Architecture.Arm64; public static bool IsArmMac => IsMacOS && IsArm;
public static bool IsX64Windows => IsWindows && (RuntimeInformation.OSArchitecture is Architecture.X64); public static bool IsX64Windows => IsWindows && IsX64;
public static bool IsArmWindows => IsWindows && (RuntimeInformation.OSArchitecture is Architecture.Arm64); public static bool IsArmWindows => IsWindows && IsArm;
public static bool IsX64Linux => IsLinux && (RuntimeInformation.OSArchitecture is Architecture.X64); public static bool IsX64Linux => IsLinux && IsX64;
public static bool IsArmLinux => IsLinux && (RuntimeInformation.OSArchitecture is Architecture.Arm64); public static bool IsArmLinux => IsLinux && IsArmMac;
} }
} }

View File

@ -83,11 +83,11 @@ namespace Ryujinx.Graphics.Gpu.Synchronization
// TODO: Remove this when GPU channel scheduling will be implemented. // TODO: Remove this when GPU channel scheduling will be implemented.
if (timeout == Timeout.InfiniteTimeSpan) if (timeout == Timeout.InfiniteTimeSpan)
{ {
timeout = TimeSpan.FromSeconds(1); timeout = TimeSpan.FromMilliseconds(500);
} }
using ManualResetEvent waitEvent = new(false); using ManualResetEvent waitEvent = new(false);
SyncpointWaiterHandle info = _syncpoints[id].RegisterCallback(threshold, (x) => waitEvent.Set()); SyncpointWaiterHandle info = _syncpoints[id].RegisterCallback(threshold, _ => waitEvent.Set());
if (info == null) if (info == null)
{ {
@ -96,7 +96,7 @@ namespace Ryujinx.Graphics.Gpu.Synchronization
bool signaled = waitEvent.WaitOne(timeout); bool signaled = waitEvent.WaitOne(timeout);
if (!signaled && info != null) if (!signaled)
{ {
Logger.Error?.Print(LogClass.Gpu, $"Wait on syncpoint {id} for threshold {threshold} took more than {timeout.TotalMilliseconds}ms, resuming execution..."); Logger.Error?.Print(LogClass.Gpu, $"Wait on syncpoint {id} for threshold {threshold} took more than {timeout.TotalMilliseconds}ms, resuming execution...");

View File

@ -1,3 +1,4 @@
using Ryujinx.Common.Helper;
using SharpMetal.QuartzCore; using SharpMetal.QuartzCore;
using System; using System;
@ -7,14 +8,12 @@ namespace Ryujinx.Ava.UI.Renderer
{ {
public CAMetalLayer CreateSurface() public CAMetalLayer CreateSurface()
{ {
if (OperatingSystem.IsMacOS()) if (OperatingSystem.IsMacOS() && RunningPlatform.IsArm)
{ {
return new CAMetalLayer(MetalLayer); return new CAMetalLayer(MetalLayer);
} }
else
{ throw new NotSupportedException($"Cannot create a {nameof(CAMetalLayer)} without being on ARM Mac.");
throw new NotSupportedException();
}
} }
} }
} }

View File

@ -43,19 +43,19 @@ namespace Ryujinx.Ava.UI.Renderer
public RendererHost(string titleId) public RendererHost(string titleId)
{ {
switch (TitleIDs.SelectGraphicsBackend(titleId, ConfigurationState.Instance.Graphics.GraphicsBackend)) Focusable = true;
{ FlowDirection = FlowDirection.LeftToRight;
case GraphicsBackend.OpenGl:
EmbeddedWindow = new EmbeddedWindowOpenGL(); EmbeddedWindow =
break; #pragma warning disable CS8509
case GraphicsBackend.Metal: TitleIDs.SelectGraphicsBackend(titleId, ConfigurationState.Instance.Graphics.GraphicsBackend) switch
EmbeddedWindow = new EmbeddedWindowMetal(); #pragma warning restore CS8509
break; {
case GraphicsBackend.Vulkan: GraphicsBackend.OpenGl => new EmbeddedWindowOpenGL(),
EmbeddedWindow = new EmbeddedWindowVulkan(); GraphicsBackend.Metal => new EmbeddedWindowMetal(),
break; GraphicsBackend.Vulkan => new EmbeddedWindowVulkan(),
} };
string backendText = EmbeddedWindow switch string backendText = EmbeddedWindow switch
{ {
EmbeddedWindowVulkan => "Vulkan", EmbeddedWindowVulkan => "Vulkan",