glTexImage3D(target, level, ifmt, width, height, depth, 0, fmt, type, data);
allocated |= 1<<level;
if(gen_mipmap && level==0)
{
glTexImage3D(target, level, ifmt, width, height, depth, 0, fmt, type, data);
allocated |= 1<<level;
if(gen_mipmap && level==0)
{