logo
pub struct UnsafeImageCreateInfo {
Show 14 fields pub dimensions: ImageDimensions, pub format: Option<Format>, pub mip_levels: u32, pub samples: SampleCount, pub tiling: ImageTiling, pub usage: ImageUsage, pub sharing: Sharing<SmallVec<[u32; 4]>>, pub initial_layout: ImageLayout, pub external_memory_handle_types: ExternalMemoryHandleTypes, pub mutable_format: bool, pub cube_compatible: bool, pub array_2d_compatible: bool, pub block_texel_view_compatible: bool, pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new UnsafeImage.

Fields

dimensions: ImageDimensions

The type, extent and number of array layers to create the image with.

The default value is ImageDimensions::Dim2d { width: 0, height: 0, array_layers: 1 }, which must be overridden.

format: Option<Format>

The format used to store the image data.

The default value is None, which must be overridden.

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.

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 ImageUsage::none(), which must be overridden.

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.

external_memory_handle_types: ExternalMemoryHandleTypes

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

If any of the fields in this value are set, the device must either support API version 1.1 or the khr_external_memory extension must be enabled, and initial_layout must be set to ImageLayout::Undefined.

The default value is ExternalMemoryHandleTypes::none().

mutable_format: bool

For non-multi-planar formats, whether an image view wrapping the image can have a different format.

For multi-planar formats, whether an image view wrapping the image can be created from a single plane of the image.

The default value is false.

cube_compatible: bool

For 2D images, whether an image view of type ImageViewType::Cube or ImageViewType::CubeArray can be created from the image.

The default value is false.

array_2d_compatible: bool

For 3D images, whether an image view of type ImageViewType::Dim2d or ImageViewType::Dim2dArray can be created from the image.

The default value is false.

block_texel_view_compatible: bool

For images with a compressed format, whether an image view with an uncompressed format can be created from the image, where each texel in the view will correspond to a compressed texel block in the image.

Requires mutable_format.

The default value is false.

_ne: NonExhaustive

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.