Skip to main content

Module shader_cache

Module shader_cache 

Source
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§

CompiledShader
A compiled shader blob stored in the cache.
DiskCacheStats
Statistics for the disk cache.
DiskShaderCache
Disk-persistent GPU shader cache.
GpuShaderCache
In-process GPU shader cache.
ShaderCacheStats
Statistics for the shader cache.
ShaderVersion
Version identifier for a compiled shader.

Enums§

DiskCacheError
Errors that can occur during disk cache I/O.
EvictionPolicy
Eviction policy for the shader cache.

Functions§

age_of
Estimate the age of a SystemTime relative to now.
hash_source
Compute a simple 64-bit FNV-1a hash of a byte slice.