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.