ad-hoc serialization of blitbuffer and koptcontext