Tensor4D(ShapeT shape) : _shape(shape), _data(reinterpret_cast<T*>(ALLOCATE(size_bytes()))) { Clear(); }
constexpr index_type length_bytes() const noexcept { return size_bytes(); }
void reserved(GLsizeiptr size) noexcept { size_ = size; bind(); glBufferData(target, size_bytes(), nullptr, usage); }
void data(gsl::span<const data_type> cont) noexcept { size_ = cont.size(); bind(); glBufferData(target, size_bytes(), cont.data(), usage); }
ssize_t PackedAudioPacket<T>::read_from_fd(int fd) { return read_all(fd, _data, size_bytes( )); }
ssize_t PackedAudioPacket<T>::write_to_fd(int fd) { return write_all(fd, _data, size_bytes( )); }