X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain.cpp;h=5e43474c457e8cc7dca3db7054fb8e6b6581e3d8;hp=b0d4aafbac71dc9a2864c0941ddf01cfc10c8bd0;hb=96fd7f56bf3e5a8e769f9982505889e0273addeb;hpb=2fd06b9c44225d1e740cb2de08a9dfa5c9cd0031 diff --git a/effect_chain.cpp b/effect_chain.cpp index b0d4aaf..5e43474 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -1,5 +1,3 @@ -#define GL_GLEXT_PROTOTYPES 1 - #include #include #include @@ -1758,13 +1756,6 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height } } - for (set::iterator attr_it = bound_attribute_indices.begin(); - attr_it != bound_attribute_indices.end(); - ++attr_it) { - glDisableVertexAttribArray(*attr_it); - check_error(); - } - for (map::const_iterator texture_it = output_textures.begin(); texture_it != output_textures.end(); ++texture_it) { @@ -1851,9 +1842,7 @@ void EffectChain::execute_phase(Phase *phase, bool last_phase, output_textures->insert(make_pair(phase, tex_num)); } - const GLuint glsl_program_num = phase->glsl_program_num; - check_error(); - glUseProgram(glsl_program_num); + glUseProgram(phase->glsl_program_num); check_error(); // Set up RTT inputs for this phase. @@ -1884,7 +1873,7 @@ void EffectChain::execute_phase(Phase *phase, bool last_phase, for (unsigned i = 0; i < phase->effects.size(); ++i) { Node *node = phase->effects[i]; unsigned old_sampler_num = sampler_num; - node->effect->set_gl_state(glsl_program_num, phase->effect_ids[node], &sampler_num); + node->effect->set_gl_state(phase->glsl_program_num, phase->effect_ids[node], &sampler_num); check_error(); if (node->effect->is_single_texture()) { @@ -1927,9 +1916,6 @@ void EffectChain::execute_phase(Phase *phase, bool last_phase, glDrawArrays(GL_TRIANGLES, 0, 3); check_error(); - glUseProgram(0); - check_error(); - for (unsigned i = 0; i < phase->effects.size(); ++i) { Node *node = phase->effects[i]; node->effect->clear_gl_state();