Struct vulkano::image::sys::ImageCreateInfo
source · 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:
SubresourceLayout::size
must always be 0.- If
array_layers
is 1, thenSubresourceLayout::array_pitch
must beNone
. - If
image_type
is notImageType::Dim3d
orextent[2]
is 1, thenSubresourceLayout::depth_pitch
must beNone
.
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
impl Clone for ImageCreateInfo
source§fn clone(&self) -> ImageCreateInfo
fn clone(&self) -> ImageCreateInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more