Skip to content

Commit 4633136

Browse files
committed
Fix blank screen when using Vulkan
1 parent 45728a9 commit 4633136

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/NitroSharp/GameContext.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public static async Task<GameContext> Create(GameWindow window, Config config, G
144144
var startVM = Task.Run(() => LoadStartupScript(profile, fontConfig, logger));
145145

146146
SwapchainSource swapchainSource = await createSurface.Task;
147-
(GraphicsDevice gd, Swapchain swapchain) = InitGraphics(window, config);
147+
(GraphicsDevice gd, Swapchain swapchain) = InitGraphics(window, config, profile);
148148
ContentManager contentMgr = CreateContentManager(gd, profile);
149149
AudioContext audioContext = await initAudio;
150150
(NsScriptVM vm, GameProcess mainProcess) = await startVM;
@@ -229,7 +229,8 @@ private static AudioContext InitAudio(Config config)
229229

230230
private static (GraphicsDevice device, Swapchain swapchain) InitGraphics(
231231
GameWindow window,
232-
Config configuration)
232+
Config configuration,
233+
GameProfile gameProfile)
233234
{
234235
var options = new GraphicsDeviceOptions(false, null, configuration.EnableVSync);
235236
options.PreferStandardClipSpaceYDirection = true;
@@ -238,7 +239,7 @@ private static (GraphicsDevice device, Swapchain swapchain) InitGraphics(
238239
#endif
239240
GraphicsBackend backend = configuration.PreferredGraphicsBackend
240241
?? VeldridStartup.GetPlatformDefaultBackend();
241-
Size renderResolution = configuration.RenderResolution;
242+
Size renderResolution = gameProfile.DesignResolution;
242243
var swapchainDesc = new SwapchainDescription(
243244
window.SwapchainSource,
244245
renderResolution.Width, renderResolution.Height,

src/NitroSharp/NitroSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net7.0</TargetFramework>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<NoWarn>1701;1702;CA1063;IDE1006;IDE0063;VSTHRD002;VSTHRD003;VSTHRD103;VSTHRD105;VSTHRD200</NoWarn>
7-
<VeldridVersion>4.9.0-g32bf3145d0</VeldridVersion>
7+
<VeldridVersion>4.9.0-beta2</VeldridVersion>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

0 commit comments

Comments
 (0)