pub struct ComputePipeline { /* private fields */ }
Expand description
A pipeline object that describes to the Vulkan implementation how it should perform compute operations.
The template parameter contains the descriptor set to use with this pipeline.
Pass an optional Arc
to a PipelineCache
to enable pipeline caching. The vulkan
implementation will handle the PipelineCache
and check if it is available.
Check the documentation of the PipelineCache
for more information.
Implementations
sourceimpl ComputePipeline
impl ComputePipeline
sourcepub fn new<Css, F>(
device: Arc<Device>,
shader: EntryPoint<'_>,
specialization_constants: &Css,
cache: Option<Arc<PipelineCache>>,
func: F
) -> Result<Arc<ComputePipeline>, ComputePipelineCreationError>where
Css: SpecializationConstants,
F: FnOnce(&mut [DescriptorSetLayoutCreateInfo]),
pub fn new<Css, F>(
device: Arc<Device>,
shader: EntryPoint<'_>,
specialization_constants: &Css,
cache: Option<Arc<PipelineCache>>,
func: F
) -> Result<Arc<ComputePipeline>, ComputePipelineCreationError>where
Css: SpecializationConstants,
F: FnOnce(&mut [DescriptorSetLayoutCreateInfo]),
Builds a new ComputePipeline
.
func
is a closure that is given a mutable reference to the inferred descriptor set
definitions. This can be used to make changes to the layout before it’s created, for example
to add dynamic buffers or immutable samplers.
sourcepub fn with_pipeline_layout<Css>(
device: Arc<Device>,
shader: EntryPoint<'_>,
specialization_constants: &Css,
layout: Arc<PipelineLayout>,
cache: Option<Arc<PipelineCache>>
) -> Result<Arc<ComputePipeline>, ComputePipelineCreationError>where
Css: SpecializationConstants,
pub fn with_pipeline_layout<Css>(
device: Arc<Device>,
shader: EntryPoint<'_>,
specialization_constants: &Css,
layout: Arc<PipelineLayout>,
cache: Option<Arc<PipelineCache>>
) -> Result<Arc<ComputePipeline>, ComputePipelineCreationError>where
Css: SpecializationConstants,
Builds a new ComputePipeline
with a specific pipeline layout.
An error will be returned if the pipeline layout isn’t a superset of what the shader uses.
sourcepub unsafe fn with_unchecked_pipeline_layout<Css>(
device: Arc<Device>,
shader: EntryPoint<'_>,
specialization_constants: &Css,
layout: Arc<PipelineLayout>,
cache: Option<Arc<PipelineCache>>
) -> Result<Arc<ComputePipeline>, ComputePipelineCreationError>where
Css: SpecializationConstants,
pub unsafe fn with_unchecked_pipeline_layout<Css>(
device: Arc<Device>,
shader: EntryPoint<'_>,
specialization_constants: &Css,
layout: Arc<PipelineLayout>,
cache: Option<Arc<PipelineCache>>
) -> Result<Arc<ComputePipeline>, ComputePipelineCreationError>where
Css: SpecializationConstants,
Same as with_pipeline_layout
, but doesn’t check whether the pipeline layout is a
superset of what the shader expects.
sourcepub fn device(&self) -> &Arc<Device>
pub fn device(&self) -> &Arc<Device>
Returns the Device
this compute pipeline was created with.
sourcepub fn descriptor_requirements(
&self
) -> impl ExactSizeIterator<Item = ((u32, u32), &DescriptorRequirements)>
pub fn descriptor_requirements(
&self
) -> impl ExactSizeIterator<Item = ((u32, u32), &DescriptorRequirements)>
Returns an iterator over the descriptor requirements for this pipeline.