Function librashader_cache::cache_shader_object
source · pub fn cache_shader_object<E, T, R, H, const KEY_SIZE: usize>(
index: &str,
keys: &[H; KEY_SIZE],
factory: impl FnOnce(&[H; KEY_SIZE]) -> Result<T, E>,
load: impl Fn(T) -> Result<R, E>,
bypass_cache: bool
) -> Result<R, E>Expand description
Cache a shader object (usually bytecode) created by the keyed objects.
factoryis the function that compiles the values passed as keys to a shader object.loadtries to load a compiled shader object to a driver-specialized result.