[−][src]Struct vulkano::command_buffer::sys::UnsafeCommandBufferBuilderPipelineBarrier
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.
Implementations
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]
&mut self,
source: PipelineStages,
destination: PipelineStages,
by_region: bool
)
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]
&mut self,
source_stage: PipelineStages,
source_access: AccessFlagBits,
destination_stage: PipelineStages,
destination_access: AccessFlagBits,
by_region: bool
)
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]
&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,
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]
&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,
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 RefUnwindSafe for UnsafeCommandBufferBuilderPipelineBarrier
impl !Send for UnsafeCommandBufferBuilderPipelineBarrier
impl !Sync for UnsafeCommandBufferBuilderPipelineBarrier
impl Unpin for UnsafeCommandBufferBuilderPipelineBarrier
impl UnwindSafe for UnsafeCommandBufferBuilderPipelineBarrier
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Content for T
[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
fn is_size_suitable(usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,