Expand description
GPU shader cache management.
This module provides compiled shader storage, cache eviction, version tracking, and disk-persistent caching to avoid redundant shader compilation work across process restarts.
§Disk cache layout
The persistent cache stores each entry as a pair of files inside the configured directory:
<cache_dir>/<hex_hash>_<backend>_<flags>.shd – raw bytecode
<cache_dir>/<hex_hash>_<backend>_<flags>.meta – metadata (JSON-like text)The text metadata file contains a single line:
<source_hash> <backend> <feature_flags> <created_unix_secs>.
Structs§
- Compiled
Shader - A compiled shader blob stored in the cache.
- Disk
Cache Stats - Statistics for the disk cache.
- Disk
Shader Cache - Disk-persistent GPU shader cache.
- GpuShader
Cache - In-process GPU shader cache.
- Shader
Cache Stats - Statistics for the shader cache.
- Shader
Version - Version identifier for a compiled shader.
Enums§
- Disk
Cache Error - Errors that can occur during disk cache I/O.
- Eviction
Policy - Eviction policy for the shader cache.
Functions§
- age_of
- Estimate the age of a
SystemTimerelative to now. - hash_
source - Compute a simple 64-bit FNV-1a hash of a byte slice.