Skip to main content

wasdk_wgpu/convert/
mod.rs

1//! Conversions between wgpu's vocabulary and wasi:webgpu's.
2//!
3//! Every conversion is total: a wgpu value without a wasi counterpart panics naming the gap
4//! (the list is in the crate documentation); nothing is silently substituted. The wasi records
5//! spell out every optional member the WebGPU dictionaries default, so the host never fills in
6//! a default wgpu did not ask for.
7
8mod binding;
9mod capabilities;
10mod format;
11mod render;
12mod sampler;
13mod surface;
14
15pub use binding::*;
16pub use capabilities::*;
17pub use format::*;
18pub use render::*;
19pub use sampler::*;
20pub use surface::*;
21
22/// A wgpu label as the WIT carries it.
23pub fn label(label: wgpu::Label<'_>) -> Option<String> {
24    label.map(str::to_owned)
25}