#[non_exhaustive]
pub struct SurfaceCapabilities {
Show 17 fields pub min_image_count: u32, pub max_image_count: Option<u32>, pub current_extent: Option<[u32; 2]>, pub min_image_extent: [u32; 2], pub max_image_extent: [u32; 2], pub max_image_array_layers: u32, pub supported_transforms: SurfaceTransforms, pub current_transform: SurfaceTransform, pub supported_composite_alpha: CompositeAlphas, pub supported_usage_flags: ImageUsage, pub compatible_present_modes: SmallVec<[PresentMode; 4]>, pub supported_present_scaling: PresentScalingFlags, pub supported_present_gravity: [PresentGravityFlags; 2], pub min_scaled_image_extent: Option<[u32; 2]>, pub max_scaled_image_extent: Option<[u32; 2]>, pub supports_protected: bool, pub full_screen_exclusive_supported: bool,
}
Expand description

The capabilities of a surface when used by a physical device.

You have to match these capabilities when you create a swapchain.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§min_image_count: u32

Minimum number of images that must be present in the swapchain.

§max_image_count: Option<u32>

Maximum number of images that must be present in the swapchain, or None if there is no maximum value. Note that “no maximum” doesn’t mean that you can set a very high value, as you may still get out of memory errors.

§current_extent: Option<[u32; 2]>

The current dimensions of the surface.

None means that the surface’s dimensions will depend on the dimensions of the swapchain.

§min_image_extent: [u32; 2]

Minimum width and height of a swapchain that uses this surface.

§max_image_extent: [u32; 2]

Maximum width and height of a swapchain that uses this surface.

§max_image_array_layers: u32

Maximum number of image layers if you create an image array. The minimum is 1.

§supported_transforms: SurfaceTransforms

List of transforms supported for the swapchain.

§current_transform: SurfaceTransform

Current transform used by the surface.

§supported_composite_alpha: CompositeAlphas

List of composite alpha modes supports for the swapchain.

§supported_usage_flags: ImageUsage

List of image usages that are supported for images of the swapchain. Only the color_attachment usage is guaranteed to be supported.

§compatible_present_modes: SmallVec<[PresentMode; 4]>

When SurfaceInfo::present_mode is provided, lists that present mode and any modes that are compatible with that present mode.

If SurfaceInfo::present_mode was not provided, the value will be empty.

§supported_present_scaling: PresentScalingFlags

When SurfaceInfo::present_mode is provided, the supported present scaling modes for the queried present mode.

If SurfaceInfo::present_mode was not provided, the value will be empty.

§supported_present_gravity: [PresentGravityFlags; 2]

When SurfaceInfo::present_mode is provided, the supported present gravity modes, horizontally and vertically, for the queried present mode.

If SurfaceInfo::present_mode was not provided, both values will be empty.

§min_scaled_image_extent: Option<[u32; 2]>

When SurfaceInfo::present_mode is provided, the smallest allowed extent for a swapchain, if it uses the queried present mode, and one of the scaling modes in supported_present_scaling.

This is never greater than SurfaceCapabilities::min_image_extent.

None means that the surface’s dimensions will depend on the dimensions of the swapchain.

If SurfaceInfo::present_mode was not provided, this is will be equal to min_image_extent.

§max_scaled_image_extent: Option<[u32; 2]>

When SurfaceInfo::present_mode is provided, the largest allowed extent for a swapchain, if it uses the queried present mode, and one of the scaling modes in supported_present_scaling.

This is never less than SurfaceCapabilities::max_image_extent.

None means that the surface’s dimensions will depend on the dimensions of the swapchain.

If SurfaceInfo::present_mode was not provided, this is will be equal to max_image_extent.

§supports_protected: bool

Whether creating a protected swapchain is supported.

§full_screen_exclusive_supported: bool

Whether full-screen exclusivity is supported.

Trait Implementations§

source§

impl Clone for SurfaceCapabilities

source§

fn clone(&self) -> SurfaceCapabilities

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SurfaceCapabilities

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.