Struct vulkano::image::attachment::AttachmentImage [] [src]

pub struct AttachmentImage<F, A = Arc<StdMemoryPool>> where A: MemoryPool {
    // some fields omitted
}

Image whose purpose is to be used as a framebuffer attachment.

The image is always two-dimensional and has only one mipmap, but it can have any kind of format. Trying to use a format that the backend doesn't support for rendering will result in an error being returned when creating the image. Once you have an AttachmentImage, you are guaranteed that you will be able to draw on it.

The template parameter of AttachmentImage is a type that describes the format of the image.

Regular vs transient

Calling AttachmentImage::new will create a regular image, while calling AttachmentImage::transient will create a transient image. Transient image are only relevant for images that serve as attachments, so AttachmentImage is the only type of image in vulkano that provides a shortcut for this.

A transient image is a special kind of image whose content is undefined outside of render passes. Once you finish drawing, reading from it will returned undefined data (which can be either valid or garbage, depending on the implementation).

This gives a hint to the Vulkan implementation that it is possible for the image's content to live exclusively in some cache memory, and that no real memory has to be allocated for it.

In other words, if you are going to read from the image after drawing to it, use a regular image. If you don't need to read from it (for example if it's some kind of intermediary color, or a depth buffer that is only used once) then use a transient image as it may improve performances.

Methods

impl<F> AttachmentImage<F>
[src]

Creates a new image with the given dimensions and format.

Returns an error if the dimensions are too large or if the backend doesn't support this format as a framebuffer attachment.

Same as new, except that the image will be transient.

A transient image is special because its content is undefined outside of a render pass. This means that the implementation has the possibility to not allocate any memory for it.

impl<F, A> AttachmentImage<F, A> where A: MemoryPool
[src]

Returns the dimensions of the image.

Trait Implementations

impl<F: Debug, A: Debug> Debug for AttachmentImage<F, A> where A: MemoryPool, A::Alloc: Debug
[src]

Formats the value using the given formatter.

impl<F, A> Image for AttachmentImage<F, A> where F: 'static + Send + Sync, A: MemoryPool
[src]

Returns the inner unsafe image object used by this image.

Given a range, returns the list of blocks which each range is contained in. Read more

Called when a command buffer that uses this image is being built. Given a block, this function should return the layout that the block will have when the command buffer is submitted. Read more

Called when a command buffer that uses this image is being built. Given a block, this function should return the layout that the block must have when the command buffer is end. Read more

Returns whether accessing a subresource of that image should signal a fence.

Returns the format of this image.

Returns the number of samples of this image.

Returns the dimensions of the image.

Returns true if the image can be used as a source for blits.

Returns true if the image can be used as a destination for blits.

impl<F, A> ImageClearValue<F::ClearValue> for AttachmentImage<F, A> where F: FormatDesc + 'static + Send + Sync, A: MemoryPool
[src]

impl<P, F, A> ImageContent<P> for AttachmentImage<F, A> where F: 'static + Send + Sync, A: MemoryPool
[src]

Checks whether pixels of type P match the format of the image.

impl<F, A> ImageView for AttachmentImage<F, A> where F: 'static + Send + Sync, A: MemoryPool
[src]

Returns the blocks of the parent image this image view overlaps.

Returns the inner unsafe image view object used by this image view.

Returns the image layout to use in a descriptor with the given subresource.

Returns the image layout to use in a descriptor with the given subresource.

Returns the image layout to use in a descriptor with the given subresource.

Returns the image layout to use in a descriptor with the given subresource.

Returns true if the view doesn't use components swizzling. Read more

Returns the format of this view. This can be different from the parent's format.

Returns true if the given sampler can be used with this image view. Read more