Module vulkano::image [−][src]
Expand description
Image storage (1D, 2D, 3D, arrays, etc.) and image views.
An image is a region of memory whose purpose is to store multi-dimensional data. Its most common use is to store a 2D array of color pixels (in other words an image in everyday language), but it can also be used to store arbitrary data.
The advantage of using an image compared to a buffer is that the memory layout is optimized for locality. When reading a specific pixel of an image, reading the nearby pixels is really fast. Most implementations have hardware dedicated to reading from images if you access them through a sampler.
Properties of an image
Images and image views
There is a distinction between images and image views. As its name suggests, an image view describes how the GPU must interpret the image.
Transfer and memory operations operate on images themselves, while reading/writing an image operates on image views. You can create multiple image views from the same image.
High-level wrappers
In the vulkano library, an image is any object that implements the ImageAccess
trait. You
can create a view by wrapping them in an ImageView
.
Since the ImageAccess
trait is low-level, you are encouraged to not implement it yourself but
instead use one of the provided implementations that are specialized depending on the way you
are going to use the image:
- An
AttachmentImage
can be used when you want to draw to an image. - An
ImmutableImage
stores data which never need be changed after the initial upload, like a texture.
Low-level information
To be written.
Re-exports
pub use self::attachment::AttachmentImage;
pub use self::immutable::ImmutableImage;
pub use self::swapchain::SwapchainImage;
pub use self::sys::ImageCreationError;
pub use self::traits::ImageAccess;
pub use self::traits::ImageInner;
pub use self::view::ImageViewAbstract;
Modules
Structs
A mask specifying one or more ImageAspect
s.
Flags that can be set when creating a new image.
The set of layouts to use for an image when used in descriptor of various kinds.
Helper type returned from Device’s fn image_format_properties()
Describes how an image is going to be used. This is not just an optimization.
Specifies how many sample counts supported for an image used for storage operations.
General-purpose image in device memory. Can be used for any usage, but will be slower than a specialized image.
Enums
Helper type for creating extents
An individual data type within an image.
The dimensions of an image.
Layout of an image.
Specifies how many mipmaps must be allocated.