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/Program.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/Program.cs')
-rw-r--r-- | Ryujinx.Ava/Program.cs | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/Ryujinx.Ava/Program.cs b/Ryujinx.Ava/Program.cs index 242246eb..61b184c6 100644 --- a/Ryujinx.Ava/Program.cs +++ b/Ryujinx.Ava/Program.cs @@ -1,9 +1,7 @@ using ARMeilleure.Translation.PTC; using Avalonia; -using Avalonia.OpenGL; using Avalonia.Rendering; using Avalonia.Threading; -using Ryujinx.Ava.Ui.Backend; using Ryujinx.Ava.Ui.Controls; using Ryujinx.Ava.Ui.Windows; using Ryujinx.Common; @@ -12,12 +10,10 @@ using Ryujinx.Common.GraphicsDriver; using Ryujinx.Common.Logging; using Ryujinx.Common.System; using Ryujinx.Common.SystemInfo; -using Ryujinx.Graphics.Vulkan; using Ryujinx.Modules; using Ryujinx.Ui.Common; using Ryujinx.Ui.Common.Configuration; using System; -using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; @@ -34,7 +30,6 @@ namespace Ryujinx.Ava public static bool PreviewerDetached { get; private set; } public static RenderTimer RenderTimer { get; private set; } - public static bool UseVulkan { get; private set; } [DllImport("user32.dll", SetLastError = true)] public static extern int MessageBoxA(IntPtr hWnd, string text, string caption, uint type); @@ -71,36 +66,16 @@ namespace Ryujinx.Ava EnableMultiTouch = true, EnableIme = true, UseEGL = false, - UseGpu = !UseVulkan, - GlProfiles = new List<GlVersion>() - { - new GlVersion(GlProfileType.OpenGL, 4, 3) - } + UseGpu = false }) .With(new Win32PlatformOptions { EnableMultitouch = true, - UseWgl = !UseVulkan, - WglProfiles = new List<GlVersion>() - { - new GlVersion(GlProfileType.OpenGL, 4, 3) - }, + UseWgl = false, AllowEglInitialization = false, CompositionBackdropCornerRadius = 8f, }) .UseSkia() - .With(new Ui.Vulkan.VulkanOptions() - { - ApplicationName = "Ryujinx.Graphics.Vulkan", - MaxQueueCount = 2, - PreferDiscreteGpu = true, - PreferredDevice = !PreviewerDetached ? "" : ConfigurationState.Instance.Graphics.PreferredGpu.Value, - UseDebug = !PreviewerDetached ? false : ConfigurationState.Instance.Logger.GraphicsDebugLevel.Value != GraphicsDebugLevel.None, - }) - .With(new SkiaOptions() - { - CustomGpuFactory = UseVulkan ? SkiaGpuFactory.CreateVulkanGpu : null - }) .AfterSetup(_ => { AvaloniaLocator.CurrentMutable @@ -176,26 +151,7 @@ namespace Ryujinx.Ava ReloadConfig(); - UseVulkan = PreviewerDetached ? ConfigurationState.Instance.Graphics.GraphicsBackend.Value == GraphicsBackend.Vulkan : false; - - if (UseVulkan) - { - if (VulkanRenderer.GetPhysicalDevices().Length == 0) - { - UseVulkan = false; - - ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.OpenGl; - - Logger.Warning?.PrintMsg(LogClass.Application, "A suitable Vulkan physical device is not available. Falling back to OpenGL"); - } - } - - if (UseVulkan) - { - // With a custom gpu backend, avalonia doesn't enable dpi awareness, so the backend must handle it. This isn't so for the opengl backed, - // as that uses avalonia's gpu backend and it's enabled there. - ForceDpiAware.Windows(); - } + ForceDpiAware.Windows(); WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); ActualScaleFactor = ForceDpiAware.GetActualScaleFactor() / BaseDpi; |