Game Development Reference
In-Depth Information
Figure 5-1. The cache system software stack: low-level IO, streaming and serialization framework,
software plug-ins, and tools
Cache Format
The bootstrap section contains basic metadata and the header offset. Each header entry contains chunk metadata.
The cache file format is oriented towards two use cases: writing a huge quantity of geometry once, and reading
parts of the geometry often. As the format is designed for writing in batches, it will be slightly inefficient in the case
of multiple read-write cycles. However, in a production with a complex pipeline, this situation rarely occurs. Instead,
each department produces caches for one department and uses cache from another, so the need for read-write caches
is almost nonexistent.
Our files contain an arbitrary number of chunks. A chunk is an array of data, defined by a data type, a size, and
a tag. A cache can be viewed as a general-purpose binary chunk dictionary. The binary layout on disk is shown in
Figure 5-2 . The bootstrap is a fixed-size header containing the API version number and an offset to the header. The
chunks are written contiguously and an array of chunk metadata is stored, with each metadata cell containing a chunk
offset, a size, a type, and a tag.
Figure 5-2. Binary layout of our cache file format
 
Search WWH ::




Custom Search