Skip to content

Commit

Permalink
vulkan/context: Temporary logs to debug MoltenVK context
Browse files Browse the repository at this point in the history
  • Loading branch information
themisterholliday committed Feb 29, 2024
1 parent 2a141f7 commit 3b1ffe0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions video/out/vulkan/context_moltenvk.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ @implementation MetalLayerDelegate

- (id)initWithContext: (struct ra_ctx*) ctx
{
MP_MSG(ctx, "### MetalLayerDelegate > Called initWithContext\n");
_ra_ctx = ctx;
return self;
}

- (void)layoutSublayersOfLayer: (CALayer*) layer
{
MP_MSG(_ra_ctx, "### MetalLayerDelegate > Called layoutSublayersOfLayer\n");
moltenvk_reconfig(_ra_ctx);
}

Expand Down Expand Up @@ -96,6 +98,9 @@ static bool moltenvk_init(struct ra_ctx *ctx)
p->delegate = [[MetalLayerDelegate alloc] initWithContext: ctx];
p->layer.delegate = p->delegate;

MP_MSG(ctx, p->delegate, "### Set this delegate\n");
MP_MSG(ctx, p->layer.delegate, "### Attached delegate to layer\n");

return true;
fail:
moltenvk_uninit(ctx);
Expand All @@ -107,6 +112,7 @@ static bool moltenvk_reconfig(struct ra_ctx *ctx)
struct priv *p = ctx->priv;
CGSize s = p->layer.drawableSize;
ra_vk_ctx_resize(ctx, s.width, s.height);
MP_MSG(ctx, s.width, s.height, "### Called resize\n");
return true;
}

Expand All @@ -116,6 +122,7 @@ static int moltenvk_control(struct ra_ctx *ctx, int *events, int request, void *

if (*events & VO_EVENT_RESIZE)
{
MP_MSG(ctx, ctx->vo->dwidth, ctx->vo->dheight, "### moltenvk_control > VO_EVENT_RESIZE\n");
ra_vk_ctx_resize(ctx, ctx->vo->dwidth, ctx->vo->dheight);
return VO_TRUE;
}
Expand Down

0 comments on commit 3b1ffe0

Please sign in to comment.