X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=effect_chain.cpp;h=933553c7455f47df1f45268e1e771dc01f6dad3d;hb=ad25340e74ef8553c8360d5aa3910629529a4634;hp=f79c09a478360b5b59aa158ecae0111702ee9e43;hpb=bbf22bd4cc8c00add6b934f19d30a099241ffd84;p=movit diff --git a/effect_chain.cpp b/effect_chain.cpp index f79c09a..933553c 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -317,7 +317,7 @@ Phase *EffectChain::compile_glsl_program( // without any explicit recursion. void EffectChain::construct_glsl_programs(Node *output) { - // Which effects have already been completed in this phase? + // Which effects have already been completed? // We need to keep track of it, as an effect with multiple outputs // could otherwise be calculated multiple times. std::set completed_effects; @@ -348,10 +348,13 @@ void EffectChain::construct_glsl_programs(Node *output) // This should currently only happen for effects that are inputs // (either true inputs or phase outputs). We special-case inputs, // and then deduplicate phase outputs in compile_glsl_program(). - if (node->effect->num_inputs() == 0 && completed_effects.count(node)) { - continue; + if (node->effect->num_inputs() == 0) { + if (find(this_phase_effects.begin(), this_phase_effects.end(), node) != this_phase_effects.end()) { + continue; + } + } else { + assert(completed_effects.count(node) == 0); } - assert(completed_effects.count(node) == 0); this_phase_effects.push_back(node); completed_effects.insert(node);