From b885f803e2d5e83faca927976ace378abb82f861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Sun, 16 Feb 2020 19:17:26 +0200 Subject: vo_gpu: d3d11: also utilize config cache for d3d11-specific options Update the cache whenever we utilize p->opts, as recommended by wm4. --- video/out/d3d11/context.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c index afcfefa2e0..881962f3be 100644 --- a/video/out/d3d11/context.c +++ b/video/out/d3d11/context.c @@ -92,6 +92,7 @@ const struct m_sub_options d3d11_conf = { struct priv { struct d3d11_opts *opts; + struct m_config_cache *opts_cache; struct mp_vo_opts *vo_opts; struct m_config_cache *vo_opts_cache; @@ -237,6 +238,8 @@ static void d3d11_swap_buffers(struct ra_swapchain *sw) { struct priv *p = sw->priv; + m_config_cache_update(p->opts_cache); + LARGE_INTEGER perf_count; QueryPerformanceCounter(&perf_count); p->last_submit_qpc = perf_count.QuadPart; @@ -249,6 +252,8 @@ static void d3d11_get_vsync(struct ra_swapchain *sw, struct vo_vsync_info *info) struct priv *p = sw->priv; HRESULT hr; + m_config_cache_update(p->opts_cache); + // The calculations below are only valid if mpv presents on every vsync if (p->opts->sync_interval != 1) return; @@ -330,6 +335,8 @@ static bool d3d11_set_fullscreen(struct ra_ctx *ctx) struct priv *p = ctx->priv; HRESULT hr; + m_config_cache_update(p->opts_cache); + if (!p->swapchain) { MP_ERR(ctx, "Full screen configuration was requested before D3D11 " "swap chain was ready!"); @@ -438,7 +445,8 @@ static const struct ra_swapchain_fns d3d11_swapchain = { static bool d3d11_init(struct ra_ctx *ctx) { struct priv *p = ctx->priv = talloc_zero(ctx, struct priv); - p->opts = mp_get_config_group(ctx, ctx->global, &d3d11_conf); + p->opts_cache = m_config_cache_alloc(ctx, ctx->global, &d3d11_conf); + p->opts = p->opts_cache->opts; p->vo_opts_cache = m_config_cache_alloc(ctx, ctx->vo->global, &vo_sub_opts); p->vo_opts = p->vo_opts_cache->opts; -- cgit v1.2.3