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.
This commit is contained in:
Kacper Michajłow 2024-11-08 04:23:28 +01:00
parent 012d317a1e
commit 23262308d6
1 changed files with 5 additions and 0 deletions

View File

@ -2116,6 +2116,11 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath
if (!mp_splitext(basename, &shadername)) if (!mp_splitext(basename, &shadername))
shadername = bstr0(basename); 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++) { for (int n = 0; opts[n * 2]; n++) {
struct bstr k = bstr0(opts[n * 2 + 0]); struct bstr k = bstr0(opts[n * 2 + 0]);
struct bstr v = bstr0(opts[n * 2 + 1]); struct bstr v = bstr0(opts[n * 2 + 1]);