-
- if(ARB_texture_storage)
- return sub_image(level, 0, 0, 0, size.x, size.y, size.z, data);
-
- bind_scratch();
-
- if(!allocated)
- {
- glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, levels-1);
- apply_swizzle();
- }
-
- GLenum fmt = get_gl_pixelformat(storage_fmt);
- GLenum comp = get_gl_components(get_components(storage_fmt));
- GLenum type = get_gl_type(get_component_type(storage_fmt));
- glTexImage3D(target, level, fmt, size.x, size.y, size.z, 0, comp, type, data);
-
- allocated |= 1<<level;
+ return sub_image(level, 0, 0, 0, size.x, size.y, size.z, data);