pub struct ImageCreateInfo {
Show 17 fields pub flags: ImageCreateFlags, pub image_type: ImageType, pub format: Format, pub view_formats: Vec<Format>, pub extent: [u32; 3], pub array_layers: u32, pub mip_levels: u32, pub samples: SampleCount, pub tiling: ImageTiling, pub usage: ImageUsage, pub stencil_usage: Option<ImageUsage>, pub sharing: Sharing<SmallVec<[u32; 4]>>, pub initial_layout: ImageLayout, pub drm_format_modifiers: Vec<u64>, pub drm_format_modifier_plane_layouts: Vec<SubresourceLayout>, pub external_memory_handle_types: ExternalMemoryHandleTypes, pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new Image.

Fields§

§flags: ImageCreateFlags

Additional properties of the image.

The default value is empty.

§image_type: ImageType

The basic image dimensionality to create the image with.

The default value is ImageType::Dim2d.

§format: Format

The format used to store the image data.

The default value is Format::UNDEFINED.

§view_formats: Vec<Format>

The formats that an image view can have when it is created from this image.

If the list is not empty, and flags does not contain ImageCreateFlags::MUTABLE_FORMAT, then the list must contain at most one element, otherwise any number of elements are allowed. The view formats must be compatible with format. If flags also contains ImageCreateFlags::BLOCK_TEXEL_VIEW_COMPATIBLE, then the view formats can also be uncompressed formats that are merely size-compatible with format.

If the list is empty, then depending on flags, a view must have the same format as format, can have any compatible format, or additionally any uncompressed size-compatible format. However, this is less efficient than specifying the possible view formats in advance.

If this is not empty, then the device API version must be at least 1.2, or the khr_image_format_list extension must be enabled on the device.

The default value is empty.

§extent: [u32; 3]

The width, height and depth of the image.

If image_type is ImageType::Dim2d, then the depth must be 1. If image_type is ImageType::Dim1d, then the height and depth must be 1.

The default value is [0; 3], which must be overridden.

§array_layers: u32

The number of array layers to create the image with.

On portability subset devices, if samples is not SampleCount::Sample1 and array_layers is not 1, the multisample_array_image feature must be enabled on the device.

The default value is 1.

§mip_levels: u32

The number of mip levels to create the image with.

The default value is 1.

§samples: SampleCount

The number of samples per texel that the image should use.

On portability subset devices, if samples is not SampleCount::Sample1 and array_layers is not 1, the multisample_array_image feature must be enabled on the device.

The default value is SampleCount::Sample1.

§tiling: ImageTiling

The memory arrangement of the texel blocks.

The default value is ImageTiling::Optimal.

§usage: ImageUsage

How the image is going to be used.

The default value is empty, which must be overridden.

§stencil_usage: Option<ImageUsage>

How the stencil aspect of the image is going to be used, if different from the regular usage.

If this is Some, then the device API version must be at least 1.2, or the ext_separate_stencil_usage extension must be enabled on the device. format must a stencil aspect.

The default value is None.

§sharing: Sharing<SmallVec<[u32; 4]>>

Whether the image can be shared across multiple queues, or is limited to a single queue.

The default value is Sharing::Exclusive.

§initial_layout: ImageLayout

The image layout that the image will have when it is created.

The default value is ImageLayout::Undefined.

§drm_format_modifiers: Vec<u64>

The Linux DRM format modifiers that the image should be created with.

If this is not empty, then the ext_image_drm_format_modifier extension must be enabled on the device.

The default value is empty.

§drm_format_modifier_plane_layouts: Vec<SubresourceLayout>

If drm_format_modifiers contains one element, provides the subresource layouts of each memory plane of the image. The number of elements must equal DrmFormatModifierProperties::drm_format_modifier_plane_count, and the following additional requirements apply to each element:

If drm_format_modifiers does not contain one element, then this must be empty.

The default value is empty.

§external_memory_handle_types: ExternalMemoryHandleTypes

The external memory handle types that are going to be used with the image.

If this is not empty, then the device API version must be at least 1.1, or the khr_external_memory extension must be enabled on the device. initial_layout must be set to ImageLayout::Undefined.

The default value is empty.

§_ne: NonExhaustive

Trait Implementations§

source§

impl Clone for ImageCreateInfo

source§

fn clone(&self) -> ImageCreateInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ImageCreateInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ImageCreateInfo

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.