wgpu_examples::utils

Function get_adapter_with_capabilities_or_from_env

Source
pub(crate) async fn get_adapter_with_capabilities_or_from_env(
    instance: &Instance,
    required_features: &Features,
    required_downlevel_capabilities: &DownlevelCapabilities,
    surface: &Option<&Surface<'_>>,
) -> Adapter
Expand description

If the environment variable WGPU_ADAPTER_NAME is set, this function will attempt to initialize the adapter with that name. If it is not set, it will attempt to initialize the adapter which supports the required features.