From: Steinar H. Gunderson Date: Wed, 3 Oct 2012 22:16:49 +0000 (+0200) Subject: Move the GL_GENERATE_MIPMAP setting to a less broken place. X-Git-Tag: 1.0~391 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=eb66e8ed648c485ae211e2ed179ca116b7fa65d7;p=movit Move the GL_GENERATE_MIPMAP setting to a less broken place. --- diff --git a/effect_chain.cpp b/effect_chain.cpp index 7cc23ff..e728963 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -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();