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.
This commit is contained in:
der richter 2024-07-13 14:10:04 +02:00 committed by sfan5
parent 4764e41cac
commit 8fc557cc6e
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ static bool mac_vk_init(struct ra_ctx *ctx)
struct mpvk_ctx *vk = &p->vk;
int msgl = ctx->opts.probing ? MSGL_V : MSGL_ERR;
if (!NSApp) {
MP_ERR(ctx, "Failed to initialize macvk context, no NSApplication initialized.\n");
goto error;
}
if (!mpvk_init(vk, ctx, VK_EXT_METAL_SURFACE_EXTENSION_NAME))
goto error;