]> git.sesse.net Git - movit/blobdiff - effect_chain.cpp
Rename needs_many_samples() to needs_texture_bounce(), and update the comment.
[movit] / effect_chain.cpp
index 7cc23ff1c1cbd98114f9d076ed20a52f00d4ee6a..fcf94f8505299c0ec12156c8ab427b06e9fa73c0 100644 (file)
@@ -208,7 +208,7 @@ void EffectChain::finalize()
        // and of course at the end.
        unsigned start = 0;
        for (unsigned i = 0; i < effects.size(); ++i) {
-               if (effects[i]->needs_many_samples() && i != start) {
+               if (effects[i]->needs_texture_bounce() && i != start) {
                        phases.push_back(compile_glsl_program(start, i));
                        start = i;
                }
@@ -272,6 +272,9 @@ void EffectChain::finalize()
        check_error();
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        check_error();
+       // Intel/Mesa seems to have a broken glGenerateMipmap() for non-FBO textures, so do it here.
+       glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, phases[0].input_needs_mipmaps ? GL_TRUE : GL_FALSE);
+       check_error();
        glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, GL_UNSIGNED_BYTE, NULL);
        check_error();
 
@@ -301,11 +304,6 @@ void EffectChain::render_to_screen(unsigned char *src)
        check_error();
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
        check_error();
-
-       // Intel/Mesa seems to have a broken glGenerateMipmap() for non-FBO textures, so do it here.
-       glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, phases[0].input_needs_mipmaps ? GL_TRUE : GL_FALSE);
-       check_error();
-
        glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
        check_error();