Skip to content
  • Fredrik Höglund's avatar
    Add a levels parameter to the GLTexture ctor · 450be6a3
    Fredrik Höglund authored
    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.
    450be6a3