+size_t OpenGLTexture3D::get_data_size() const
+{
+ if(!id)
+ return 0;
+
+ const Texture3D &self = *static_cast<const Texture3D *>(this);
+
+ size_t level_size = self.width*self.height*self.depth*get_pixel_size(format);
+ size_t total_size = level_size;
+ for(unsigned i=0; i<n_levels; ++i, level_size>>=2)
+ total_size += level_size;
+ return total_size;
+}
+