mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-24 23:47:11 +02:00
UI: Add Metal surface creation for MoltenVK (#3980)
* Initial implementation of metal surface across UIs * Fix SDL2 on windows * Update Ryujinx/Ryujinx.csproj Co-authored-by: Mary-nyan <thog@protonmail.com> * Address Feedback Co-authored-by: Mary-nyan <thog@protonmail.com>
This commit is contained in:
parent
d3709a753f
commit
e211c3f00a
31 changed files with 495 additions and 63 deletions
|
@ -1,9 +1,11 @@
|
|||
using Gdk;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Input.HLE;
|
||||
using Ryujinx.Ui.Helper;
|
||||
using SPB.Graphics.Vulkan;
|
||||
using SPB.Platform.Win32;
|
||||
using SPB.Platform.X11;
|
||||
using SPB.Platform.Metal;
|
||||
using SPB.Windowing;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -13,6 +15,7 @@ namespace Ryujinx.Ui
|
|||
public class VKRenderer : RendererWidgetBase
|
||||
{
|
||||
public NativeWindowBase NativeWindow { get; private set; }
|
||||
private UpdateBoundsCallbackDelegate _updateBoundsCallback;
|
||||
|
||||
public VKRenderer(InputManager inputManager, GraphicsDebugLevel glLogLevel) : base(inputManager, glLogLevel) { }
|
||||
|
||||
|
@ -31,6 +34,12 @@ namespace Ryujinx.Ui
|
|||
|
||||
return new SimpleX11Window(new NativeHandle(displayHandle), new NativeHandle(windowHandle));
|
||||
}
|
||||
else if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
IntPtr metalLayer = MetalHelper.GetMetalLayer(Display, Window, out IntPtr nsView, out _updateBoundsCallback);
|
||||
|
||||
return new SimpleMetalWindow(new NativeHandle(nsView), new NativeHandle(metalLayer));
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -53,7 +62,11 @@ namespace Ryujinx.Ui
|
|||
WaitEvent.Set();
|
||||
}
|
||||
|
||||
return base.OnConfigureEvent(evnt);
|
||||
bool result = base.OnConfigureEvent(evnt);
|
||||
|
||||
_updateBoundsCallback?.Invoke(Window);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public unsafe IntPtr CreateWindowSurface(IntPtr instance)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue