Expand description
GPU tile format: header, tile, index, and footer structures
§File Layout
Offset 0: GpuFileHeader (64 bytes)
Offset 64: Tile 0 — TileHeader (32 bytes) + payload (padded to 128-byte boundary)
... Tile N-1
Offset X: TileIndexHeader (8 bytes)
Offset X+8: TileIndexEntry[0..N] (24 bytes each)
Offset X+8+24N: GpuFileFooter (24 bytes) ← last 24 bytes of fileStructs§
- Engine
Version - Packed 8-byte semantic version of the producing engine.
- GpuFile
Flags - Bitfield flags stored in the GPU file header.
- GpuFile
Footer - Fixed 24-byte record at the very end of every GPU archive.
- GpuFile
Header - Fixed 64-byte header at the start of every GPU-compressed archive.
- Tile
Flags - Per-tile bitfield flags stored in the tile header.
- Tile
Header - Fixed 32-byte header preceding each compressed tile’s payload.
- Tile
Index Entry - One entry per tile in the trailing index.
- Tile
Index Header - 8-byte header immediately before the tile index entries.
Constants§
- CGPU_
MAGIC - CGPU magic bytes: ASCII “CGPU”
- DEFAULT_
SUB_ STREAM_ COUNT - Default sub-stream count: 32 (matches GPU warp width)
- DEFAULT_
TILE_ SIZE - Default tile size: 64KB (65536 bytes)
- ENGINE_
VERSION_ STR - Current engine semantic version (set at build time).
- FORMAT_
VERSION - Current format version. Files with a different version are rejected.
Version 2:
GDeflateencoding (replaces v1 LZ77). - TILE_
ALIGNMENT - Alignment boundary for tile payloads (128 bytes for GPU memory coalescing)
Functions§
- padding_
to_ alignment - Compute padding needed to align a size to the tile alignment boundary.