Type Alias nannou::wgpu::SurfaceConfiguration
source · pub type SurfaceConfiguration = SurfaceConfiguration<Vec<TextureFormat>>;Expand description
Aliased Type§
struct SurfaceConfiguration {
pub usage: TextureUsages,
pub format: TextureFormat,
pub width: u32,
pub height: u32,
pub present_mode: PresentMode,
pub alpha_mode: CompositeAlphaMode,
pub view_formats: Vec<TextureFormat>,
}Fields§
§usage: TextureUsagesThe usage of the swap chain. The only supported usage is RENDER_ATTACHMENT.
format: TextureFormatThe texture format of the swap chain. The only formats that are guaranteed are
Bgra8Unorm and Bgra8UnormSrgb
width: u32Width of the swap chain. Must be the same size as the surface.
height: u32Height of the swap chain. Must be the same size as the surface.
present_mode: PresentModePresentation mode of the swap chain. Fifo is the only mode guaranteed to be supported. FifoRelaxed, Immediate, and Mailbox will crash if unsupported, while AutoVsync and AutoNoVsync will gracefully do a designed sets of fallbacks if their primary modes are unsupported.
alpha_mode: CompositeAlphaModeSpecifies how the alpha channel of the textures should be handled during compositing.
view_formats: Vec<TextureFormat>Specifies what view formats will be allowed when calling create_view() on texture returned by get_current_texture().
View formats of the same format as the texture are always allowed.
Note: currently, only the srgb-ness is allowed to change. (ex: Rgba8Unorm texture + Rgba8UnormSrgb view)