X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=effect_chain.cpp;h=e68895d7b8f40c8c30475b8f51e0e49c7f39a473;hb=6f0d068e83d8aa03e1d530d02762da199fc5a1ff;hp=0f8876d8f70c68ccb6b4d2a41a538414eddf9efe;hpb=7af4d1b54ba141fdb74cd13ddc6110708855d157;p=movit diff --git a/effect_chain.cpp b/effect_chain.cpp index 0f8876d..e68895d 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -1,27 +1,29 @@ #define GL_GLEXT_PROTOTYPES 1 -#include +#include +#include +#include #include +#include +#include +#include #include -#include -#include -#include - #include #include #include #include -#include "util.h" -#include "effect_chain.h" -#include "gamma_expansion_effect.h" -#include "gamma_compression_effect.h" -#include "colorspace_conversion_effect.h" -#include "alpha_multiplication_effect.h" #include "alpha_division_effect.h" +#include "alpha_multiplication_effect.h" +#include "colorspace_conversion_effect.h" #include "dither_effect.h" -#include "input.h" +#include "effect.h" +#include "effect_chain.h" +#include "gamma_compression_effect.h" +#include "gamma_expansion_effect.h" #include "init.h" +#include "input.h" +#include "util.h" EffectChain::EffectChain(float aspect_nom, float aspect_denom) : aspect_nom(aspect_nom), @@ -53,6 +55,7 @@ EffectChain::~EffectChain() Input *EffectChain::add_input(Input *input) { + assert(!finalized); inputs.push_back(input); add_node(input); return input; @@ -60,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; } @@ -155,6 +159,7 @@ void EffectChain::find_all_nonlinear_inputs(Node *node, std::vector *non Effect *EffectChain::add_effect(Effect *effect, const std::vector &inputs) { + assert(!finalized); assert(inputs.size() == effect->num_inputs()); Node *node = add_node(effect); for (unsigned i = 0; i < inputs.size(); ++i) { @@ -1557,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)); @@ -1571,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); }