]> git.sesse.net Git - movit/blobdiff - effect_chain.cpp
Fix a bug where DeconvolutionSharpenEffect would forget one line of the kernel.
[movit] / effect_chain.cpp
index 00151977be63823288cd0d1c9497e7b9d2708fdb..e68895d7b8f40c8c30475b8f51e0e49c7f39a473 100644 (file)
@@ -55,6 +55,7 @@ EffectChain::~EffectChain()
 
 Input *EffectChain::add_input(Input *input)
 {
+       assert(!finalized);
        inputs.push_back(input);
        add_node(input);
        return input;
@@ -62,6 +63,7 @@ Input *EffectChain::add_input(Input *input)
 
 void EffectChain::add_output(const ImageFormat &format, OutputAlphaFormat alpha_format)
 {
+       assert(!finalized);
        output_format = format;
        output_alpha_format = alpha_format;
 }
@@ -157,6 +159,7 @@ void EffectChain::find_all_nonlinear_inputs(Node *node, std::vector<Node *> *non
 
 Effect *EffectChain::add_effect(Effect *effect, const std::vector<Effect *> &inputs)
 {
+       assert(!finalized);
        assert(inputs.size() == effect->num_inputs());
        Node *node = add_node(effect);
        for (unsigned i = 0; i < inputs.size(); ++i) {
@@ -1559,6 +1562,8 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height
                        // Last phase goes to the output the user specified.
                        glBindFramebuffer(GL_FRAMEBUFFER, dest_fbo);
                        check_error();
+                       GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+                       assert(status == GL_FRAMEBUFFER_COMPLETE);
                        glViewport(x, y, width, height);
                        if (dither_effect != NULL) {
                                CHECK(dither_effect->set_int("output_width", width));
@@ -1573,6 +1578,8 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height
                                output_node->output_texture,
                                0);
                        check_error();
+                       GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+                       assert(status == GL_FRAMEBUFFER_COMPLETE);
                        glViewport(0, 0, phases[phase]->output_width, phases[phase]->output_height);
                }