From a8a1cdbbbbe4ad77c5815c97baba612aa44649e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 14 Jun 2026 05:25:58 +0200 Subject: [PATCH] d3d11/context: implement target_ref_luma --- video/out/d3d11/context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c index 70c5f49707..fc8802e607 100644 --- a/video/out/d3d11/context.c +++ b/video/out/d3d11/context.c @@ -221,6 +221,15 @@ static struct pl_color_space d3d11_target_color_space(struct ra_swapchain *sw) return (struct pl_color_space){0}; } +static float d3d11_target_ref_luma(struct ra_swapchain *sw) +{ + if (sw->ctx->opts.composition) + return 0; + + struct priv *p = sw->priv; + return mp_dxgi_sdr_white_level_from_hwnd(&p->dxgi_ctx, vo_w32_hwnd(sw->ctx->vo)); +} + static bool d3d11_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo) { struct priv *p = sw->priv; @@ -486,6 +495,7 @@ static void d3d11_uninit(struct ra_ctx *ctx) static const struct ra_swapchain_fns d3d11_swapchain = { .color_depth = d3d11_color_depth, .target_csp = d3d11_target_color_space, + .target_ref_luma = d3d11_target_ref_luma, .start_frame = d3d11_start_frame, .submit_frame = d3d11_submit_frame, .swap_buffers = d3d11_swap_buffers,