Skip to main content

frust_gpu/
lib.rs

1//! The `wgpu` adapter/device/surface substrate the render engine builds on.
2//!
3//! `frust-gpu` owns nothing rendering-specific — no scene display list, no
4//! strip pipeline, no `glifo` dependency. Its whole job is the layer directly
5//! above `wgpu` itself: probing what an adapter can actually do
6//! ([`caps::TierCaps`]) and turning that into the instance, device, surfaces
7//! and pooled GPU resources a renderer built on top of it consumes without
8//! re-deriving adapter capabilities itself. [`context::RenderContext`] is that
9//! foundation, and the one `frust-render` re-exports to its shells.
10//!
11//! [`caps::TierCaps::probe`] is the only place a real `wgpu::Adapter` is
12//! consulted; every decision built on top of it takes the plain
13//! [`caps::TierCaps`] value instead, so it stays testable with
14//! [`caps::TierCaps::fake`] and no GPU in the loop. [`surface`] and
15//! [`lifecycle`] follow the same split: every policy decision they make is a
16//! pure function over plain values, and only a handful of named entry points
17//! touch a live `wgpu::Device` or a real window handle.
18
19pub mod arena;
20pub mod caps;
21pub mod context;
22pub mod diag;
23pub mod effects;
24pub mod encoder;
25pub mod headless;
26pub mod import;
27pub mod lifecycle;
28pub mod lint;
29pub mod pipeline;
30pub mod pipeline_cache;
31pub mod pool;
32pub mod shader;
33pub mod staging;
34pub mod surface;
35pub mod texture;
36
37pub use arena::{BufferSlice, BufferUploader, HostBuffer};
38pub use caps::{DownlevelProfile, TierCaps};
39pub use context::{ContextOptions, DeviceHandle, RenderContext, test_device_limits};
40pub use diag::{GpuFrameSpans, TimestampRing};
41pub use effects::ShaderEffects;
42pub use encoder::CommandBuffer;
43pub use headless::HeadlessTarget;
44pub use lifecycle::{
45    AcquireAction, AcquireOutcome, AcquireStatus, EncodeOutcome, FrameOutcome, SurfaceEvent,
46    SurfacePhase,
47};
48pub use lint::{LintError, check_limits_against_webgl2, lint_pipeline_layout, lint_wgsl_dir};
49pub use pipeline::{PipelineCache, RenderPipelineDesc, VertexLayout};
50pub use pool::{PoolKey, PoolStats, PooledTexture, TextureAllocator, TexturePool};
51pub use shader::{ShaderId, ShaderLibrary};
52pub use staging::{StagingFrame, StagingRing};
53pub use surface::{
54    ConfiguredSurface, DetachedSurface, SURFACE_FORMATS, SurfaceAlphaRequest, SurfaceFactory,
55    compositor_expects_premultiplied,
56};
57pub use texture::{
58    Attachment, ColorAttachment, DepthAttachment, RenderTarget, SceneTextureId, Texture,
59    TextureDesc, TextureId, TextureRegistry,
60};