pub struct DispatchConfig<'a> {
pub shader: &'a str,
pub entry_point: Option<&'a str>,
pub workgroups: Option<[u32; 3]>,
pub invocations: u32,
pub push_constants: Option<&'a [u8]>,
}Expand description
Configuration for a compute dispatch.
The simple path (Device::dispatch) covers most cases.
Use DispatchConfig when you need control over workgroup sizes
or push constants.
Fields§
§shader: &'a strShader source (WGSL).
entry_point: Option<&'a str>Entry point name. Defaults to "main" if None.
workgroups: Option<[u32; 3]>Workgroup dimensions [x, y, z].
If None, the crate auto-calculates from invocations and the
shader’s declared @workgroup_size.
invocations: u32Total invocations requested. Used to auto-calculate workgroup
dispatch count when workgroups is None.
push_constants: Option<&'a [u8]>Optional push constant data (raw bytes, must match shader layout).
Implementations§
Source§impl<'a> DispatchConfig<'a>
impl<'a> DispatchConfig<'a>
Sourcepub const fn entry_point(self, name: &'a str) -> Self
pub const fn entry_point(self, name: &'a str) -> Self
Override the entry point name (default: "main").
Sourcepub const fn workgroups(self, dims: [u32; 3]) -> Self
pub const fn workgroups(self, dims: [u32; 3]) -> Self
Set explicit workgroup dispatch dimensions.
Sourcepub const fn push_constants(self, data: &'a [u8]) -> Self
pub const fn push_constants(self, data: &'a [u8]) -> Self
Attach push constant data.
Auto Trait Implementations§
impl<'a> Freeze for DispatchConfig<'a>
impl<'a> RefUnwindSafe for DispatchConfig<'a>
impl<'a> Send for DispatchConfig<'a>
impl<'a> Sync for DispatchConfig<'a>
impl<'a> Unpin for DispatchConfig<'a>
impl<'a> UnsafeUnpin for DispatchConfig<'a>
impl<'a> UnwindSafe for DispatchConfig<'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