Skip to content

mac/vulkan: error out on context creation without an NSApplication #14539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions test/libmpv_lifetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ static inline void check_error_(int status, __typeof__(&mpv_error_string) error_

int main(void)
{
#ifdef __APPLE__
// FIXME: Hangs after libplacebo initialization
return 77;
#endif

// Skip this test when run through a wrapper like Wine. It is well-tested on
// different configurations. Meson does not set PATH and WINEPATH when
// libmpv is not directly linked, and doing it manually would be annoying.
Expand Down
5 changes: 5 additions & 0 deletions video/out/vulkan/context_mac.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down