pub struct SurfaceCapabilities {
pub formats: Vec<TextureFormat>,
pub format_capabilities: Vec<SurfaceFormatCapabilities>,
pub present_modes: Vec<PresentMode>,
pub alpha_modes: Vec<CompositeAlphaMode>,
pub usages: TextureUsages,
}Expand description
Defines the capabilities of a given surface and adapter.
Fields§
§formats: Vec<TextureFormat>List of supported formats to use with the given adapter. The first format in the vector is preferred.
Only contains formats that can be configured with the default
SurfaceColorSpace::Auto; formats available exclusively in
explicit-opt-in (wide-gamut / HDR) color spaces appear only in
format_capabilities.
Returns an empty vector if the surface is incompatible with the adapter.
format_capabilities: Vec<SurfaceFormatCapabilities>List of supported formats together with the color spaces supported for
each format, in the same preference order as
formats, of which it is a superset.
Returns an empty vector if the surface is incompatible with the adapter.
present_modes: Vec<PresentMode>List of supported presentation modes to use with the given adapter.
Returns an empty vector if the surface is incompatible with the adapter.
alpha_modes: Vec<CompositeAlphaMode>List of supported alpha modes to use with the given adapter.
Will return at least one element, CompositeAlphaMode::Opaque or CompositeAlphaMode::Inherit.
usages: TextureUsagesBitflag of supported texture usages for the surface to use with the given adapter.
The usage TextureUsages::RENDER_ATTACHMENT is guaranteed.
Implementations§
Source§impl SurfaceCapabilities
impl SurfaceCapabilities
Sourcepub fn color_spaces(&self, format: TextureFormat) -> SurfaceColorSpaces
pub fn color_spaces(&self, format: TextureFormat) -> SurfaceColorSpaces
Returns the set of color spaces supported for the given format, or an empty set if the format is not supported.
This is a convenience lookup over
format_capabilities: an empty result
means format is absent from that list.
Trait Implementations§
Source§impl Debug for SurfaceCapabilities
impl Debug for SurfaceCapabilities
Auto Trait Implementations§
impl Freeze for SurfaceCapabilities
impl RefUnwindSafe for SurfaceCapabilities
impl Send for SurfaceCapabilities
impl Sync for SurfaceCapabilities
impl Unpin for SurfaceCapabilities
impl UnsafeUnpin for SurfaceCapabilities
impl UnwindSafe for SurfaceCapabilities
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more