Skip to content

Commit 1034be9

Browse files
committed
mac/vulkan: error out on context creation without an NSApplication
if no NSApplication has been initialized, applications using Appkit functionality are not supposed to work properly or just deadlock indefinitely. properly error out on macvk context creation in that case.
1 parent d15660f commit 1034be9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

video/out/vulkan/context_mac.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ static bool mac_vk_init(struct ra_ctx *ctx)
5656
struct mpvk_ctx *vk = &p->vk;
5757
int msgl = ctx->opts.probing ? MSGL_V : MSGL_ERR;
5858

59+
if (!NSApp) {
60+
MP_ERR(ctx, "Failed to initialise macvk context, no NSApplication initialized.\n");
61+
goto error;
62+
}
63+
5964
if (!mpvk_init(vk, ctx, VK_EXT_METAL_SURFACE_EXTENSION_NAME))
6065
goto error;
6166

0 commit comments

Comments
 (0)