pub struct ComputePass<'a> { /* private fields */ }Expand description
A compute pass wrapper that automatically returns the encoder to the frame context.
This struct mirrors RenderPass in its lifecycle management - it takes the
encoder from FrameContext and returns it when dropped.
Implementations§
Source§impl<'a> ComputePass<'a>
impl<'a> ComputePass<'a>
Sourcepub fn pass(&mut self) -> &mut ComputePass<'static>
pub fn pass(&mut self) -> &mut ComputePass<'static>
Get the underlying wgpu compute pass.
Sourcepub fn set_pipeline(&mut self, pipeline: &'a ComputePipeline)
pub fn set_pipeline(&mut self, pipeline: &'a ComputePipeline)
Set the compute pipeline to use.
Sourcepub fn set_bind_group(
&mut self,
index: u32,
bind_group: &'a BindGroup,
offsets: &[u32],
)
pub fn set_bind_group( &mut self, index: u32, bind_group: &'a BindGroup, offsets: &[u32], )
Set a bind group.
Sourcepub fn dispatch_workgroups(&mut self, x: u32, y: u32, z: u32)
pub fn dispatch_workgroups(&mut self, x: u32, y: u32, z: u32)
Dispatch workgroups.
§Arguments
x- Number of workgroups in the X dimensiony- Number of workgroups in the Y dimensionz- Number of workgroups in the Z dimension
Sourcepub fn dispatch_workgroups_1d(&mut self, x: u32)
pub fn dispatch_workgroups_1d(&mut self, x: u32)
Dispatch workgroups with a 1D configuration.
Equivalent to dispatch_workgroups(x, 1, 1).
Sourcepub fn dispatch_workgroups_2d(&mut self, x: u32, y: u32)
pub fn dispatch_workgroups_2d(&mut self, x: u32, y: u32)
Dispatch workgroups with a 2D configuration.
Equivalent to dispatch_workgroups(x, y, 1).
Sourcepub fn dispatch_workgroups_indirect(&mut self, buffer: &'a Buffer, offset: u64)
pub fn dispatch_workgroups_indirect(&mut self, buffer: &'a Buffer, offset: u64)
Dispatch workgroups indirectly from a buffer.
The buffer should contain a DispatchIndirect struct:
ⓘ
#[repr(C)]
struct DispatchIndirect {
x: u32,
y: u32,
z: u32,
}Sourcepub fn insert_debug_marker(&mut self, label: &str)
pub fn insert_debug_marker(&mut self, label: &str)
Insert a debug marker.
Sourcepub fn push_debug_group(&mut self, label: &str)
pub fn push_debug_group(&mut self, label: &str)
Push a debug group.
Sourcepub fn pop_debug_group(&mut self)
pub fn pop_debug_group(&mut self)
Pop a debug group.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ComputePass<'a>
impl<'a> !RefUnwindSafe for ComputePass<'a>
impl<'a> Send for ComputePass<'a>
impl<'a> Sync for ComputePass<'a>
impl<'a> Unpin for ComputePass<'a>
impl<'a> !UnwindSafe for ComputePass<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more