Skip to main content

SharedPipelineCache

Type Alias SharedPipelineCache 

Source
pub type SharedPipelineCache = Arc<Mutex<PipelineCache>>;
Expand description

Thread-safe shared pipeline cache.

This is the type stored in crate::context::GpuContext. Callers that compile pipelines on multiple threads lock this mutex, perform a PipelineCache::get_or_insert_with call, and release the lock. Since wgpu::Device::create_compute_pipeline is a synchronous blocking call, lock contention is bounded by the number of simultaneous cache misses.

Aliased Typeยง

pub struct SharedPipelineCache { /* private fields */ }