mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 07:06:59 +08:00
vulkan/context_win: implement target_ref_luma
This commit is contained in:
@@ -583,10 +583,19 @@ static pl_color_space_t target_csp(struct ra_swapchain *sw)
|
||||
return (pl_color_space_t){0};
|
||||
}
|
||||
|
||||
static float target_ref_luma(struct ra_swapchain *sw)
|
||||
{
|
||||
struct priv *p = sw->priv;
|
||||
if (p->params.preferred_ref_luma)
|
||||
return p->params.preferred_ref_luma(sw->ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct ra_swapchain_fns vulkan_swapchain = {
|
||||
.color_depth = color_depth,
|
||||
.set_color = set_color,
|
||||
.target_csp = target_csp,
|
||||
.target_ref_luma = target_ref_luma,
|
||||
.start_frame = start_frame,
|
||||
.submit_frame = submit_frame,
|
||||
.swap_buffers = swap_buffers,
|
||||
|
||||
@@ -63,6 +63,12 @@ static struct pl_color_space preferred_csp(struct ra_ctx *ctx)
|
||||
return (struct pl_color_space){0};
|
||||
}
|
||||
|
||||
static float preferred_ref_luma(struct ra_ctx *ctx)
|
||||
{
|
||||
struct priv *p = ctx->priv;
|
||||
return mp_dxgi_sdr_white_level_from_hwnd(&p->dxgi_ctx, vo_w32_hwnd(ctx->vo));
|
||||
}
|
||||
|
||||
static bool win_init(struct ra_ctx *ctx)
|
||||
{
|
||||
struct priv *p = ctx->priv = talloc_zero(ctx, struct priv);
|
||||
@@ -87,6 +93,7 @@ static bool win_init(struct ra_ctx *ctx)
|
||||
struct ra_ctx_params params = {
|
||||
.color_depth = color_depth,
|
||||
.preferred_csp = preferred_csp,
|
||||
.preferred_ref_luma = preferred_ref_luma,
|
||||
};
|
||||
|
||||
VkInstance inst = vk->vkinst->instance;
|
||||
|
||||
Reference in New Issue
Block a user