pub struct ShaderCache { /* private fields */ }Expand description
Shader cache with LRU eviction policy
Implementations§
Source§impl ShaderCache
impl ShaderCache
Sourcepub fn insert(&self, hash: Hash, shader: CompiledShader)
pub fn insert(&self, hash: Hash, shader: CompiledShader)
Insert a compiled shader into cache
Sourcepub fn get(&self, hash: &Hash) -> Option<CompiledShader>
pub fn get(&self, hash: &Hash) -> Option<CompiledShader>
Get a compiled shader from cache
Sourcepub fn get_stats(&self) -> CacheStats
pub fn get_stats(&self) -> CacheStats
Get cache statistics
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset statistics
Auto Trait Implementations§
impl !Freeze for ShaderCache
impl !RefUnwindSafe for ShaderCache
impl Send for ShaderCache
impl Sync for ShaderCache
impl Unpin for ShaderCache
impl UnsafeUnpin for ShaderCache
impl UnwindSafe for ShaderCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more