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