mirror of
https://github.com/mpv-player/mpv
synced 2025-01-07 07:30:09 +00:00
acde63f05a
This vulkan-specific parameter was poorly named and probably causes confusion. Just rename it to check_visible instead to make clear what is going on here. Only wayland uses it for now but in theory anyone else can. As an aside, wayland egl accomplishes this by using an external swapchain instead (an opengl-only concept in the mpv code). This may or may not need to be changed in the future when gpu-next gets opengl support.
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include "video/out/gpu/context.h"
|
|
#include "common.h"
|
|
|
|
struct ra_vk_ctx_params {
|
|
// See ra_swapchain_fns.get_vsync.
|
|
void (*get_vsync)(struct ra_ctx *ctx, struct vo_vsync_info *info);
|
|
|
|
// 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);
|
|
};
|
|
|
|
// Helpers for ra_ctx based on ra_vk. These initialize ctx->ra and ctx->swchain.
|
|
void ra_vk_ctx_uninit(struct ra_ctx *ctx);
|
|
bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk,
|
|
struct ra_vk_ctx_params params,
|
|
VkPresentModeKHR preferred_mode);
|
|
|
|
// Handles a resize request, and updates ctx->vo->dwidth/dheight
|
|
bool ra_vk_ctx_resize(struct ra_ctx *ctx, int width, int height);
|
|
|
|
// May be called on a ra_ctx of any type.
|
|
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);
|