Module features

Module features 

Source
Expand description

Β§Features

Types identifying optional features of WebGPU and wgpu. Availability varies by hardware and can be checked when requesting an adapter and device.

The wgpu Rust API always uses the Features bit flag type to represent a set of features. However, the WebGPU-defined JavaScript API uses kebab-case feature name strings, so some utilities are provided for working with those names. See Features::as_str and [<Features as FromStr>::from_str].

The [bitflags] crate names flags by stringifying the SCREAMING_SNAKE_CASE identifier. These names are returned by Features::iter_names and parsed by Features::from_name. [bitflags] does not currently support customized flag naming. See https://github.com/bitflags/bitflags/issues/470.

Re-exportsΒ§

pub use webgpu_impl::*;

ModulesΒ§

webgpu_impl πŸ”’
Constant values for super::FeaturesWebGPU, separated so they can be picked up by cbindgen in mozilla-central (where Firefox is developed).

MacrosΒ§

bit_array_impl πŸ”’
bitflags_array πŸ”’
Macro for creating sets of bitflags, we need this because there are almost more flags than bits in a u64, we can’t use a u128 because of FFI, and the number of flags is increasing.
bitflags_array_impl πŸ”’
bitflags_array_impl_assign πŸ”’
bitflags_independent_two_arg πŸ”’

StructsΒ§

FeatureBits
Bits from Features in array form
Features
Features that are not guaranteed to be supported.
FeaturesWGPU
Features that are not guaranteed to be supported.
FeaturesWebGPU
Features that are not guaranteed to be supported.