pub struct ComputePass {
pub name: String,
pub pass_type: PassType,
pub bindings: Vec<BufferBinding>,
pub workgroups: (u32, u32, u32),
}Expand description
A single compute pass with a name, type, buffer bindings, and dispatch dimensions.
Fields§
§name: StringHuman-readable name for debugging.
pass_type: PassTypeThe category of this pass.
bindings: Vec<BufferBinding>Buffer bindings used by this pass.
workgroups: (u32, u32, u32)Workgroup dispatch dimensions (x, y, z).
Implementations§
Source§impl ComputePass
impl ComputePass
Sourcepub fn new(name: impl Into<String>, pt: PassType) -> Self
pub fn new(name: impl Into<String>, pt: PassType) -> Self
Creates a new ComputePass with no bindings and a default dispatch of (1, 1, 1).
Sourcepub fn add_input_binding(&mut self, slot: u8, size: u32)
pub fn add_input_binding(&mut self, slot: u8, size: u32)
Adds a read-only (input) buffer binding on the given slot.
Sourcepub fn add_output_binding(&mut self, slot: u8, size: u32)
pub fn add_output_binding(&mut self, slot: u8, size: u32)
Adds a writable (output) buffer binding on the given slot.
Sourcepub fn total_work_items(&self) -> u64
pub fn total_work_items(&self) -> u64
Total work items = workgroups.x × workgroups.y × workgroups.z.
Sourcepub fn binding_count(&self) -> usize
pub fn binding_count(&self) -> usize
Returns the number of bindings attached to this pass.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ComputePass
impl RefUnwindSafe for ComputePass
impl Send for ComputePass
impl Sync for ComputePass
impl Unpin for ComputePass
impl UnsafeUnpin for ComputePass
impl UnwindSafe for ComputePass
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> 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