VGF File Format Notes
Section Alignment
VGF files written with format version 0.4.3 or later align each section offset to an 8-byte boundary. Decoders
remain compatible with older files whose section offsets were not guaranteed to be 8-byte aligned.
Model Constants Section
New VGF files store the Model Constants Section as a compact raw byte section. Older files can still contain the
legacy FlatBuffers ConstantSection layout; the decoder keeps support for that legacy representation.
The current raw constants layout is version CONST00:
Offset |
Size |
Field |
Description |
|---|---|---|---|
0 |
8 |
|
Fixed bytes |
8 |
8 |
|
Number of constant metadata records. |
16 |
|
|
Fixed-size |
|
remaining bytes |
|
Raw constant data bytes. |
Each ConstantMetaDataV00 record is 24 bytes:
Offset |
Size |
Field |
Description |
|---|---|---|---|
0 |
4 |
|
Model Resource Table index for the constant resource. |
4 |
4 |
|
Sparse dimension, or |
8 |
8 |
|
Constant data size in bytes, excluding any padding. |
16 |
8 |
|
Offset in bytes from the start of the payload region. |
Constant payload entries are stored as raw bytes. The encoder pads each payload entry to an 8-byte boundary, but
size always describes the unpadded constant data length returned by the decoder.
Caution
The raw constants section stores fixed-width integer fields and payload bytes without endian conversion. The target host and the host that created the VGF file must use the same endianness.