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)