pub struct ShaderVariantCache { /* private fields */ }Expand description
A cache for compiled shader variants, keyed by topology hash.
Implementations§
Source§impl ShaderVariantCache
impl ShaderVariantCache
pub fn new() -> Self
Sourcepub fn get_or_compile(
&mut self,
graph: &ShaderGraph,
compiler: &ShaderCompiler,
) -> Result<&CompiledShader, CompileError>
pub fn get_or_compile( &mut self, graph: &ShaderGraph, compiler: &ShaderCompiler, ) -> Result<&CompiledShader, CompileError>
Get a cached shader by topology hash, or compile and cache it.
Sourcepub fn invalidate(&mut self, hash: u64)
pub fn invalidate(&mut self, hash: u64)
Invalidate a specific cache entry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShaderVariantCache
impl RefUnwindSafe for ShaderVariantCache
impl Send for ShaderVariantCache
impl Sync for ShaderVariantCache
impl Unpin for ShaderVariantCache
impl UnsafeUnpin for ShaderVariantCache
impl UnwindSafe for ShaderVariantCache
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