macro_rules! features {
(
$(#[$outer:meta])*
pub struct ($name:ident, $name_bits:ident): [$T:ty; $Len:expr];
$(
$(#[$bit_outer:meta])*
$vis:vis struct $inner_name:ident $lower_inner_name:ident {
$(
$(#[doc $($args:tt)*])*
#[name($str_name:literal $(, $alias:literal)*)]
$(#[web($web:tt)])?
const $Flag:tt = $value:expr;
)*
}
)*
) => { ... };
}Expand description
Defines the feature bitflags, using bitflags_array for storage.
On top of what bitflags_array! accepts, each flag carries feature-specific attributes,
written after its doc comments. These are consumed here rather than passed on to
bitflags_array!. Adding another one means adding a matcher for it, in a fixed position
relative to the existing ones, and generating whatever it should produce.
#[name("kebab-case-name", "alias", ...)] gives the names that the WebGPU API uses for
the feature: the name from the spec, for features in FeaturesWebGPU, and otherwise a
wgpu- prefixed name. It is required on every feature.
#[web(allow)] or #[web(ignore)] controls whether wgpu’s WebGPU backend will
offer the feature when the underlying WebGPU implementation does. Typically should be
allow, but ignore may be appropriate in cases where missing logic in the WebGPU
backend means the feature will not work via wgpu even though it is supported by the
underlying backend, or where there is concern about interactions or confusion with
wgpu native features having subtly different API or behavior.