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 lifecycle;
27pub mod lint;
28pub mod pipeline;
29pub mod pipeline_cache;
30pub mod pool;
31pub mod shader;
32pub mod surface;
33pub mod texture;
34
35pub use arena::{BufferSlice, BufferUploader, HostBuffer};
36pub use caps::{DownlevelProfile, TierCaps};
37pub use context::{ContextOptions, DeviceHandle, RenderContext, test_device_limits};
38pub use diag::{GpuFrameSpans, TimestampRing};
39pub use effects::ShaderEffects;
40pub use encoder::CommandBuffer;
41pub use headless::HeadlessTarget;
42pub use lifecycle::{
43    AcquireAction, AcquireOutcome, AcquireStatus, EncodeOutcome, FrameOutcome, SurfaceEvent,
44    SurfacePhase,
45};
46pub use lint::{LintError, check_limits_against_webgl2, lint_pipeline_layout, lint_wgsl_dir};
47pub use pipeline::{PipelineCache, RenderPipelineDesc, VertexLayout};
48pub use pool::{PoolKey, PoolStats, PooledTexture, TextureAllocator, TexturePool};
49pub use shader::{ShaderId, ShaderLibrary};
50pub use surface::{
51    ConfiguredSurface, DetachedSurface, SURFACE_FORMATS, SurfaceAlphaRequest, SurfaceFactory,
52    compositor_expects_premultiplied,
53};
54pub use texture::{
55    Attachment, ColorAttachment, DepthAttachment, RenderTarget, SceneTextureId, Texture,
56    TextureDesc, TextureId, TextureRegistry,
57};