pub struct ImageBarrier<'a> {
    pub previous_accesses: &'a [AccessType],
    pub next_accesses: &'a [AccessType],
    pub previous_layout: ImageLayout,
    pub next_layout: ImageLayout,
    pub discard_contents: bool,
    pub src_queue_family_index: u32,
    pub dst_queue_family_index: u32,
    pub image: Image,
    pub range: ImageSubresourceRange,
Expand description

Image barriers should only be used when a queue family ownership transfer or an image layout transition is required - prefer global barriers at all other times.

In general it is better to use image barriers with ImageLayout::Optimal than it is to use global barriers with images using either of the ImageLayout::General* layouts.

Access types are defined in the same way as for a global memory barrier, but they only affect the image subresource range identified by image and range, rather than all resources.

src_queue_family_index, dst_queue_family_index, image, and range will be passed unmodified into an image memory barrier.

An image barrier defining a queue ownership transfer needs to be executed twice - once by a queue in the source queue family, and then once again by a queue in the destination queue family, with a semaphore guaranteeing execution order between them.

If discard_contents is set to true, the contents of the image become undefined after the barrier is executed, which can result in a performance boost over attempting to preserve the contents. This is particularly useful for transient images where the contents are going to be immediately overwritten. A good example of when to use this is when an application re-uses a presented image after acquiring the next swap chain image.


previous_accesses: &'a [AccessType]next_accesses: &'a [AccessType]previous_layout: ImageLayoutnext_layout: ImageLayoutdiscard_contents: boolsrc_queue_family_index: u32dst_queue_family_index: u32image: Imagerange: ImageSubresourceRange

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.