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.
Trait Implementations
sourceimpl Debug for ComputePipeline
impl Debug for ComputePipeline
sourceimpl DeviceOwned for ComputePipeline
impl DeviceOwned for ComputePipeline
sourceimpl Drop for ComputePipeline
impl Drop for ComputePipeline
sourceimpl PartialEq<ComputePipeline> for ComputePipeline
impl PartialEq<ComputePipeline> for ComputePipeline
sourceimpl Pipeline for ComputePipeline
impl Pipeline for ComputePipeline
sourcefn bind_point(&self) -> PipelineBindPoint
fn bind_point(&self) -> PipelineBindPoint
Returns the bind point of this pipeline.
sourcefn layout(&self) -> &Arc<PipelineLayout>
fn layout(&self) -> &Arc<PipelineLayout>
Returns the pipeline layout used in this pipeline.
sourcefn num_used_descriptor_sets(&self) -> u32
fn num_used_descriptor_sets(&self) -> u32
Returns the number of descriptor sets actually accessed by this pipeline. This may be less than the number of sets in the pipeline layout. Read more
sourceimpl VulkanObject for ComputePipeline
impl VulkanObject for ComputePipeline
sourcefn internal_object(&self) -> Pipeline
fn internal_object(&self) -> Pipeline
Returns a reference to the object.
impl Eq for ComputePipeline
Auto Trait Implementations
impl RefUnwindSafe for ComputePipeline
impl Send for ComputePipeline
impl Sync for ComputePipeline
impl Unpin for ComputePipeline
impl UnwindSafe for ComputePipeline
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more