pub struct AsyncComputeQueue { /* private fields */ }Expand description
Queue that manages overlapping compute and render work.
Submit compute jobs which are dispatched in order. Fences are inserted after each job so that subsequent render work can wait for completion.
Implementations§
Source§impl AsyncComputeQueue
impl AsyncComputeQueue
Sourcepub fn submit(
&mut self,
program_key: u64,
dimension: DispatchDimension,
uniforms: Vec<UniformValue>,
barrier: MemoryBarrierFlags,
) -> u64
pub fn submit( &mut self, program_key: u64, dimension: DispatchDimension, uniforms: Vec<UniformValue>, barrier: MemoryBarrierFlags, ) -> u64
Submit a compute job. Returns a job ID for tracking.
Sourcepub fn flush(&mut self, gl: &Context, cache: &PipelineCache)
pub fn flush(&mut self, gl: &Context, cache: &PipelineCache)
Flush: dispatch all pending jobs up to max_in_flight.
Sourcepub fn drain_completed(&mut self) -> Vec<u64>
pub fn drain_completed(&mut self) -> Vec<u64>
Remove and return all completed job IDs.
Sourcepub fn is_complete(&self, job_id: u64) -> bool
pub fn is_complete(&self, job_id: u64) -> bool
Check if a specific job is complete.
Sourcepub fn wait_for(&mut self, gl: &Context, job_id: u64, timeout: Duration) -> bool
pub fn wait_for(&mut self, gl: &Context, job_id: u64, timeout: Duration) -> bool
Wait for a specific job to complete.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of pending (not yet dispatched) jobs.
Sourcepub fn in_flight_count(&self) -> usize
pub fn in_flight_count(&self) -> usize
Number of in-flight (dispatched but not completed) jobs.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total number of jobs in the queue.
Auto Trait Implementations§
impl Freeze for AsyncComputeQueue
impl RefUnwindSafe for AsyncComputeQueue
impl !Send for AsyncComputeQueue
impl !Sync for AsyncComputeQueue
impl Unpin for AsyncComputeQueue
impl UnsafeUnpin for AsyncComputeQueue
impl UnwindSafe for AsyncComputeQueue
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.