Diffusion KWin 450be6a3782b

Add a levels parameter to the GLTexture ctor

Authored by Fredrik Höglund <fredrik@kde.org>.

Description

Add a levels parameter to the GLTexture ctor

Prior to this commit we didn't know if mipmaps were going to be used
when we created the GL texture, which meant that we couldn't tell the
driver whether to allocate storage for mipmaps or not.

This resulted in one of two things happening depending on the driver;
either it would allocate storage for mipmaps that in most cases would
never be used, or it wouldn't and would later be forced to reallocate
the texture when mipmaps were added.

By adding this parameter we can now explicitly tell the driver how
many mipmap levels will be used.

The parameter is only added to the non-image constructor for now. The
image constructor is changed to only allocate a single level, which
matches how textures created from images are used in kwin. This may
need to be revisited in the future.

Details

Committed
Fredrik Höglund <fredrik@kde.org>Dec 14 2014, 5:33 PM
Parents
R108:ccf1bad426de: Make mipmap filters other than GL_LINEAR_MIPMAP_LINEAR work
Branches
Unknown
Tags
Unknown