pub struct PipelineCache { /* private fields */ }Expand description
PipelineCache holds compiled render-pipeline variants.
The cache grows only. Misses compile synchronously on first use.
Implementations§
Source§impl PipelineCache
impl PipelineCache
Sourcepub fn new(device: &Device, uniforms_layout: &BindGroupLayout) -> Self
pub fn new(device: &Device, uniforms_layout: &BindGroupLayout) -> Self
new compiles the shader module and pipeline layouts for device.
Sourcepub fn blend_bind_layout(&self) -> &BindGroupLayout
pub fn blend_bind_layout(&self) -> &BindGroupLayout
blend_bind_layout returns the group-1 layout for advanced-blend bind groups.
Bindings are destination, sampler, and source.
Sourcepub fn texture_bind_layout(&self) -> &BindGroupLayout
pub fn texture_bind_layout(&self) -> &BindGroupLayout
texture_bind_layout returns the group-1 layout for image bind groups.
Bindings are texture and sampler.
Sourcepub fn ensure(&mut self, device: &Device, key: PipelineKey)
pub fn ensure(&mut self, device: &Device, key: PipelineKey)
ensure compiles the pipeline for key if it is not already cached.
Sourcepub fn get(&self, key: &PipelineKey) -> &RenderPipeline
pub fn get(&self, key: &PipelineKey) -> &RenderPipeline
get returns a pipeline previously compiled by Self::ensure.
Panics if key was never ensured.
Auto Trait Implementations§
impl !RefUnwindSafe for PipelineCache
impl !UnwindSafe for PipelineCache
impl Freeze for PipelineCache
impl Send for PipelineCache
impl Sync for PipelineCache
impl Unpin for PipelineCache
impl UnsafeUnpin for PipelineCache
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