diff options
author | Emmanuel Hansen <emmausssss@gmail.com> | 2022-09-19 18:05:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 15:05:26 -0300 |
commit | 6f0395538b8e8af3bba7536b44780d57e51e8697 (patch) | |
tree | 4d3f4f620dd287fc1ca38ea9ea722b6e022301dd /Ryujinx.Ava/Ui/Backend/Vulkan/VulkanPlatformInterface.cs | |
parent | b9f1ff3c7748c6a2665e76d17e86c3b7228f44fe (diff) |
Avalonia - Use embedded window for avalonia (#3674)1.1.274
* wip
* use embedded window
* fix race condition on opengl Windows
* fix glx issues on prime nvidia
* fix mouse support win32
* clean up
* addressed review
* addressed review
* fix warnings
* fix sotware keyboard dialog
* Update Ryujinx.Ava/Ui/Applet/SwkbdAppletDialog.axaml.cs
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* remove double semi
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Diffstat (limited to 'Ryujinx.Ava/Ui/Backend/Vulkan/VulkanPlatformInterface.cs')
-rw-r--r-- | Ryujinx.Ava/Ui/Backend/Vulkan/VulkanPlatformInterface.cs | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanPlatformInterface.cs b/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanPlatformInterface.cs deleted file mode 100644 index ff8d9328..00000000 --- a/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanPlatformInterface.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Avalonia; -using Ryujinx.Ava.Ui.Vulkan.Surfaces; -using Ryujinx.Graphics.Vulkan; -using Silk.NET.Vulkan; -using System; - -namespace Ryujinx.Ava.Ui.Vulkan -{ - internal class VulkanPlatformInterface : IDisposable - { - private static VulkanOptions _options; - - private VulkanPlatformInterface(VulkanInstance instance) - { - Instance = instance; - Api = instance.Api; - } - - public VulkanPhysicalDevice PhysicalDevice { get; private set; } - public VulkanInstance Instance { get; } - public Vk Api { get; private set; } - public VulkanSurfaceRenderTarget MainSurface { get; set; } - - public void Dispose() - { - Instance?.Dispose(); - Api?.Dispose(); - } - - private static VulkanPlatformInterface TryCreate() - { - _options = AvaloniaLocator.Current.GetService<VulkanOptions>() ?? new VulkanOptions(); - - var instance = VulkanInstance.Create(_options); - - return new VulkanPlatformInterface(instance); - } - - public static bool TryInitialize() - { - var feature = TryCreate(); - if (feature != null) - { - AvaloniaLocator.CurrentMutable.Bind<VulkanPlatformInterface>().ToConstant(feature); - return true; - } - - return false; - } - - public VulkanSurfaceRenderTarget CreateRenderTarget(IVulkanPlatformSurface platformSurface) - { - var surface = VulkanSurface.CreateSurface(Instance, platformSurface); - - if (PhysicalDevice == null) - { - PhysicalDevice = VulkanPhysicalDevice.FindSuitablePhysicalDevice(Instance, surface, _options.PreferDiscreteGpu, _options.PreferredDevice); - } - - var renderTarget = new VulkanSurfaceRenderTarget(this, surface); - - if (MainSurface == null && surface != null) - { - MainSurface = renderTarget; - } - - return renderTarget; - } - } -} |