summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/vulkan/context.c8
-rw-r--r--video/out/vulkan/context.h7
-rw-r--r--video/out/vulkan/context_wayland.c4
3 files changed, 10 insertions, 9 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index 3e49435f14..bcc52f46f3 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -239,10 +239,10 @@ static bool start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
{
struct priv *p = sw->priv;
struct pl_swapchain_frame frame;
- bool start = true;
- if (p->params.start_frame)
- start = p->params.start_frame(sw->ctx);
- if (!start)
+ bool visible = true;
+ if (p->params.check_visible)
+ visible = p->params.check_visible(sw->ctx);
+ if (!visible)
return false;
if (!pl_swapchain_start_frame(p->vk->swapchain, &frame))
return false;
diff --git a/video/out/vulkan/context.h b/video/out/vulkan/context.h
index d85b3fe193..c846942b0e 100644
--- a/video/out/vulkan/context.h
+++ b/video/out/vulkan/context.h
@@ -7,8 +7,9 @@ struct ra_vk_ctx_params {
// See ra_swapchain_fns.get_vsync.
void (*get_vsync)(struct ra_ctx *ctx, struct vo_vsync_info *info);
- // In case something special needs to be done when starting a frame.
- bool (*start_frame)(struct ra_ctx *ctx);
+ // For special contexts (i.e. wayland) that want to check visibility
+ // before drawing a frame.
+ bool (*check_visible)(struct ra_ctx *ctx);
// In case something special needs to be done on the buffer swap.
void (*swap_buffers)(struct ra_ctx *ctx);
@@ -27,4 +28,4 @@ bool ra_vk_ctx_resize(struct ra_ctx *ctx, int width, int height);
struct mpvk_ctx *ra_vk_ctx_get(struct ra_ctx *ctx);
// Get the user requested Vulkan device name.
-char *ra_vk_ctx_get_device_name(struct ra_ctx *ctx); \ No newline at end of file
+char *ra_vk_ctx_get_device_name(struct ra_ctx *ctx);
diff --git a/video/out/vulkan/context_wayland.c b/video/out/vulkan/context_wayland.c
index d2e6309776..0770004b4c 100644
--- a/video/out/vulkan/context_wayland.c
+++ b/video/out/vulkan/context_wayland.c
@@ -26,7 +26,7 @@ struct priv {
struct mpvk_ctx vk;
};
-static bool wayland_vk_start_frame(struct ra_ctx *ctx)
+static bool wayland_vk_check_visible(struct ra_ctx *ctx)
{
struct vo_wayland_state *wl = ctx->vo->wl;
bool render = !wl->hidden || wl->opts->disable_vsync;
@@ -84,7 +84,7 @@ static bool wayland_vk_init(struct ra_ctx *ctx)
};
struct ra_vk_ctx_params params = {
- .start_frame = wayland_vk_start_frame,
+ .check_visible = wayland_vk_check_visible,
.swap_buffers = wayland_vk_swap_buffers,
.get_vsync = wayland_vk_get_vsync,
};