X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain.cpp;h=39055649a4135c11e47e1b80c0284e598a7948c3;hp=af0710e46a2ce6c82cd40cf9eaba7c57ed9d7a9e;hb=974b5c837c24179f9ab29f4ffdcdd1172288172b;hpb=865a82f44545fa48a67eda605a18315d6ea15cfd diff --git a/effect_chain.cpp b/effect_chain.cpp index af0710e..3905564 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -184,6 +184,13 @@ GLenum EffectChain::get_input_sampler(Node *node, unsigned input_num) const return GL_TEXTURE0 + node->incoming_links[input_num]->bound_sampler_num; } +GLenum EffectChain::has_input_sampler(Node *node, unsigned input_num) const +{ + assert(input_num < node->incoming_links.size()); + return node->incoming_links[input_num]->bound_sampler_num >= 0 && + node->incoming_links[input_num]->bound_sampler_num < 8; +} + void EffectChain::find_all_nonlinear_inputs(Node *node, vector *nonlinear_inputs) { if (node->output_gamma_curve == GAMMA_LINEAR && @@ -500,7 +507,8 @@ Phase *EffectChain::construct_phase(Node *output, map *complete bool start_new_phase = false; if (node->effect->needs_texture_bounce() && - !deps[i]->effect->is_single_texture()) { + !deps[i]->effect->is_single_texture() && + !deps[i]->effect->override_disable_bounce()) { start_new_phase = true; } @@ -1646,6 +1654,12 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height { assert(finalized); + // This needs to be set anew, in case we are coming from a different context + // from when we initialized. + check_error(); + glDisable(GL_DITHER); + check_error(); + // Save original viewport. GLuint x = 0, y = 0; @@ -1659,6 +1673,7 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height } // Basic state. + check_error(); glDisable(GL_BLEND); check_error(); glDisable(GL_DEPTH_TEST);