Skip to main content

mln_webgpu/
lib.rs

1//! Ports the C++ WebGPU backend (`src/mln/webgpu`, `include/mln/webgpu`,
2//! `include/mln/shaders/webgpu`, `src/mln/shaders/webgpu`, and the headless
3//! backend from platform/default) onto the `wgpu` crate.
4//!
5//! A [`RendererBackend`] renders on a [`Device`], into an [`OffscreenTarget`]
6//! or a [`SurfaceTarget`] built on it.
7//!
8//! The C++ backend runs on Dawn or wgpu-native through the WebGPU C API; this
9//! port makes the same calls through wgpu's Rust API. Raw `WGPU*` handles
10//! become wgpu objects (reference counted, so "release" is a drop), and the
11//! `Context&` members of resources become `Rc<Context>`.
12//!
13//! The WGSL comes from the C++ headers, with the port's changes
14//! (`shaders::wgsl_sources`).
15
16mod bind_groups;
17pub mod borrowed_target;
18pub mod buffer_resource;
19pub mod command_encoder;
20pub mod context;
21pub mod device;
22pub mod draw_target;
23pub mod drawable;
24pub mod drawable_builder;
25pub mod layer_group;
26pub mod offscreen_target;
27pub mod offscreen_texture;
28pub mod render_pass;
29pub mod renderer_backend;
30pub mod shaders;
31pub mod surface_target;
32pub mod texture2d;
33pub mod tile_layer_group;
34pub mod uniform_buffer;
35pub mod upload_pass;
36pub mod vertex_buffer_resource;
37mod writes;
38
39pub use borrowed_target::{BorrowedTarget, BorrowedTextures};
40pub use context::Context;
41pub use device::Device;
42pub use offscreen_target::OffscreenTarget;
43pub use renderer_backend::RendererBackend;
44pub use surface_target::{SurfaceOptions, SurfaceTarget};