Skip to main content

mln_webgpu/
lib.rs

1//! The WebGPU backend, on the `wgpu` crate: [`WebGpu`], the backend's
2//! [`Gpu`](mln_gfx::gpu::Gpu), with its shaders, and the targets the
3//! renderer draws frames into.
4//!
5//! A [`RendererBackend`] renders on a [`Device`], into an
6//! [`OffscreenTarget`], a [`SurfaceTarget`] or a [`BorrowedTarget`] built on
7//! it.
8
9#![warn(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
10#![cfg_attr(not(test), warn(clippy::unreachable, clippy::print_stdout, clippy::print_stderr))]
11
12#[cfg(feature = "bench")]
13#[doc(hidden)]
14pub mod bench;
15mod borrowed_target;
16mod custom_layer;
17mod device;
18mod gpu;
19mod index_table;
20mod mipmaps;
21mod renderer_backend;
22mod shaders;
23mod surface_target;
24mod writes;
25
26/// The `tracing` targets of this crate's events (`mln_gfx`'s crate docs).
27mod log_target {
28    pub(crate) const RENDER: &str = "mln_webgpu::render";
29}
30
31pub use borrowed_target::{BorrowedTarget, BorrowedTextures, WebGpuRing, depth_stencil_format};
32pub use custom_layer::{CustomLayerEncoder, CustomLayerPass};
33pub use device::Device;
34pub use gpu::WebGpu;
35pub use renderer_backend::RendererBackend;
36pub use surface_target::{Overlay, OverlayTarget, SurfaceOptions, SurfaceTarget};
37
38/// Frames drawn into textures of the library's and read back.
39pub type OffscreenTarget = mln_gfx::offscreen_target::OffscreenTarget<WebGpu>;
40
41#[cfg(test)]
42mod tests;