logo
pub struct SwapchainCreateInfo {
Show 14 fields pub min_image_count: u32, pub image_format: Option<Format>, pub image_color_space: ColorSpace, pub image_extent: [u32; 2], pub image_array_layers: u32, pub image_usage: ImageUsage, pub image_sharing: Sharing<SmallVec<[u32; 4]>>, pub pre_transform: SurfaceTransform, pub composite_alpha: CompositeAlpha, pub present_mode: PresentMode, pub clipped: bool, pub full_screen_exclusive: FullScreenExclusive, pub win32_monitor: Option<Win32Monitor>, pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new Swapchain.

Many of the values here must be supported by the physical device. PhysicalDevice has several methods to query what is supported.

Fields

min_image_count: u32

The minimum number of images that will be created.

The implementation is allowed to create more than this number, but never less.

The default value is 2.

image_format: Option<Format>

The format of the created images.

If set to None, Format::R8G8B8A8_UNORM or Format::B8G8R8A8_UNORM will be selected, based on which is supported by the surface.

The default value is None.

image_color_space: ColorSpace

The color space of the created images.

The default value is ColorSpace::SrgbNonLinear.

image_extent: [u32; 2]

The extent of the created images.

If set to None, the value of SurfaceCapabilities::current_extent will be used.

The default value is None.

image_array_layers: u32

The number of array layers of the created images.

The default value is 1.

image_usage: ImageUsage

How the created images will be used.

The default value is ImageUsage::empty(), which must be overridden.

image_sharing: Sharing<SmallVec<[u32; 4]>>

Whether the created images can be shared across multiple queues, or are limited to a single queue.

The default value is Sharing::Exclusive.

pre_transform: SurfaceTransform

The transform that should be applied to an image before it is presented.

The default value is SurfaceTransform::Identity.

composite_alpha: CompositeAlpha

How alpha values of the pixels in the image are to be treated.

The default value is CompositeAlpha::Opaque.

present_mode: PresentMode

How the swapchain should behave when multiple images are waiting in the queue to be presented.

The default is PresentMode::Fifo.

clipped: bool

Whether the implementation is allowed to discard rendering operations that affect regions of the surface which aren’t visible. This is important to take into account if your fragment shader has side-effects or if you want to read back the content of the image afterwards.

The default value is true.

full_screen_exclusive: FullScreenExclusive

How full-screen exclusivity is to be handled.

If set to anything other than FullScreenExclusive::Default, then the ext_full_screen_exclusive extension must be enabled on the device.

The default value is FullScreenExclusive::Default.

win32_monitor: Option<Win32Monitor>

For Win32 surfaces, if full_screen_exclusive is FullScreenExclusive::ApplicationControlled, this specifies the monitor on which full-screen exclusivity should be used.

For this case, the value must be Some, and for all others it must be None.

The default value is None.

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