~compiz-team/compiz/compiz.fix_1016364

Viewing all changes in revision 3257.

  • Committer: Sam Spilsbury
  • Date: 2012-06-22 04:32:12 UTC
  • Revision ID: sam.spilsbury@canonical.com-20120622043212-2tm0jmzqbwqyi23a
Fix broken mipmap support. Mipmap support was broken in the following ways:

1. glGenerateMipmapEXT is called multiple times for tfp textures
2. glGenerateMipmapEXT is called after glTexParameteri with GL_LINEAR_MIPMAP_LINEAR as the filter mode, and sometimes not called at all, which is undefined
3. We check for GL::fbo support before actually setting it from the extension lookup after glXCreateContext is called. As such, when we lookup an optimal pixmap fbconfig, we never find one that supports mipmaps, and it is merely "luck of the draw" as to whether or not we actually get one that does
4. We generate mipmaps for tfp textures even though mipmaps aren't actually supported on the config target, because we don't check priv->mipmapSupport

This generally results in white windows when mipmapping is enabled. See (LP: #1006216)

As such the following measures were implemented:
1. Virtual method to generate a mipmap, different for tfp textures as
   mipmap generation has to happen on damage there
2. Always generate mipmaps before setting texture filter
3. Do not check for GL::fbo support when checking fbconfigs for mimap support
4. Use GLTexture::mipmap () to determine if we actually can do mipmaps - this
   checks if the fbconfig supports mipmaps, that the texture is not
   an NV_TEXTURE_RECTANGLE_EXT, checks for fbo support and NPOT texture
   support

(LP: #1016364)

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: