pub unsafe trait PrimaryCommandBufferAbstract: VulkanObject<Handle = CommandBuffer> + DeviceOwned + Send + Sync {
    // Required method
    fn usage(&self) -> CommandBufferUsage;

    // Provided methods
    fn execute(
        self: Arc<Self>,
        queue: Arc<Queue>
    ) -> Result<CommandBufferExecFuture<NowFuture>, CommandBufferExecError>
       where Self: Sized + 'static { ... }
    fn execute_after<F>(
        self: Arc<Self>,
        future: F,
        queue: Arc<Queue>
    ) -> Result<CommandBufferExecFuture<F>, CommandBufferExecError>
       where Self: Sized + 'static,
             F: GpuFuture { ... }
}

Required Methods§

source

fn usage(&self) -> CommandBufferUsage

Returns the usage of this command buffer.

Provided Methods§

source

fn execute( self: Arc<Self>, queue: Arc<Queue> ) -> Result<CommandBufferExecFuture<NowFuture>, CommandBufferExecError>where Self: Sized + 'static,

Executes this command buffer on a queue.

This function returns an object that implements the GpuFuture trait. See the documentation of the future module for more information.

The command buffer is not actually executed until you call flush() on the future. You are encouraged to chain together as many futures as possible prior to calling flush(). In order to know when the future has completed, call one of then_signal_fence() or then_signal_semaphore(). You can do both together with then_signal_fence_and_flush() or then_signal_semaphore_and_flush(), respectively.

Note: In the future this function may return -> impl GpuFuture instead of a concrete type.

Note: This is just a shortcut for execute_after(vulkano::sync::now(), queue).

Panics
  • Panics if the device of the command buffer is not the same as the device of the future.
source

fn execute_after<F>( self: Arc<Self>, future: F, queue: Arc<Queue> ) -> Result<CommandBufferExecFuture<F>, CommandBufferExecError>where Self: Sized + 'static, F: GpuFuture,

Executes the command buffer after an existing future.

This function returns an object that implements the GpuFuture trait. See the documentation of the future module for more information.

The command buffer is not actually executed until you call flush() on the future. You are encouraged to chain together as many futures as possible prior to calling flush(). In order to know when the future has completed, call one of then_signal_fence() or then_signal_semaphore(). You can do both together with then_signal_fence_and_flush() or then_signal_semaphore_and_flush(), respectively.

Note: In the future this function may return -> impl GpuFuture instead of a concrete type.

This function requires the 'static lifetime to be on the command buffer. This is because this function returns a CommandBufferExecFuture whose job is to lock resources and keep them alive while they are in use by the GPU. If 'static wasn’t required, you could call std::mem::forget on that object and “unlock” these resources. For more information about this problem, search the web for “rust thread scoped leakpocalypse”.

Panics
  • Panics if the device of the command buffer is not the same as the device of the future.

Trait Implementations§

source§

impl Debug for dyn PrimaryCommandBufferAbstract

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError>

Formats the value using the given formatter. Read more

Implementors§