From 188e18d8005ddfdb31a71373f6158b342c274a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 8 Nov 2024 04:22:32 +0100 Subject: [PATCH 1/2] vo_gpu_next: clear renderer cache on options update This ensures that options are applied to current frame, even in paused state. --- video/out/vo_gpu_next.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 0663777376044..d13d3782ca2e2 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -133,7 +133,6 @@ struct priv { bool is_interpolated; bool want_reset; bool frame_pending; - bool redraw; pl_options pars; struct m_config_cache *opts_cache; @@ -2329,6 +2328,9 @@ AV_NOWARN_DEPRECATED( } pars->params.hooks = p->hooks; + + MP_DBG(p, "Render options updated, resetting render state.\n"); + p->want_reset = true; } const struct vo_driver video_out_gpu_next = { From 74ff36a69f7d2cfa4d6659a9526f8d77dfcabaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 8 Nov 2024 04:23:28 +0100 Subject: [PATCH 2/2] vo_gpu_next: restore initial hook param value If the parameter is removed from the `glsl-shader-opts` list, it should be restored to initial value. --- video/out/vo_gpu_next.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index d13d3782ca2e2..d9a370b3f6ac7 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -2133,6 +2133,11 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath if (!mp_splitext(basename, &shadername)) shadername = bstr0(basename); + for (int i = 0; i < hook->num_parameters; i++) { + const struct pl_hook_par *hp = &hook->parameters[i]; + memcpy(hp->data, &hp->initial, sizeof(*hp->data)); + } + for (int n = 0; opts[n * 2]; n++) { struct bstr k = bstr0(opts[n * 2 + 0]); struct bstr v = bstr0(opts[n * 2 + 1]);