Skip to content

Commit

Permalink
Fix blank screen when using Vulkan
Browse files Browse the repository at this point in the history
  • Loading branch information
sa-exe committed Oct 6, 2022
1 parent 45728a9 commit 4633136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/NitroSharp/GameContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static async Task<GameContext> 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;
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/NitroSharp/NitroSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1701;1702;CA1063;IDE1006;IDE0063;VSTHRD002;VSTHRD003;VSTHRD103;VSTHRD105;VSTHRD200</NoWarn>
<VeldridVersion>4.9.0-g32bf3145d0</VeldridVersion>
<VeldridVersion>4.9.0-beta2</VeldridVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down

0 comments on commit 4633136

Please sign in to comment.