Struct wgpu::ComputePass[][src]

pub struct ComputePass<'a> { /* fields omitted */ }

In-progress recording of a compute pass.

Implementations

impl<'a> ComputePass<'a>[src]

pub fn set_bind_group(
    &mut self,
    index: u32,
    bind_group: &'a BindGroup,
    offsets: &[DynamicOffset]
)
[src]

Sets the active bind group for a given bind group index. The bind group layout in the active pipeline when the dispatch() function is called must match the layout of this bind group.

If the bind group have dynamic offsets, provide them in order of their declaration. These offsets have to be aligned to BIND_BUFFER_ALIGNMENT.

pub fn set_pipeline(&mut self, pipeline: &'a ComputePipeline)[src]

Sets the active compute pipeline.

pub fn insert_debug_marker(&mut self, label: &str)[src]

Inserts debug marker.

pub fn push_debug_group(&mut self, label: &str)[src]

Start record commands and group it into debug marker group.

pub fn pop_debug_group(&mut self)[src]

Stops command recording and creates debug group.

pub fn dispatch(&mut self, x: u32, y: u32, z: u32)[src]

Dispatches compute work operations.

x, y and z denote the number of work groups to dispatch in each dimension.

pub fn dispatch_indirect(
    &mut self,
    indirect_buffer: &'a Buffer,
    indirect_offset: BufferAddress
)
[src]

Dispatches compute work operations, based on the contents of the indirect_buffer.

impl<'a> ComputePass<'a>[src]

Features::PUSH_CONSTANTS must be enabled on the device in order to call these functions.

pub fn set_push_constants(&mut self, offset: u32, data: &[u8])[src]

Set push constant data.

Offset is measured in bytes, but must be a multiple of PUSH_CONSTANT_ALIGNMENT.

Data size must be a multiple of 4 and must be aligned to the 4s, so we take an array of u32. For example, with an offset of 4 and an array of [u32; 3], that will write to the range of 4..16.

impl<'a> ComputePass<'a>[src]

Features::TIMESTAMP_QUERY must be enabled on the device in order to call these functions.

pub fn write_timestamp(&mut self, query_set: &QuerySet, query_index: u32)[src]

Issue a timestamp command at this point in the queue. The timestamp will be written to the specified query set, at the specified index.

Must be multiplied by [Device::get_timestamp_period] to get the value in nanoseconds. Absolute values have no meaning, but timestamps can be subtracted to get the time it takes for a string of operations to complete.

impl<'a> ComputePass<'a>[src]

Features::PIPELINE_STATISTICS_QUERY must be enabled on the device in order to call these functions.

pub fn begin_pipeline_statistics_query(
    &mut self,
    query_set: &QuerySet,
    query_index: u32
)
[src]

Start a pipeline statistics query on this render pass. It can be ended with end_pipeline_statistics_query. Pipeline statistics queries may not be nested.

pub fn end_pipeline_statistics_query(&mut self)[src]

End the pipeline statistics query on this render pass. It can be started with begin_pipeline_statistics_query. Pipeline statistics queries may not be nested.

Trait Implementations

impl<'a> Debug for ComputePass<'a>[src]

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

Formats the value using the given formatter. Read more

impl<'a> Drop for ComputePass<'a>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Downcast<T> for T

pub fn downcast(&self) -> &T

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Upcast<T> for T

pub fn upcast(&self) -> Option<&T>