1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! Layer 4: GPU backend — wgpu 30 over the frust-owned `frust-engine` strip
//! pipeline.
//!
//! Consumes the renderer-agnostic [`frust_scene::Scene`] display list and
//! renders it into a window's swapchain. `frust-engine` draws through ordinary
//! render passes into the acquired swapchain texture — no compute pass, no
//! storage write, no intermediate and no blit — so the surface needs only
//! `RENDER_ATTACHMENT` in whatever format the platform reports, plus the depth
//! attachment the surface carries alongside it. The one variation is a
//! swapchain whose compositor genuinely reads STRAIGHT alpha: there the frame
//! lands in a surface-owned intermediate and one fragment pass un-premultiplies
//! it into the swapchain. Both presentation models live in [`RenderContext`] /
//! [`SurfaceRenderer`].
//!
//! `wgpu` types are kept out of the public API except at one deliberate seam:
//! [`SurfaceRenderer::on_surface_created`] takes a `wgpu::SurfaceTarget` (the
//! shell must hand over a window). There is no renderer to select: the engine
//! is the only one this crate contains, so what was a tier probe is now a
//! plain capability gate ([`engine_support`] over [`TierCaps`], against
//! [`ENGINE_REQUIRED_DOWNLEVEL_FLAGS`]) that refuses an adapter which cannot
//! run it. The cargo feature that gated the engine, the env-var/CLI override
//! that picked a renderer, and the vello-classic/`vello_cpu` tiers they chose
//! between are all gone.
//!
//! [`HeadlessRenderer`] renders the same scenes with no surface at all — the
//! offscreen harness this crate's pixel-regression tests compare against,
//! resolving its adapter and limits exactly as a real device does and asking
//! the same capability gate.
//!
//! [`external_pass`] is the third `wgpu`-typed seam, and the one that points
//! outward: an app or a crate beside the facade registers an [`ExternalPass`],
//! and [`SurfaceRenderer`] hands it the frame's own device, queue and encoder
//! ahead of the scene pass so it can render into a target of its own and bind
//! the result for a `Command::SceneTexture` to composite. See that module's
//! docs for the contract; `HeadlessRenderer` does not drain that registry.
//!
//! Surface lifecycle is a first-class state machine: see [`SurfaceRenderer`]
//! and [`SurfacePhase`]/[`FrameOutcome`], whose pure transition tables live in
//! `frust_gpu::lifecycle` and are re-exported here.
//!
//! # Where the foundation lives
//!
//! The `wgpu` instance, the lazily created logical device, the surface factory
//! and its cross-thread [`DetachedSurface`] hand-off, the surface lifecycle
//! state machine, the persisted pipeline-cache framing and the offscreen
//! shader-effect pipelines are all `frust-gpu`'s
//! ([`frust_gpu::context::RenderContext`], [`frust_gpu::surface`],
//! [`frust_gpu::lifecycle`], [`frust_gpu::pipeline_cache`],
//! [`frust_gpu::effects`]) — one copy, shared with every other consumer of that
//! crate. The context/surface/lifecycle types a shell touches are re-exported
//! here under the names they have always had, so `frust_render::RenderContext`
//! keeps working; the pipeline-cache framing and the shader-effect pipelines
//! were never public under this crate and are reached as
//! `frust_gpu::pipeline_cache`/`frust_gpu::effects` directly. What is genuinely this crate's own is the
//! renderer: the render-path decision, the engine resources each arm owns, the
//! engine's own capability gate, and [`SurfaceRenderer`] itself.
// The pre-scene GPU seam: caller-supplied passes recorded into the frame's own
// encoder ahead of the scene, binding their results into the engine's
// external-texture registry. Public as a module (rather than only through the
// flat re-export below) so its own docs — the whole contract a pass is written
// against — are reachable under one heading.
// Offscreen (no surface, no swapchain) engine rendering: the harness the
// pixel-regression tests render through. Reachable from outside the crate,
// unlike the effects module below, because those tests live outside it — and
// still leaking no `wgpu` type (see its module docs).
// The device/surface foundation, re-exported name for name from `frust-gpu`:
// every one of these was defined in this crate before the two copies were
// merged, and a shell must not have to care that they moved.
pub use ;
// `DeviceHandle` (the cheap-to-clone device/queue/adapter pair a shell hands
// off to `frust-shell-common`'s process-wide GPU slot — see that crate's
// `gpu` module) stays behind this crate's own `gpu` feature rather than
// joining the unconditional re-export above: `frust-gpu` itself is not
// optional, so gating costs nothing but keeps a default build of this crate
// (the only one most apps ever produce) at zero new public symbols.
pub use DeviceHandle;
// Flat, alongside every other name a caller reaches this crate by; the module
// above stays public for its docs.
pub use ;
pub use ;
// `DeferredPresent` stays here: it wraps a frame this crate's renderer
// acquired, submitted and handed back un-presented, which is a renderer
// concern, not a foundation one.
pub use ;
// The adapter-capability gate is all that is left of the tier seam: the
// renderer itself is no longer a choice, so the tier enum, its selection
// result types, the selection function, the env-var name and the override
// parsers are all gone from this surface along with the choice they
// described.
pub use ;