]> git.sesse.net Git - movit/blobdiff - effect_chain.cpp
Forgot to increment version.h for bounce override; doing so now.
[movit] / effect_chain.cpp
index 751a6be2d361839c754ab8aeec4bc6c3f049cae3..39055649a4135c11e47e1b80c0284e598a7948c3 100644 (file)
@@ -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<Node *> *nonlinear_inputs)
 {
        if (node->output_gamma_curve == GAMMA_LINEAR &&
@@ -391,7 +398,7 @@ void EffectChain::compile_glsl_program(Phase *phase)
                        frag_shader_header += "#define YCBCR_ALSO_OUTPUT_RGBA 1\n";
                }
        }
-       frag_shader.append(read_version_dependent_file("footer", "frag"));
+       frag_shader.append(read_file("footer.frag"));
 
        // Collect uniforms from all effects and output them. Note that this needs
        // to happen after output_fragment_shader(), even though the uniforms come
@@ -500,7 +507,8 @@ Phase *EffectChain::construct_phase(Node *output, map<Node *, Phase *> *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);