]> git.sesse.net Git - movit/commitdiff
Move the GL_GENERATE_MIPMAP setting to a less broken place.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 Oct 2012 22:16:49 +0000 (00:16 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 Oct 2012 22:16:49 +0000 (00:16 +0200)
effect_chain.cpp

index 7cc23ff1c1cbd98114f9d076ed20a52f00d4ee6a..e728963759a7f85c85c86f29e304a72c7d8f315b 100644 (file)
@@ -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();