From 4633136fdea71ca091e7319172fecff45b9893ab Mon Sep 17 00:00:00 2001 From: Eugene Ivchenko Date: Thu, 6 Oct 2022 17:56:29 +0300 Subject: [PATCH] Fix blank screen when using Vulkan --- src/NitroSharp/GameContext.cs | 7 ++++--- src/NitroSharp/NitroSharp.csproj | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/NitroSharp/GameContext.cs b/src/NitroSharp/GameContext.cs index cffc4ef1..13ea975c 100644 --- a/src/NitroSharp/GameContext.cs +++ b/src/NitroSharp/GameContext.cs @@ -144,7 +144,7 @@ public static async Task Create(GameWindow window, Config config, G var startVM = Task.Run(() => LoadStartupScript(profile, fontConfig, logger)); SwapchainSource swapchainSource = await createSurface.Task; - (GraphicsDevice gd, Swapchain swapchain) = InitGraphics(window, config); + (GraphicsDevice gd, Swapchain swapchain) = InitGraphics(window, config, profile); ContentManager contentMgr = CreateContentManager(gd, profile); AudioContext audioContext = await initAudio; (NsScriptVM vm, GameProcess mainProcess) = await startVM; @@ -229,7 +229,8 @@ private static AudioContext InitAudio(Config config) private static (GraphicsDevice device, Swapchain swapchain) InitGraphics( GameWindow window, - Config configuration) + Config configuration, + GameProfile gameProfile) { var options = new GraphicsDeviceOptions(false, null, configuration.EnableVSync); options.PreferStandardClipSpaceYDirection = true; @@ -238,7 +239,7 @@ private static (GraphicsDevice device, Swapchain swapchain) InitGraphics( #endif GraphicsBackend backend = configuration.PreferredGraphicsBackend ?? VeldridStartup.GetPlatformDefaultBackend(); - Size renderResolution = configuration.RenderResolution; + Size renderResolution = gameProfile.DesignResolution; var swapchainDesc = new SwapchainDescription( window.SwapchainSource, renderResolution.Width, renderResolution.Height, diff --git a/src/NitroSharp/NitroSharp.csproj b/src/NitroSharp/NitroSharp.csproj index a8307393..aba93a14 100644 --- a/src/NitroSharp/NitroSharp.csproj +++ b/src/NitroSharp/NitroSharp.csproj @@ -4,7 +4,7 @@ net7.0 true 1701;1702;CA1063;IDE1006;IDE0063;VSTHRD002;VSTHRD003;VSTHRD103;VSTHRD105;VSTHRD200 - 4.9.0-g32bf3145d0 + 4.9.0-beta2 enable