pub struct WComputePass<'a> {
pub label: String,
/* private fields */
}Expand description
RAII wrapper around wgpu::ComputePass created by CommandBuffer::create_compute_pass.
§Example
use wde_wgpu::{
command_buffer::CommandBuffer,
compute_pass::WComputePass,
compute_pipeline::ComputePipeline,
instance::{RenderError, RenderInstanceData},
};
let mut cmd = CommandBuffer::new(instance, "compute-frame");
{
let mut pass: WComputePass = cmd.create_compute_pass("cull");
pass
.set_pipeline(pipeline)?
.set_bind_group(0, bind_group)
.set_push_constants(bytemuck::bytes_of(&[4u32, 8u32]));
pass.dispatch(4, 1, 1)?;
}
cmd.submit(instance);Fields§
§label: StringImplementations§
Source§impl<'a> WComputePass<'a>
impl<'a> WComputePass<'a>
Sourcepub fn new(label: &str, compute_pass: ComputePass<'a>) -> Self
pub fn new(label: &str, compute_pass: ComputePass<'a>) -> Self
Create a new compute pass.
§Arguments
label- The label of the compute pass.compute_pass- The compute pass to create.
Sourcepub fn set_pipeline(
&mut self,
pipeline: &'a ComputePipeline,
) -> Result<&mut Self, RenderError>
pub fn set_pipeline( &mut self, pipeline: &'a ComputePipeline, ) -> Result<&mut Self, RenderError>
Sourcepub fn set_push_constants(&mut self, data: &[u8]) -> &mut Self
pub fn set_push_constants(&mut self, data: &[u8]) -> &mut Self
Sourcepub fn set_bind_group(
&mut self,
binding: u32,
bind_group: &'a BindGroup,
) -> &mut Self
pub fn set_bind_group( &mut self, binding: u32, bind_group: &'a BindGroup, ) -> &mut Self
Set a bind group of the compute pass at a binding.
§Arguments
binding- The binding of the bind group.bind_group- The bind group to set.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for WComputePass<'a>
impl<'a> !RefUnwindSafe for WComputePass<'a>
impl<'a> Send for WComputePass<'a>
impl<'a> Sync for WComputePass<'a>
impl<'a> Unpin for WComputePass<'a>
impl<'a> !UnwindSafe for WComputePass<'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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.