pub trait CommandQueue<B>:
Debug
+ Any
+ Send
+ Syncwhere
B: Backend,{
// Required methods
unsafe fn submit<'a, T, Ic, S, Iw, Is>(
&mut self,
submission: Submission<Ic, Iw, Is>,
fence: Option<&<B as Backend>::Fence>,
)
where T: 'a + Borrow<<B as Backend>::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
S: 'a + Borrow<<B as Backend>::Semaphore>,
Iw: IntoIterator<Item = (&'a S, PipelineStage)>,
Is: IntoIterator<Item = &'a S>;
unsafe fn present<'a, W, Is, S, Iw>(
&mut self,
swapchains: Is,
wait_semaphores: Iw,
) -> Result<Option<Suboptimal>, PresentError>
where Self: Sized,
W: 'a + Borrow<<B as Backend>::Swapchain>,
Is: IntoIterator<Item = (&'a W, u32)>,
S: 'a + Borrow<<B as Backend>::Semaphore>,
Iw: IntoIterator<Item = &'a S>;
unsafe fn present_surface(
&mut self,
surface: &mut <B as Backend>::Surface,
image: <<B as Backend>::Surface as PresentationSurface<B>>::SwapchainImage,
wait_semaphore: Option<&<B as Backend>::Semaphore>,
) -> Result<Option<Suboptimal>, PresentError>;
fn wait_idle(&self) -> Result<(), OutOfMemory>;
// Provided methods
unsafe fn submit_without_semaphores<'a, T, Ic>(
&mut self,
command_buffers: Ic,
fence: Option<&<B as Backend>::Fence>,
)
where T: 'a + Borrow<<B as Backend>::CommandBuffer>,
Ic: IntoIterator<Item = &'a T> { ... }
unsafe fn present_without_semaphores<'a, W, Is>(
&mut self,
swapchains: Is,
) -> Result<Option<Suboptimal>, PresentError>
where Self: Sized,
W: 'a + Borrow<<B as Backend>::Swapchain>,
Is: IntoIterator<Item = (&'a W, u32)> { ... }
}
Expand description
RawCommandQueue
are abstractions to the internal GPU execution engines.
Commands are executed on the the device by submitting command buffers to queues.
Required Methods§
Sourceunsafe fn submit<'a, T, Ic, S, Iw, Is>(
&mut self,
submission: Submission<Ic, Iw, Is>,
fence: Option<&<B as Backend>::Fence>,
)where
T: 'a + Borrow<<B as Backend>::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
S: 'a + Borrow<<B as Backend>::Semaphore>,
Iw: IntoIterator<Item = (&'a S, PipelineStage)>,
Is: IntoIterator<Item = &'a S>,
unsafe fn submit<'a, T, Ic, S, Iw, Is>(
&mut self,
submission: Submission<Ic, Iw, Is>,
fence: Option<&<B as Backend>::Fence>,
)where
T: 'a + Borrow<<B as Backend>::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
S: 'a + Borrow<<B as Backend>::Semaphore>,
Iw: IntoIterator<Item = (&'a S, PipelineStage)>,
Is: IntoIterator<Item = &'a S>,
Submit command buffers to queue for execution.
fence
must be in unsignalled state, and will be signalled after all command buffers in the submission have
finished execution.
Unsafe because it’s not checked that the queue can process the submitted command buffers. Trying to submit compute commands to a graphics queue will result in undefined behavior. Each queue implements safer wrappers according to their supported functionalities!
Sourceunsafe fn present<'a, W, Is, S, Iw>(
&mut self,
swapchains: Is,
wait_semaphores: Iw,
) -> Result<Option<Suboptimal>, PresentError>
unsafe fn present<'a, W, Is, S, Iw>( &mut self, swapchains: Is, wait_semaphores: Iw, ) -> Result<Option<Suboptimal>, PresentError>
Presents the result of the queue to the given swapchains, after waiting on all the
semaphores given in wait_semaphores
. A given swapchain must not appear in this
list more than once.
Unsafe for the same reasons as submit()
.
Sourceunsafe fn present_surface(
&mut self,
surface: &mut <B as Backend>::Surface,
image: <<B as Backend>::Surface as PresentationSurface<B>>::SwapchainImage,
wait_semaphore: Option<&<B as Backend>::Semaphore>,
) -> Result<Option<Suboptimal>, PresentError>
unsafe fn present_surface( &mut self, surface: &mut <B as Backend>::Surface, image: <<B as Backend>::Surface as PresentationSurface<B>>::SwapchainImage, wait_semaphore: Option<&<B as Backend>::Semaphore>, ) -> Result<Option<Suboptimal>, PresentError>
Present the a
Sourcefn wait_idle(&self) -> Result<(), OutOfMemory>
fn wait_idle(&self) -> Result<(), OutOfMemory>
Wait for the queue to idle.
Provided Methods§
Sourceunsafe fn submit_without_semaphores<'a, T, Ic>(
&mut self,
command_buffers: Ic,
fence: Option<&<B as Backend>::Fence>,
)
unsafe fn submit_without_semaphores<'a, T, Ic>( &mut self, command_buffers: Ic, fence: Option<&<B as Backend>::Fence>, )
Simplified version of submit
that doesn’t expect any semaphores.
Sourceunsafe fn present_without_semaphores<'a, W, Is>(
&mut self,
swapchains: Is,
) -> Result<Option<Suboptimal>, PresentError>
unsafe fn present_without_semaphores<'a, W, Is>( &mut self, swapchains: Is, ) -> Result<Option<Suboptimal>, PresentError>
Simplified version of present
that doesn’t expect any semaphores.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.