Skip to main content

pick_present_mode

Function pick_present_mode 

Source
pub fn pick_present_mode(
    supported: &[PresentMode],
    requested: PresentMode,
) -> PresentMode
Expand description

Pick the present mode to configure the swap chain with.

wgpu resolves the Auto* modes itself against whatever the surface supports, so they are always safe to request. An explicit mode that the surface does not list (Mailbox on a driver that lacks it, Immediate under a compositor that forces vsync) is a validation error, so it falls back to Fifo — the one mode the spec guarantees every surface supports.

Pure so the fallback is testable without a live surface.