pbrt/src/core/spectrum.rs

8 lines
280 B
Rust

use crate::utils::containers::InternCache;
static SPECTRUM_CACHE: Lazy<Mutex<HashMap<String, Spectrum>>> =
Lazy::new(|| Mutex::new(HashMap::new()));
fn get_spectrum_cache() -> &'static InternCache<DenselySampledSpectrum> {
SPECTRUM_CACHE.get_or_init(InternCache::new)
}