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
TODO
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, images that have memory bound to them are represented by Image
. You
can create an Image
directly by providing a memory allocator and all the info for the image
and allocation you want to create. This should satisify most use cases. The more low-level use
cases such as importing memory for the image are described below.
You can create an ImageView
from any Image
.
Low-level information
RawImage
is the low-level wrapper around a VkImage
, which has no memory bound to it. You
can create a RawImage
similarly to Image
except that you don’t provide any info about the
allocation. That way, you can bind memory to it however you wish, including:
- Binding
DeviceMemory
you allocated yourself, for instance with specific export handle types. - Binding imported
DeviceMemory
.
You can create a ResourceMemory
from DeviceMemory
if you want to bind its own block of
memory to an image.
Re-exports
pub use self::sys::ImageCreateInfo;
Modules
- How to retrieve data from a sampled image within a shader.
- Low-level implementation of images.
- Image views.
Structs
- A multi-dimensioned storage for texel data.
- A set of
ImageAspect
values. - Flags specifying additional properties of an image.
- The image’s DRM format modifier configuration to query in
PhysicalDevice::image_format_properties
. - The image configuration to query in
PhysicalDevice::image_format_properties
. - The properties that are supported by a physical device for images of a certain type.
- One or more subresources of an image, spanning a single mip level, that should be accessed by a command.
- One or more subresources of an image that should be accessed by a command.
- Describes how an image is going to be used. This is not just an optimization.
- A set of
SampleCount
values. - Flags specifying information about a sparse resource.
- The image configuration to query in
PhysicalDevice::sparse_image_format_properties
. - The properties that are supported by a physical device for sparse images of a certain type.
- Requirements for binding memory to a sparse image.
- Describes the memory layout of a single subresource of an image.
Enums
- Error that can happen when allocating a new image.
- An individual data type within an image.
- In-memory layout of the pixel data of an image.
- The type of backing memory that an image can have.
- The arrangement of texels or texel blocks in an image.
- The basic dimensionality of an image.
- The number of samples per texel of an image.
Functions
- Returns the maximum number of mipmap levels for the given image extent.
- Returns the extent of the
level
th mipmap level. Iflevel
is 0, then it returnsextent
back unchanged.