pub struct ComputePipeline { /* private fields */ }Expand description
Smart pointer handle of a compute pipeline object.
Also contains information about the object.
See VkPipeline.
Implementations§
Source§impl ComputePipeline
impl ComputePipeline
Sourcepub fn create<S>(
device: &Device,
info: impl Into<ComputePipelineInfo>,
shader: S,
) -> Result<Self, DriverError>
pub fn create<S>( device: &Device, info: impl Into<ComputePipelineInfo>, shader: S, ) -> Result<Self, DriverError>
Creates a new compute pipeline on the given device.
shader may be a pre-built Shader or any input that can be converted into one.
Invalid shader data is returned as DriverError::InvalidData through the Result
instead of panicking.
See VkComputePipelineCreateInfo.
§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.handle(), vk::Pipeline::null());Sourcepub fn info(&self) -> ComputePipelineInfo
pub fn info(&self) -> ComputePipelineInfo
Gets the information used to create this object.
Sourcepub fn set_debug_name(&self, name: impl AsRef<str>)
pub fn set_debug_name(&self, name: impl AsRef<str>)
Sets the debugging name assigned to this pipeline.
Sourcepub fn with_debug_name(self, name: impl AsRef<str>) -> Self
pub fn with_debug_name(self, name: impl AsRef<str>) -> Self
Sets the debugging name assigned to this pipeline.
Trait Implementations§
Source§impl Clone for ComputePipeline
impl Clone for ComputePipeline
Source§fn clone(&self) -> ComputePipeline
fn clone(&self) -> ComputePipeline
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComputePipeline
impl Debug for ComputePipeline
impl Eq for ComputePipeline
Source§impl Hash for ComputePipeline
impl Hash for ComputePipeline
Source§impl PartialEq for ComputePipeline
impl PartialEq for ComputePipeline
Source§impl<'a> Pipeline<'a> for ComputePipeline
impl<'a> Pipeline<'a> for ComputePipeline
Source§impl<'a> Pipeline<'a> for &'a ComputePipeline
impl<'a> Pipeline<'a> for &'a ComputePipeline
Auto Trait Implementations§
impl !RefUnwindSafe for ComputePipeline
impl !UnwindSafe for ComputePipeline
impl Freeze for ComputePipeline
impl Send for ComputePipeline
impl Sync for ComputePipeline
impl Unpin for ComputePipeline
impl UnsafeUnpin for ComputePipeline
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