pub struct ComputePipeline {
    pub info: ComputePipelineInfo,
    pub name: Option<String>,
    /* private fields */
}
Expand description

Smart pointer handle to a pipeline object.

Also contains information about the object.

§Deref behavior

ComputePipeline automatically dereferences to vk::Pipeline (via the Deref trait), so you can call vk::Pipeline’s methods on a value of type ComputePipeline.

Fields§

§info: ComputePipelineInfo

Information used to create this object.

§name: Option<String>

A descriptive name used in debugging messages.

Implementations§

source§

impl ComputePipeline

source

pub fn create( device: &Arc<Device>, info: impl Into<ComputePipelineInfo>, shader: impl Into<Shader> ) -> Result<Self, DriverError>

Creates a new compute pipeline on the given device.

§Panics

If shader code is not a multiple of four bytes.

§Examples

Basic usage:

// my_shader_code is raw SPIR-V code as bytes
let shader = Shader::new_compute(my_shader_code.as_slice());
let pipeline = ComputePipeline::create(&device, ComputePipelineInfo::default(), shader)?;

assert_ne!(*pipeline, vk::Pipeline::null());
source

pub fn with_name(this: Self, name: impl Into<String>) -> Self

Sets the debugging name assigned to this pipeline.

Trait Implementations§

source§

impl Access for ComputePipeline

source§

const DEFAULT_READ: AccessType = AccessType::ComputeShaderReadSampledImageOrUniformTexelBuffer

The default AccessType for read operations, if not specified explicitly.
source§

const DEFAULT_WRITE: AccessType = AccessType::ComputeShaderWrite

The default AccessType for write operations, if not specified explicitly.
source§

impl Debug for ComputePipeline

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for ComputePipeline

§

type Target = Pipeline

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Drop for ComputePipeline

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.