logo
pub struct ImageViewCreateInfo {
    pub view_type: ImageViewType,
    pub format: Option<Format>,
    pub component_mapping: ComponentMapping,
    pub aspects: ImageAspects,
    pub array_layers: Range<u32>,
    pub mip_levels: Range<u32>,
    pub sampler_ycbcr_conversion: Option<Arc<SamplerYcbcrConversion>>,
    pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new ImageView.

Fields

view_type: ImageViewType

The image view type.

The view type must be compatible with the dimensions of the image and the selected array layers.

The default value is ImageViewType::Dim2d.

format: Option<Format>

The format of the image view.

If this is set to a format that is different from the image, the image must be created with the mutable_format flag.

The default value is None, which must be overridden.

component_mapping: ComponentMapping

How to map components of each pixel.

The default value is ComponentMapping::identity().

aspects: ImageAspects

The aspects of the image that the view should cover.

The default value is ImageAspects::none(), which must be overridden.

array_layers: Range<u32>

The range of array layers of the image that the view should cover.

The default value is 0..1.

mip_levels: Range<u32>

The range of mipmap levels of the image that the view should cover.

The default value is 0..1.

sampler_ycbcr_conversion: Option<Arc<SamplerYcbcrConversion>>

The sampler YCbCr conversion to be used with the image view.

If set to Some, several restrictions apply:

  • The component_mapping must be the identity swizzle for all components.
  • If the image view is to be used in a shader, it must be in a combined image sampler descriptor, a separate sampled image descriptor is not allowed.
  • The corresponding sampler must have the same sampler YCbCr object or an identically created one, and must be used as an immutable sampler within a descriptor set layout.

The default value is None.

_ne: NonExhaustive

Implementations

Returns an ImageViewCreateInfo with the view_type determined from the image type and array layers, aspects determined from the image format, and array_layers and mip_levels covering the whole image.

Trait Implementations

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 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.