diff options
author | Jan Ekström <jeebjp@gmail.com> | 2020-02-16 19:17:26 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2020-04-12 21:18:50 +0300 |
commit | b885f803e2d5e83faca927976ace378abb82f861 (patch) | |
tree | 1560d5719a599cdd6babd57a219293ecfe0b5023 /video/out/d3d11 | |
parent | 2a542b7f197c1936ac69b782c058885bbd9ee4a5 (diff) | |
download | mpv-b885f803e2d5e83faca927976ace378abb82f861.tar.bz2 mpv-b885f803e2d5e83faca927976ace378abb82f861.tar.xz |
vo_gpu: d3d11: also utilize config cache for d3d11-specific options
Update the cache whenever we utilize p->opts, as recommended by
wm4.
Diffstat (limited to 'video/out/d3d11')
-rw-r--r-- | video/out/d3d11/context.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; |