pub struct ShaderCache { /* private fields */ }Expand description
Shader compilation cache for JIT-compiled kernels
Caches compiled shaders by query signature to avoid recompilation. Thread-safe via Mutex for concurrent query execution.
Implementations§
Source§impl ShaderCache
impl ShaderCache
Sourcepub fn get_or_insert(
&self,
key: &str,
device: &Device,
shader_source: &str,
) -> Arc<ShaderModule>
pub fn get_or_insert( &self, key: &str, device: &Device, shader_source: &str, ) -> Arc<ShaderModule>
Get cached shader or insert new one
§Arguments
key- Query signature (e.g.,"filter_gt_1000_sum")device- GPU device for shader compilationshader_source- WGSL shader source code
§Returns
Arc reference to compiled shader module (either cached or newly compiled)
§Panics
Panics if the cache mutex is poisoned (should never happen in normal operation)
Trait Implementations§
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