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

Revert "shaders: make sh_subpass slightly stricter"

This reverts commit 00127130.

This commit is a regression in performance since it breaks merging of
chroma scalers.
parent 357f9323
No related branches found
No related tags found
No related merge requests found
......@@ -370,11 +370,13 @@ ident_t sh_subpass(struct pl_shader *sh, const struct pl_shader *sub)
return NULL;
}
int sub_w = PL_DEF(sub->output_w, sh->output_w),
sub_h = PL_DEF(sub->output_h, sh->output_h);
// Check for shader compatibility
if (sh->output_w != sub_w || sh->output_h != sub_h) {
int res_w = PL_DEF(sh->output_w, sub->output_w),
res_h = PL_DEF(sh->output_h, sub->output_h);
if ((sub->output_w && res_w != sub->output_w) ||
(sub->output_h && res_h != sub->output_h))
{
PL_TRACE(sh, "Can't merge shaders: incompatible sizes: %dx%d and %dx%d",
sh->output_w, sh->output_h, sub->output_w, sub->output_h);
return NULL;
......@@ -392,6 +394,9 @@ ident_t sh_subpass(struct pl_shader *sh, const struct pl_shader *sub)
}
}
sh->output_w = res_w;
sh->output_h = res_h;
// Append the prelude and header
bstr_xappend(sh, &sh->buffers[SH_BUF_PRELUDE], sub->buffers[SH_BUF_PRELUDE]);
bstr_xappend(sh, &sh->buffers[SH_BUF_HEADER], sub->buffers[SH_BUF_HEADER]);
......
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