Expand description
Layer 4: Frust Engine — the sparse-strip GPU render pipeline.
frust-engine turns a frust_scene::Scene into recorded GPU work. One
EngineRenderer drives one surface: it compiles the display list into
sparse strips (compile), packs them into the layouts the WGSL reads
(gpu), and records the frame’s passes into a EngineTarget through a
command encoder the caller owns and submits. Every rendering path returns
an EngineError rather than panicking (E17).
The crate splits along one line throughout: pure decisions over plain
values on one side (sizing, packing, addressing, pool keying — all
host-testable with no GPU), and a small number of named entry points that
touch a live wgpu::Device on the other. renderer is where the two
meet.
Configuration is process-global and cached, selected from environment
variables read at compile time (option_env!) or run time
(std::env::var); see config for the kill switches over layers, atlas,
pooling, depth and resource limits. FRUST_ENGINE_NO_ATLAS and
FRUST_ENGINE_ATLAS_SIZE are consulted by cache::images: the first
makes every image draw a logged skip, the second overrides the atlas extent
the adapter’s tier would otherwise choose, and
FRUST_ENGINE_NO_SHADER_EFFECTS turns off effects::shader_quad’s user
fragment programs.
Re-exports§
pub use cache::AtlasBudget;pub use cache::AtlasRegion;pub use cache::CachedRamp;pub use cache::GradientCache;pub use cache::GradientTextureLayout;pub use cache::ImageResidency;pub use cache::ImageSkip;pub use cache::ImageUpload;pub use cache::ResidentImage;pub use compile::blur_rrect::encode_blurred_rounded_rect;pub use compile::blur_rrect::inflated_bounds;pub use compile::paint::BrushEncoding;pub use compile::paint::ImageEncoding;pub use compile::paint::LutRequest;pub use compile::paint::encode_brush;pub use compile::paint::encode_image;pub use compile::paint::encode_image_brush;pub use compile::paint::encode_image_command;pub use compile::CompiledFrame;pub use compile::DepthCounter;pub use compile::EngineDraw;pub use compile::SceneCompiler;pub use diag::EngineSpan;pub use diag::FrameTimestamps;pub use effects::ShaderQuadPass;pub use error::EngineError;pub use gpu::ATLAS_FORMAT;pub use gpu::AtlasArray;pub use gpu::DepthAttachment;pub use gpu::DepthTexture;pub use gpu::EnginePipeline;pub use gpu::EngineShaderModule;pub use gpu::EngineShaders;pub use gpu::GpuConfig;pub use gpu::GpuEncodedPaint;pub use gpu::GpuStrip;pub use gpu::IntermediateTargets;pub use gpu::IntermediateTexture;pub use gpu::StripDraw;pub use gpu::lower_encoded_image;pub use renderer::EngineRenderer;pub use schedule::Composite;pub use schedule::PageParity;pub use schedule::PageTarget;pub use schedule::Round;pub use schedule::RoundOp;pub use schedule::RoundTarget;pub use schedule::Schedule;
Modules§
- cache
- Engine-side caches for GPU resources derived from a scene.
- compile
- Scene compilation: a
frust_scene::Scenebecomes sparse strips plus draws. - config
- diag
- The engine’s frame-diagnostics vocabulary: which GPU spans a frame is split into, and the label every GPU object it creates carries.
- effects
- Effects the engine renders before a frame’s own passes, into textures the frame then samples.
- error
- filters
- Layer filters: a layer rendered in isolation, run through a sequence of filter passes, and composited from the page the last of them wrote.
- gpu
- GPU-side data layouts the strip shaders read.
- renderer
EngineRenderer: the public seam a host drives one surface’s 2D frames through.- schedule
- Scheduling a recording into render passes.
Structs§
- Engine
Settings - Engine-wide render settings and configuration.
- Engine
Target - Render target descriptor passed to
EngineRenderer::encode.
Enums§
- Output
Alpha - Alpha output mode for the render target.