Struct vulkano::swapchain::SwapchainCreateInfo
source · pub struct SwapchainCreateInfo {Show 19 fields
pub flags: SwapchainCreateFlags,
pub min_image_count: u32,
pub image_format: Format,
pub image_view_formats: Vec<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 present_modes: SmallVec<[PresentMode; 4]>,
pub clipped: bool,
pub scaling_behavior: Option<PresentScaling>,
pub present_gravity: Option<[PresentGravity; 2]>,
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§
§flags: SwapchainCreateFlags
Additional properties of the swapchain.
The default value is empty.
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: Format
The format of the created images.
The default value is Format::UNDEFINED
.
image_view_formats: Vec<Format>
The formats that an image view can have when it is created from one of the swapchain images.
If the list is not empty, and flags
does not contain
SwapchainCreateFlags::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
contains SwapchainCreateFlags::MUTABLE_FORMAT
, then the list must contain
`image_format.
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.
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.
Both values must be greater than zero. Note that on some platforms,
SurfaceCapabilities::current_extent
will be zero if the surface is minimized.
Care must be taken to check for this, to avoid trying to create a zero-size swapchain.
The default value is [0, 0]
, which must be overridden.
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 value is PresentMode::Fifo
.
present_modes: SmallVec<[PresentMode; 4]>
Alternative present modes that can be used with this swapchain. The mode specified in
present_mode
is the default mode, but can be changed for future present operations by
specifying it when presenting.
If this is not empty, then the
ext_swapchain_maintenance1
extension must be enabled on the device.
It must always contain the mode specified in present_mode
.
The default value is empty.
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
.
scaling_behavior: Option<PresentScaling>
The scaling method to use when the surface is not the same size as the swapchain image.
None
means the behavior is implementation defined.
If this is Some
, then the
ext_swapchain_maintenance1
extension must be enabled on the device.
The default value is None
.
present_gravity: Option<[PresentGravity; 2]>
The horizontal and vertical alignment to use when the swapchain image, after applying scaling, does not fill the whole surface.
None
means the behavior is implementation defined.
If this is Some
, then the
ext_swapchain_maintenance1
extension must be enabled on the device.
The default value is None
.
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§
source§impl Clone for SwapchainCreateInfo
impl Clone for SwapchainCreateInfo
source§fn clone(&self) -> SwapchainCreateInfo
fn clone(&self) -> SwapchainCreateInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more