[−][src]Trait gfx_hal::queue::CommandQueue
Abstraction for an internal GPU execution engine.
Commands are executed on the the device by submitting command buffers.
Queues can also be used for presenting to a surface (that is, flip the front buffer with the next one in the chain).
Required methods
unsafe fn submit<'a, T, Ic, S, Iw, Is>(
&mut self,
submission: Submission<Ic, Iw, Is>,
fence: Option<&B::Fence>
) where
T: 'a + Borrow<B::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
S: 'a + Borrow<B::Semaphore>,
Iw: IntoIterator<Item = (&'a S, PipelineStage)>,
Is: IntoIterator<Item = &'a S>,
&mut self,
submission: Submission<Ic, Iw, Is>,
fence: Option<&B::Fence>
) where
T: 'a + Borrow<B::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
S: 'a + Borrow<B::Semaphore>,
Iw: IntoIterator<Item = (&'a S, PipelineStage)>,
Is: IntoIterator<Item = &'a S>,
Submit command buffers to queue for execution.
Arguments
submission
- information about which command buffers to submit, as well as what semaphores to wait for or to signal when done.fence
- must be in unsignaled state, and will be signaled after all command buffers in the submission have finished execution.
Safety
It's not checked that the queue can process the submitted command buffers.
For example, trying to submit compute commands to a graphics queue will result in undefined behavior.
unsafe fn present(
&mut self,
surface: &mut B::Surface,
image: <B::Surface as PresentationSurface<B>>::SwapchainImage,
wait_semaphore: Option<&B::Semaphore>
) -> Result<Option<Suboptimal>, PresentError>
&mut self,
surface: &mut B::Surface,
image: <B::Surface as PresentationSurface<B>>::SwapchainImage,
wait_semaphore: Option<&B::Semaphore>
) -> Result<Option<Suboptimal>, PresentError>
Present a swapchain image directly to a surface, after waiting on wait_semaphore
.
Safety
Unsafe for the same reasons as submit
.
No checks are performed to verify that this queue supports present operations.
fn wait_idle(&self) -> Result<(), OutOfMemory>
Wait for the queue to be idle.
Provided methods
unsafe fn submit_without_semaphores<'a, T, Ic>(
&mut self,
command_buffers: Ic,
fence: Option<&B::Fence>
) where
T: 'a + Borrow<B::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
&mut self,
command_buffers: Ic,
fence: Option<&B::Fence>
) where
T: 'a + Borrow<B::CommandBuffer>,
Ic: IntoIterator<Item = &'a T>,
Simplified version of submit
that doesn't expect any semaphores.