pub struct ComputeTask {
pub name: String,
pub workgroup_size: [u32; 3],
pub dispatch_count: [u32; 3],
pub dependencies: Vec<String>,
pub priority: TaskPriority,
pub estimated_ms: f64,
}Expand description
A single GPU compute dispatch.
Fields§
§name: StringUnique task name.
workgroup_size: [u32; 3]Workgroup size in (x, y, z).
dispatch_count: [u32; 3]Dispatch count in (x, y, z).
dependencies: Vec<String>Names of tasks that must complete before this one.
priority: TaskPriorityPriority for the scheduler.
estimated_ms: f64Estimated execution time in milliseconds.
Implementations§
Source§impl ComputeTask
impl ComputeTask
Sourcepub fn new_1d(name: impl Into<String>, dispatch_x: u32) -> Self
pub fn new_1d(name: impl Into<String>, dispatch_x: u32) -> Self
Create a simple 1-D compute task.
Sourcepub fn new_2d(name: impl Into<String>, dispatch_x: u32, dispatch_y: u32) -> Self
pub fn new_2d(name: impl Into<String>, dispatch_x: u32, dispatch_y: u32) -> Self
Create a 2-D compute task.
Sourcepub fn total_workgroups(&self) -> u64
pub fn total_workgroups(&self) -> u64
Total number of workgroup invocations.
Sourcepub fn total_invocations(&self) -> u64
pub fn total_invocations(&self) -> u64
Total number of shader invocations.
Sourcepub fn depends_on(self, dep: impl Into<String>) -> Self
pub fn depends_on(self, dep: impl Into<String>) -> Self
Add a dependency by name.
Sourcepub fn with_priority(self, priority: TaskPriority) -> Self
pub fn with_priority(self, priority: TaskPriority) -> Self
Set priority.
Sourcepub fn with_estimated_ms(self, ms: f64) -> Self
pub fn with_estimated_ms(self, ms: f64) -> Self
Set estimated execution time.
Trait Implementations§
Source§impl Clone for ComputeTask
impl Clone for ComputeTask
Source§fn clone(&self) -> ComputeTask
fn clone(&self) -> ComputeTask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComputeTask
impl RefUnwindSafe for ComputeTask
impl Send for ComputeTask
impl Sync for ComputeTask
impl Unpin for ComputeTask
impl UnsafeUnpin for ComputeTask
impl UnwindSafe for ComputeTask
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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