[][src]Struct vulkano::command_buffer::sys::UnsafeCommandBufferBuilderPipelineBarrier

pub struct UnsafeCommandBufferBuilderPipelineBarrier { /* fields omitted */ }

Command that adds a pipeline barrier to a command buffer builder.

A pipeline barrier is a low-level system-ish command that is often necessary for safety. By default all commands that you add to a command buffer can potentially run simultaneously. Adding a pipeline barrier separates commands before the barrier from commands after the barrier and prevents them from running simultaneously.

Please take a look at the Vulkan specifications for more information. Pipeline barriers are a complex topic and explaining them in this documentation would be redundant.

Note: We use a builder-like API here so that users can pass multiple buffers or images of multiple different types. Doing so with a single function would be very tedious in terms of API.

Methods

impl UnsafeCommandBufferBuilderPipelineBarrier[src]

pub fn new() -> UnsafeCommandBufferBuilderPipelineBarrier[src]

Creates a new empty pipeline barrier command.

pub fn is_empty(&self) -> bool[src]

Returns true if no barrier or execution dependency has been added yet.

pub fn merge(&mut self, other: UnsafeCommandBufferBuilderPipelineBarrier)[src]

Merges another pipeline builder into this one.

pub unsafe fn add_execution_dependency(
    &mut self,
    source: PipelineStages,
    destination: PipelineStages,
    by_region: bool
)
[src]

Adds an execution dependency. This means that all the stages in source of the previous commands must finish before any of the stages in destination of the following commands can start.

Safety

  • If the pipeline stages include geometry or tessellation stages, then the corresponding features must have been enabled in the device.
  • There are certain rules regarding the pipeline barriers inside render passes.

pub unsafe fn add_memory_barrier(
    &mut self,
    source_stage: PipelineStages,
    source_access: AccessFlagBits,
    destination_stage: PipelineStages,
    destination_access: AccessFlagBits,
    by_region: bool
)
[src]

Adds a memory barrier. This means that all the memory writes by the given source stages for the given source accesses must be visible by the given destination stages for the given destination accesses.

Also adds an execution dependency similar to add_execution_dependency.

Safety

  • Same as add_execution_dependency.

pub unsafe fn add_buffer_memory_barrier<B: ?Sized>(
    &mut self,
    buffer: &B,
    source_stage: PipelineStages,
    source_access: AccessFlagBits,
    destination_stage: PipelineStages,
    destination_access: AccessFlagBits,
    by_region: bool,
    queue_transfer: Option<(u32, u32)>,
    offset: usize,
    size: usize
) where
    B: BufferAccess
[src]

Adds a buffer memory barrier. This means that all the memory writes to the given buffer by the given source stages for the given source accesses must be visible by the given dest stages for the given destination accesses.

Also adds an execution dependency similar to add_execution_dependency.

Also allows transferring buffer ownership between queues.

Safety

  • Same as add_execution_dependency.
  • The buffer must be alive for at least as long as the command buffer to which this barrier is added.
  • Queue ownership transfers must be correct.

pub unsafe fn add_image_memory_barrier<I: ?Sized>(
    &mut self,
    image: &I,
    mipmaps: Range<u32>,
    layers: Range<u32>,
    source_stage: PipelineStages,
    source_access: AccessFlagBits,
    destination_stage: PipelineStages,
    destination_access: AccessFlagBits,
    by_region: bool,
    queue_transfer: Option<(u32, u32)>,
    current_layout: ImageLayout,
    new_layout: ImageLayout
) where
    I: ImageAccess
[src]

Adds an image memory barrier. This is the equivalent of add_buffer_memory_barrier but for images.

In addition to transferring image ownership between queues, it also allows changing the layout of images.

Also adds an execution dependency similar to add_execution_dependency.

Safety

  • Same as add_execution_dependency.
  • The buffer must be alive for at least as long as the command buffer to which this barrier is added.
  • Queue ownership transfers must be correct.
  • Image layouts transfers must be correct.
  • Access flags must be compatible with the image usage flags passed at image creation.

Auto Trait Implementations

impl !Send for UnsafeCommandBufferBuilderPipelineBarrier

impl Unpin for UnsafeCommandBufferBuilderPipelineBarrier

impl !Sync for UnsafeCommandBufferBuilderPipelineBarrier

impl UnwindSafe for UnsafeCommandBufferBuilderPipelineBarrier

impl RefUnwindSafe for UnsafeCommandBufferBuilderPipelineBarrier

Blanket Implementations

impl<T> Content for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]