Skip to content
Snippets Groups Projects
Commit 09834c52 authored by Niklas Haas's avatar Niklas Haas
Browse files

shaders/custom: also save stages only needed for RPN expressions

This is a bit annoying, and arguably such shaders are broken to begin
with because there's no way you can possibly rely on this logic without
spamming warnings.

But it represents a difference in functionality compared to mpv, so we
implement this just to be on the safe side.
parent 524e3965
No related branches found
No related tags found
No related merge requests found
Pipeline #17621 passed with stages
in 5 minutes and 31 seconds
......@@ -1090,6 +1090,18 @@ static bool register_hook(void *priv, struct custom_shader_hook hook)
if (bstr_equals0(hook.bind_tex[i], "HOOKED"))
p->save_stages |= pass.exec_stages;
}
for (int i = 0; i < PL_ARRAY_SIZE(hook.width); i++) {
if (hook.width[i].tag == SZEXP_VAR_W || hook.width[i].tag == SZEXP_VAR_H)
p->save_stages |= mp_stage_to_pl(hook.width[i].val.varname);
}
for (int i = 0; i < PL_ARRAY_SIZE(hook.height); i++) {
if (hook.height[i].tag == SZEXP_VAR_W || hook.height[i].tag == SZEXP_VAR_H)
p->save_stages |= mp_stage_to_pl(hook.height[i].val.varname);
}
for (int i = 0; i < PL_ARRAY_SIZE(hook.cond); i++) {
if (hook.cond[i].tag == SZEXP_VAR_W || hook.cond[i].tag == SZEXP_VAR_H)
p->save_stages |= mp_stage_to_pl(hook.cond[i].val.varname);
}
PL_INFO(p, "Registering hook pass: %.*s", BSTR_P(hook.pass_desc));
TARRAY_APPEND(p->tactx, p->hook_passes, p->num_hook_passes, pass);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment