[−][src]Trait web_glitz::task::GpuTask
Trait for types that represent a computational task is to be partly or completely executed on a GPU.
A GpuTask implementation is associated with a specific execution context type Ec
(e.g. the
base Connection, a RenderPassContext, or a PipelineTaskContext). A task executor
associated with that context may attempt to make progress on the task by calling
GpuTask::progress and providing an exclusive reference to an instance of that context, but
only if this context instance is compatible with GpuTask::context_id.
Unsafe
If a context instance is compatible with GpuTask::context_id, then invoking GpuTask::progress with this instance must not result in undefined behaviour.
Associated Types
type Output
The type of output that results from this task finishing.
Required methods
fn context_id(&self) -> ContextId
Identifies the context(s) a GpuTask may be used with.
If the GpuTask may be used with any context, then GpuTask::context_id should return
ContextId::Any
; if it may only be used with one specific context instance, then it should
return ContextId::Id(context_id)
, where context_id
is the ID associated with the context
(see [RenderingContext::id]).
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
Attempts to progress this GpuTask towards its finished state using the given [execution_context].
If this call to GpuTask::progress resulted in the task finishing, then it should return
Progress::Finished(output)
, where output
is the task's output. The task executor should
then drop this GpuTask; it should never call this method again.
Otherwise, GpuTask::progress may return Progress::ContinueFenced
. In this case the task
executor will insert a GPU fence into the command stream. It will call this method again
once that fence has become signalled.
Implementations on Foreign Types
impl<T: ?Sized, Ec> GpuTask<Ec> for Box<T> where
T: GpuTask<Ec>,
[src]
T: GpuTask<Ec>,
type Output = T::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
Implementors
impl GpuTask<RenderPassContext> for BlitCommand
[src]
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(
&mut self,
context: &mut RenderPassContext
) -> Progress<Self::Output>
[src]
&mut self,
context: &mut RenderPassContext
) -> Progress<Self::Output>
impl GpuTask<Connection> for web_glitz::image::texture_2d::GenerateMipmapCommand
[src]
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl GpuTask<Connection> for web_glitz::image::texture_2d_array::GenerateMipmapCommand
[src]
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl GpuTask<Connection> for web_glitz::image::texture_3d::GenerateMipmapCommand
[src]
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl GpuTask<Connection> for web_glitz::image::texture_cube::GenerateMipmapCommand
[src]
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<A, B, C, D, E, Ec> GpuTask<Ec> for Join5<A, B, C, D, E, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
type Output = (A::Output, B::Output, C::Output, D::Output, E::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, E, Ec> GpuTask<Ec> for Join5Left<A, B, C, D, E, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, E, Ec> GpuTask<Ec> for Join5Right<A, B, C, D, E, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
type Output = E::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, E, Ec> GpuTask<Ec> for Sequence5<A, B, C, D, E, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
type Output = (A::Output, B::Output, C::Output, D::Output, E::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, E, Ec> GpuTask<Ec> for Sequence5Left<A, B, C, D, E, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, E, Ec> GpuTask<Ec> for Sequence5Right<A, B, C, D, E, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
E: GpuTask<Ec>,
type Output = E::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, Ec> GpuTask<Ec> for Join4<A, B, C, D, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
type Output = (A::Output, B::Output, C::Output, D::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, Ec> GpuTask<Ec> for Join4Left<A, B, C, D, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, Ec> GpuTask<Ec> for Join4Right<A, B, C, D, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
type Output = D::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, Ec> GpuTask<Ec> for Sequence4<A, B, C, D, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
type Output = (A::Output, B::Output, C::Output, D::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, Ec> GpuTask<Ec> for Sequence4Left<A, B, C, D, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, D, Ec> GpuTask<Ec> for Sequence4Right<A, B, C, D, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
D: GpuTask<Ec>,
type Output = D::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, Ec> GpuTask<Ec> for Join3<A, B, C, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
type Output = (A::Output, B::Output, C::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, Ec> GpuTask<Ec> for Join3Left<A, B, C, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, Ec> GpuTask<Ec> for Join3Right<A, B, C, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
type Output = C::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, Ec> GpuTask<Ec> for Sequence3<A, B, C, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
type Output = (A::Output, B::Output, C::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, Ec> GpuTask<Ec> for Sequence3Left<A, B, C, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, C, Ec> GpuTask<Ec> for Sequence3Right<A, B, C, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
C: GpuTask<Ec>,
type Output = C::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, Ec> GpuTask<Ec> for Join<A, B, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
type Output = (A::Output, B::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, Ec> GpuTask<Ec> for JoinLeft<A, B, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, Ec> GpuTask<Ec> for JoinRight<A, B, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
type Output = B::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, Ec> GpuTask<Ec> for Sequence<A, B, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
type Output = (A::Output, B::Output)
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, Ec> GpuTask<Ec> for SequenceLeft<A, B, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
type Output = A::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<A, B, Ec> GpuTask<Ec> for SequenceRight<A, B, Ec> where
A: GpuTask<Ec>,
B: GpuTask<Ec>,
[src]
A: GpuTask<Ec>,
B: GpuTask<Ec>,
type Output = B::Output
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<D, T, F> GpuTask<Connection> for web_glitz::image::texture_2d::UploadCommand<D, T, F> where
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
[src]
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<D, T, F> GpuTask<Connection> for web_glitz::image::texture_2d_array::LevelLayerUploadCommand<D, T, F> where
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
[src]
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<D, T, F> GpuTask<Connection> for web_glitz::image::texture_2d_array::LevelUploadCommand<D, T, F> where
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
[src]
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<D, T, F> GpuTask<Connection> for web_glitz::image::texture_3d::LevelLayerUploadCommand<D, T, F> where
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
[src]
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<D, T, F> GpuTask<Connection> for web_glitz::image::texture_3d::LevelUploadCommand<D, T, F> where
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
[src]
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<D, T, F> GpuTask<Connection> for web_glitz::image::texture_cube::UploadCommand<D, T, F> where
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
[src]
D: Borrow<[T]>,
T: PixelUnpack<F>,
F: TextureFormat,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<Ec> GpuTask<Ec> for Empty
[src]
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, _execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<Ec, T> GpuTask<Ec> for OptionTask<T> where
T: GpuTask<Ec>,
[src]
T: GpuTask<Ec>,
type Output = Option<T::Output>
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<Ec, T, F, U> GpuTask<Ec> for Map<T, F> where
T: GpuTask<Ec>,
F: FnOnce(T::Output) -> U,
[src]
T: GpuTask<Ec>,
F: FnOnce(T::Output) -> U,
type Output = U
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<F, P> GpuTask<Connection> for PackToBufferCommand<F, P> where
F: TextureFormat,
P: PixelPack<F>,
[src]
F: TextureFormat,
P: PixelPack<F>,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, context: &mut Connection) -> Progress<Self::Output>
[src]
impl<T> GpuTask<Connection> for DownloadCommand<[T]>
[src]
type Output = Box<[T]>
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<T> GpuTask<Connection> for DownloadCommand<T>
[src]
type Output = Box<T>
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<T, D> GpuTask<Connection> for web_glitz::buffer::UploadCommand<[T], D> where
D: Borrow<[T]>,
[src]
D: Borrow<[T]>,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<T, D> GpuTask<Connection> for web_glitz::buffer::UploadCommand<T, D> where
D: Borrow<T>,
[src]
D: Borrow<T>,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, connection: &mut Connection) -> Progress<Self::Output>
[src]
impl<T, Ec> GpuTask<Ec> for JoinIter<T, Ec> where
T: GpuTask<Ec, Output = ()>,
[src]
T: GpuTask<Ec, Output = ()>,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<T, Ec> GpuTask<Ec> for SequenceIter<T, Ec> where
T: GpuTask<Ec, Output = ()>,
[src]
T: GpuTask<Ec, Output = ()>,
type Output = ()
fn context_id(&self) -> ContextId
[src]
fn progress(&mut self, execution_context: &mut Ec) -> Progress<Self::Output>
[src]
impl<T, O> GpuTask<Connection> for RenderPass<T> where
T: GpuTask<RenderPassContext, Output = O>,
[src]
T: GpuTask<RenderPassContext, Output = O>,