Trait vulkano::command_buffer::CommandBuffer [] [src]

pub unsafe trait CommandBuffer: DeviceOwned {
    type PoolAlloc;
    fn inner(&self) -> &UnsafeCommandBuffer<Self::PoolAlloc>;
    fn prepare_submit(
        &self,
        future: &GpuFuture,
        queue: &Queue
    ) -> Result<(), CommandBufferExecError>; fn check_buffer_access(
        &self,
        buffer: &BufferAccess,
        exclusive: bool,
        queue: &Queue
    ) -> Result<Option<(PipelineStages, AccessFlagBits)>, AccessCheckError>; fn check_image_access(
        &self,
        image: &ImageAccess,
        layout: ImageLayout,
        exclusive: bool,
        queue: &Queue
    ) -> Result<Option<(PipelineStages, AccessFlagBits)>, AccessCheckError>; fn execute(
        self,
        queue: Arc<Queue>
    ) -> Result<CommandBufferExecFuture<NowFuture, Self>, CommandBufferExecError>
    where
        Self: Sized + 'static
, { ... } fn execute_after<F>(
        self,
        future: F,
        queue: Arc<Queue>
    ) -> Result<CommandBufferExecFuture<F, Self>, CommandBufferExecError>
    where
        Self: Sized + 'static,
        F: GpuFuture
, { ... } }

Associated Types

The command pool of the command buffer.

Required Methods

Returns the underlying UnsafeCommandBuffer of this command buffer.

Checks whether this command buffer is allowed to be submitted after the future and on the given queue.

Calling this function means that at some point you will submit the command buffer to the GPU. Once the function has returned Ok, the resources used by the command buffer will likely be in a locked state until the command buffer is destroyed.

You should not call this function directly, otherwise any further attempt to submit will return a runtime error.

Provided Methods

Executes this command buffer on a queue.

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

The command buffer is not actually executed until you call flush() on the object. You are encouraged to chain together as many futures as possible before calling flush(), and call .then_signal_future() before doing so. Note however that once you called execute() there is no way to cancel the execution, even if you didn't flush yet.

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).

Panic

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

Executes the command buffer after an existing future.

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

The command buffer is not actually executed until you call flush() on the object. You are encouraged to chain together as many futures as possible before calling flush(), and call .then_signal_future() before doing so. Note however that once you called execute() there is no way to cancel the execution, even if you didn't flush yet.

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".

Panic

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

Implementors