|
| uint64_t | cacheKey (uint64_t recipeHash, AssetType type) |
| | The complete cache key for one cooked artifact.
|
| bool | writeMesh (const std::filesystem::path &path, const MeshAsset &mesh) |
| | Write one cooked file of each kind.
|
| bool | isCookedCurrent (AssetType type, const std::filesystem::path &path) |
| | Whether the cooked file at path can still serve type.
|
| bool | readMesh (const std::filesystem::path &path, MeshAsset &out) |
| | Read one cooked file of each kind.
|
Cooked binary asset format (derived cache).
Host-endian; an endian sentinel rejects a file written on a differently-endianed machine. Cooked files are regenerable and keyed to their recipe by name (see cacheKey). Readers validate every count against the file length before allocating. Materials load straight from JSON and are not cooked; meshes, textures, skeletons, animation clips and sounds are.
| bool Vkm::Engine::AssetCook::isCookedCurrent |
( |
AssetType | type, |
|
|
const std::filesystem::path & | path ) |
|
nodiscard |
Whether the cooked file at path can still serve type.
Reads the header and measures the file, nothing more. Not current: absent, not a cooked asset, another kind, or a length other than the header's. Recipe and cooker version are in the name, so not checked. A material is never current: it has no binary. Logs nothing; a stale cache is the caller's to report.
- Parameters
-
| type | Asset type the file is expected to hold. |
| path | Cooked file to probe, already named for its key. |
- Returns
- True when this build can read that file.
| uint16_t Vkm::Engine::AssetCook::COOKER_VERSION = 12 |
|
constexpr |
Bump when anything the cooker writes changes: a kind's byte layout, an importer flag, a mip policy, a vertex welding rule.
Part of every cache key, so a bump re-bakes everything. Also written into each header, where a reader refuses a mismatch - the case of a file copied under a name not baked for it. Only testTheCookersOutputIsPinnedToItsVersion notices a forgotten bump that changes no layout.