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