engawa_wgpu/lib.rs
1//! wgpu-backed `Dispatcher` impl for engawa render graphs.
2//!
3//! engawa owns the typed IR; this crate owns the wgpu wiring.
4//! Operators construct a `WgpuDispatcher` once per graph (or
5//! once per consumer lifetime), pass it the device + queue + a
6//! target format, and call `dispatch_graph` from their render
7//! loop.
8//!
9//! **Scope (v0.1):** fullscreen-effect graphs. Every node with
10//! a `Material` is dispatched as a render-pass that draws a
11//! single fullscreen triangle through a built-in vertex shader,
12//! with the operator's WGSL providing the fragment. Compute and
13//! blit passes are pending — same trait, follow-on work.
14//!
15//! **Per-call dispatch is canonical:** `WgpuDispatcher::new`
16//! clones the (internally reference-counted) device/queue
17//! handles — no lifetime borrow — and `dispatch_with` takes the
18//! graph + bindings + live handles + per-frame [`FrameUniforms`]
19//! every call. Offscreen ping-pong textures come from the
20//! [`TexturePool`] lease API.
21//!
22//! **Scope (NOT v0.1):** swapchain management, bind-group
23//! authoring. Engawa's `ResourceBindings` is the operator-facing
24//! handoff for those — the consumer binds wgpu handles to engawa
25//! `ResourceId`s. This crate dispatches; the consumer feeds it.
26
27#![forbid(unsafe_code)]
28#![doc(html_root_url = "https://docs.rs/engawa-wgpu/0.1.0")]
29
30pub mod catalog;
31mod dispatcher;
32mod pipeline;
33mod pool;
34
35pub use dispatcher::{
36 BoundResource, BoundResources, FrameUniforms, WgpuDispatcher, WgpuDispatcherError,
37};
38pub use pipeline::{combined_shader_source, FULLSCREEN_VERTEX_WGSL};
39pub use pool::{TextureKey, TextureLease, TexturePool};