// XXX Allocation should be tracked per-face, but we'll run out of bits
allocated |= 1<<level;
- if(gen_mipmap && level==0)
+ if(auto_gen_mipmap && level==0)
{
// TODO Only do this once all faces are created
- auto_generate_mipmap();
+ generate_mipmap();
allocated |= (1<<get_n_levels())-1;
}
}
glTexSubImage2D(face, level, x, y, wd, ht, get_upload_format(fmt), type, data);
- if(gen_mipmap && level==0)
- auto_generate_mipmap();
+ if(auto_gen_mipmap && level==0)
+ generate_mipmap();
}
void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool srgb)
PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(size==0)
{
- unsigned l = (is_mipmapped(min_filter) ? 0 : 1);
+ unsigned l = (is_mipmapped(min_filter) ? mipmap_levels ? mipmap_levels : 0 : 1);
storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, l);
}
else if(w!=size || h!=size)
void TextureCube::Loader::storage(PixelFormat fmt, unsigned s)
{
- if(srgb)
- fmt = get_srgb_pixelformat(fmt);
obj.storage(fmt, s);
}