X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=effect_chain.cpp;h=7dd19ccd634e0cd51999a6c5cdb0fc306e13bf22;hb=3d1f6c11c53cd9d3d5c1fb60f4accf050b7f135e;hp=ced571e0f6aa0eb94c1d1ffc17004d696cbfbe91;hpb=e9d9fc790abdf093176a0314f4588c6b8146e5a2;p=movit diff --git a/effect_chain.cpp b/effect_chain.cpp index ced571e..7dd19cc 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -220,13 +220,6 @@ EffectChain::Phase *EffectChain::compile_glsl_program(const std::vectornum_inputs() == 0) { - // OpenGL's origin is bottom-left, but most graphics software assumes - // a top-left origin. Thus, for inputs that come from the user, - // we flip the y coordinate. However, for FBOs, the origin - // is all correct, so don't do anything. - frag_shader += "\ttc.y = 1.0f - tc.y;\n"; - } frag_shader += "\treturn texture2D(tex_" + effect_id + ", tc);\n"; frag_shader += "}\n"; frag_shader += "\n"; @@ -351,6 +344,7 @@ void EffectChain::construct_glsl_programs(Effect *output) for (unsigned i = 0; i < deps.size(); ++i) { bool start_new_phase = false; + // FIXME: If we sample directly from a texture, we won't need this. if (effect->needs_texture_bounce()) { start_new_phase = true; } @@ -527,6 +521,8 @@ void EffectChain::finalize() for (unsigned i = 0; i < inputs.size(); ++i) { inputs[i]->finalize(); } + + assert(phases[0]->inputs.empty()); finalized = true; } @@ -556,11 +552,6 @@ void EffectChain::render_to_screen() } std::set generated_mipmaps; - for (unsigned i = 0; i < inputs.size(); ++i) { - // Inputs generate their own mipmaps if they need to - // (see input.cpp). - generated_mipmaps.insert(inputs[i]); - } for (unsigned phase = 0; phase < phases.size(); ++phase) { // See if the requested output size has changed. If so, we need to recreate